diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-10-01 22:16:00 +0200 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2007-10-01 22:16:00 +0200 |
commit | b359532647ccd3ac3221dcb37dca7bdb4cbb2e58 (patch) | |
tree | 19d4cf35186177294a565f06aafd6b918d20506d /dspam-exec.c | |
parent | 6ea8c069b7df7cc37b8c8daa8cd220ad3ca1d57e (diff) | |
download | dovecot-antispam-b359532647ccd3ac3221dcb37dca7bdb4cbb2e58.tar.gz dovecot-antispam-b359532647ccd3ac3221dcb37dca7bdb4cbb2e58.tar.xz dovecot-antispam-b359532647ccd3ac3221dcb37dca7bdb4cbb2e58.zip |
use 'enum classification' instead of 'bool from_spam'
Diffstat (limited to 'dspam-exec.c')
-rw-r--r-- | dspam-exec.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/dspam-exec.c b/dspam-exec.c index 0d02a24..f0b1824 100644 --- a/dspam-exec.c +++ b/dspam-exec.c @@ -35,7 +35,7 @@ static int extra_args_num = 0; #define FIXED_ARGS_NUM 6 -static int call_dspam(const char *signature, bool from_spam) +static int call_dspam(const char *signature, enum classification wanted) { pid_t pid; const char *class_arg; @@ -43,10 +43,14 @@ static int call_dspam(const char *signature, bool from_spam) int pipes[2]; sign_arg = t_strconcat("--signature=", signature, NULL); - if (from_spam) + switch (wanted) { + case CLASS_NOTSPAM: class_arg = t_strconcat("--class=", "innocent", NULL); - else + break; + case CLASS_SPAM: class_arg = t_strconcat("--class=", "spam", NULL); + break; + } /* * For dspam stderr; dspam seems to not always exit with a @@ -167,7 +171,7 @@ int backend_commit(struct mailbox_transaction_context *ctx, int ret = 0; while (item) { - if (call_dspam(item->sig, item->from_spam)) { + if (call_dspam(item->sig, item->wanted)) { ret = -1; mail_storage_set_error(ctx->box->storage, "Failed to call dspam"); @@ -183,9 +187,9 @@ int backend_commit(struct mailbox_transaction_context *ctx, int backend_handle_mail(struct mailbox_transaction_context *t, struct antispam_transaction_context *ast, - struct mail *mail, bool from_spam) + struct mail *mail, enum classification want) { - return signature_extract_to_list(t, mail, &ast->siglist, from_spam); + return signature_extract_to_list(t, mail, &ast->siglist, want); } void backend_init(pool_t pool) |