aboutsummaryrefslogtreecommitdiffstats
path: root/dspam-exec.c
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-05-03 19:26:38 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2011-05-03 19:26:38 +0200
commita1527ce7177df11a8ee1b46a0e7b64f0f0df234b (patch)
tree41f724c2a04b3582878d40dc451930e71a7b86aa /dspam-exec.c
parentc8a9a6550b84412f919b772a9cb8db1e3ef79d19 (diff)
parent808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d (diff)
downloaddovecot-antispam-master.tar.gz
dovecot-antispam-master.tar.xz
dovecot-antispam-master.zip
merge with base/masterHEADmaster
Diffstat (limited to 'dspam-exec.c')
-rw-r--r--dspam-exec.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/dspam-exec.c b/dspam-exec.c
index ecfb9f1..c4a49b4 100644
--- a/dspam-exec.c
+++ b/dspam-exec.c
@@ -141,13 +141,11 @@ static int call_dspam(const char *signature, enum classification wanted)
for (i = 0; i < extra_args_num; i++)
argv[i + 4] = (char *)extra_args[i];
-#ifdef DEBUG_SYSLOG
/*
* not good with stderr debuggin since we then write to
* stderr which our parent takes as a bug
*/
- debugv(argv);
-#endif
+ debugv_not_stderr(argv);
execv(dspam_binary, argv);
debug("executing %s failed: %d (uid=%d, gid=%d)",
@@ -163,7 +161,7 @@ struct antispam_transaction_context {
struct siglist *siglist;
};
-struct antispam_transaction_context *
+static struct antispam_transaction_context *
backend_start(struct mailbox *box __attr_unused__)
{
struct antispam_transaction_context *ast;
@@ -173,14 +171,14 @@ backend_start(struct mailbox *box __attr_unused__)
return ast;
}
-void backend_rollback(struct antispam_transaction_context *ast)
+static void backend_rollback(struct antispam_transaction_context *ast)
{
signature_list_free(&ast->siglist);
i_free(ast);
}
-int backend_commit(struct mailbox_transaction_context *ctx,
- struct antispam_transaction_context *ast)
+static int backend_commit(struct mailbox_transaction_context *ctx,
+ struct antispam_transaction_context *ast)
{
struct siglist *item = ast->siglist;
int ret = 0;
@@ -201,9 +199,9 @@ int backend_commit(struct mailbox_transaction_context *ctx,
return ret;
}
-int backend_handle_mail(struct mailbox_transaction_context *t,
- struct antispam_transaction_context *ast,
- struct mail *mail, enum classification want)
+static int backend_handle_mail(struct mailbox_transaction_context *t,
+ struct antispam_transaction_context *ast,
+ struct mail *mail, enum classification want)
{
const char *const *result = NULL;
int i;
@@ -224,7 +222,7 @@ int backend_handle_mail(struct mailbox_transaction_context *t,
return signature_extract_to_list(t, mail, &ast->siglist, want);
}
-void backend_init(pool_t pool)
+static void backend_init(pool_t pool)
{
const char *tmp;
int i;
@@ -263,6 +261,15 @@ void backend_init(pool_t pool)
signature_init();
}
-void backend_exit(void)
+static void backend_exit(void)
{
}
+
+struct backend dspam_backend = {
+ .init = backend_init,
+ .exit = backend_exit,
+ .handle_mail = backend_handle_mail,
+ .start = backend_start,
+ .rollback = backend_rollback,
+ .commit = backend_commit,
+};