diff options
Diffstat (limited to 'signature.c')
-rw-r--r-- | signature.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/signature.c b/signature.c index 228ff3f..1014ed3 100644 --- a/signature.c +++ b/signature.c @@ -14,9 +14,9 @@ void signature_init(void) debug("antispam: signature header line is \"%s\"\n", signature_hdr); } -int signature_extract(struct mailbox_transaction_context *t, - struct mail *mail, struct siglist **list, - bool from_spam) +int signature_extract_to_list(struct mailbox_transaction_context *t, + struct mail *mail, struct siglist **list, + bool from_spam) { const char *const *signatures; struct siglist *item; @@ -41,6 +41,24 @@ int signature_extract(struct mailbox_transaction_context *t, return 0; } +const char *signature_extract(struct mailbox_transaction_context *t, + struct mail *mail) +{ + const char *const *signatures; + + signatures = mail_get_headers(mail, signature_hdr); + if (!signatures || !signatures[0]) { + mail_storage_set_error(t->box->storage, + "antispam signature not found"); + return NULL; + } + + while (signatures[1]) + signatures++; + + return signatures[0]; +} + void signature_list_free(struct siglist **list) { struct siglist *item, *next; |