1 --- spamass-milter.cpp.orig 2011-07-14 21:30:24.147827542 +0200
2 +++ spamass-milter.cpp 2011-07-14 21:35:35.195373664 +0200
4 bool flag_expand = false; /* alias/virtusertable expansion */
5 bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */
6 bool ignore_authenticated_senders = false; /* authenticated users bypass spam checks */
7 +bool flag_customreject = false;
13 main(int argc, char* argv[])
16 - const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:";
17 + const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:xg:c:";
26 + flag_customreject = true;
27 + reject_message = strdup(optarg);
33 cout << " -u defaultuser: pass the recipient's username to spamc.\n"
34 " Uses 'defaultuser' if there are multiple recipients." << endl;
35 cout << " -x: pass email address through alias and virtusertable expansion." << endl;
36 + cout << " -c: custom reject message." << endl;
37 cout << " -- spamc args: pass the remaining flags to spamc." << endl;
44 - debug(D_MISC, "Rejecting");
45 - smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>("Blocked by SpamAssassin"));
46 + if (flag_customreject)
48 + debug(D_MISC, "Rejecting with custom message");
49 + smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>(reject_message));
53 + debug(D_MISC, "Rejecting");
54 + smfi_setreply(ctx, const_cast<char*>("550"), const_cast<char*>("5.7.1"), const_cast<char*>("Blocked by SpamAssassin"));