aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-31 11:24:31 +0200
committerJohannes Berg <johannes@sipsolutions.net>2008-05-31 11:24:31 +0200
commit5a2cb64e4da591bea59a38fc4363ace858063930 (patch)
treed75d5464fcbe465ad7dc4e5ce814b6556db201d9
parentaaf7658adca1f515bc76913a100e82b04a228c24 (diff)
downloaddovecot-antispam-5a2cb64e4da591bea59a38fc4363ace858063930.tar.gz
dovecot-antispam-5a2cb64e4da591bea59a38fc4363ace858063930.tar.xz
dovecot-antispam-5a2cb64e4da591bea59a38fc4363ace858063930.zip
more #ifdef removal
-rw-r--r--antispam-plugin.h15
-rw-r--r--signature.c14
2 files changed, 17 insertions, 12 deletions
diff --git a/antispam-plugin.h b/antispam-plugin.h
index dfe4445..d50abf5 100644
--- a/antispam-plugin.h
+++ b/antispam-plugin.h
@@ -93,6 +93,15 @@ static inline struct istream *get_mail_stream(struct mail *mail)
return result;
}
+static inline const char *const *
+get_mail_headers(struct mail *mail, const char *hdr)
+{
+ const char *const *result;
+ if (mail_get_headers(mail, hdr, &result) < 0)
+ return NULL;
+ return result;
+}
+
static inline struct ostream *
o_stream_create_from_fd(int fd, pool_t pool ATTR_UNUSED)
{
@@ -109,6 +118,12 @@ static inline struct istream *get_mail_stream(struct mail *mail)
return mail_get_stream(mail, NULL, NULL);
}
+static inline const char *const *
+get_mail_headers(struct mail *mail, const char *hdr)
+{
+ return mail_get_headers(mail, hdr);
+}
+
static inline struct ostream *
o_stream_create_from_fd(int fd, pool_t pool)
{
diff --git a/signature.c b/signature.c
index bf257ea..7f9d83b 100644
--- a/signature.c
+++ b/signature.c
@@ -21,12 +21,7 @@ int signature_extract_to_list(struct mailbox_transaction_context *t,
const char *const *signatures;
struct siglist *item;
-#ifdef CONFIG_DOVECOT_11
- if (mail_get_headers(mail, signature_hdr, &signatures) < 0)
- signatures = NULL;
-#else
- signatures = mail_get_headers(mail, signature_hdr);
-#endif
+ signatures = get_mail_headers(mail, signature_hdr);
if (!signatures || !signatures[0]) {
mail_storage_set_error(t->box->storage,
ME(NOTPOSSIBLE)
@@ -52,12 +47,7 @@ const char *signature_extract(struct mailbox_transaction_context *t,
{
const char *const *signatures;
-#ifdef CONFIG_DOVECOT_11
- if (mail_get_headers(mail, signature_hdr, &signatures) < 0)
- signatures = NULL;
-#else
- signatures = mail_get_headers(mail, signature_hdr);
-#endif
+ signatures = get_mail_headers(mail, signature_hdr);
if (!signatures || !signatures[0]) {
mail_storage_set_error(t->box->storage,
ME(NOTPOSSIBLE)