mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
Use Auto-Submitted: auto-generated header to identify bots
New `dc_msg_is_bot()` C API and corresponding `Message.is_bot()` Python API can be used to check if incoming message is sent by a bot, e.g. to avoid two echo bots replying indefinitely to each other. "Bot" flag is not set for outgoing messages, but may be set for BCC-self messages. For now documentation says that `dc_msg_is_bot()` return value is unspecified for outgoing messages. It can be better specified later if needed for specific applications, e.g. sharing an account with a helper bot.
This commit is contained in:
@@ -491,6 +491,11 @@ impl<'a> MimeFactory<'a> {
|
||||
"Auto-Submitted".to_string(),
|
||||
"auto-replied".to_string(),
|
||||
));
|
||||
} else if context.get_config_bool(Config::Bot).await? {
|
||||
headers.unprotected.push(Header::new(
|
||||
"Auto-Submitted".to_string(),
|
||||
"auto-generated".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
if self.req_mdn {
|
||||
|
||||
Reference in New Issue
Block a user