aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-10-01 16:00:09 +0200
committerJohannes Berg <johannes@sipsolutions.net>2007-10-01 16:00:09 +0200
commit023e53996cdf20d7e2a314386616028d8a279408 (patch)
tree29e34c98e29d462f5c0d7f65e30c8117725f4102
parent8b4cf32c028e144c60ec7313de53eee8008fa673 (diff)
downloaddovecot-antispam-023e53996cdf20d7e2a314386616028d8a279408.tar.gz
dovecot-antispam-023e53996cdf20d7e2a314386616028d8a279408.tar.xz
dovecot-antispam-023e53996cdf20d7e2a314386616028d8a279408.zip
use last signature header line
Sometimes you'll get incoming mail that already had a signature header line from somebody else's misconfigured antispam setup. Use the last found signature header line to avoid retraining failures because the wrong signature was used.
-rw-r--r--signature.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/signature.c b/signature.c
index 4588126..228ff3f 100644
--- a/signature.c
+++ b/signature.c
@@ -18,20 +18,23 @@ int signature_extract(struct mailbox_transaction_context *t,
struct mail *mail, struct siglist **list,
bool from_spam)
{
- const char *signature;
+ const char *const *signatures;
struct siglist *item;
- signature = mail_get_first_header(mail, signature_hdr);
- if (!signature || !signature[0]) {
+ signatures = mail_get_headers(mail, signature_hdr);
+ if (!signatures || !signatures[0]) {
mail_storage_set_error(t->box->storage,
"antispam signature not found");
return -1;
}
+ while (signatures[1])
+ signatures++;
+
item = i_new(struct siglist, 1);
item->next = *list;
item->from_spam = from_spam;
- item->sig = i_strdup(signature);
+ item->sig = i_strdup(signatures[0]);
*list = item;