aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Shetye <shetye@bombay.retortsoft.com>2010-10-14 00:46:31 +0530
committerMatthias Andree <matthias.andree@gmx.de>2010-10-21 12:17:13 +0100
commit361cefb5747b93aa3a6510af017ec89390673c38 (patch)
treec125ffd35c0a140619997692563fe2dcb3bdc5ff
parentfa2ac589a4dccb25e9da1757f53e2b25d1d3e1a3 (diff)
downloadfetchmail-361cefb5747b93aa3a6510af017ec89390673c38.tar.gz
fetchmail-361cefb5747b93aa3a6510af017ec89390673c38.tar.bz2
fetchmail-361cefb5747b93aa3a6510af017ec89390673c38.zip
Fix "antispam does not work"
This appears to be similar to the recent --nosoftbounce and --nobounce issue where command line options are not handled exactly the same way as the rcfile parser handles them. Reported by Kees Bakker, BerliOS bug #17599.
-rw-r--r--NEWS2
-rw-r--r--options.c2
-rw-r--r--sink.c12
3 files changed, 4 insertions, 12 deletions
diff --git a/NEWS b/NEWS
index 92aab79e..2aca1560 100644
--- a/NEWS
+++ b/NEWS
@@ -67,6 +67,8 @@ fetchmail-6.3.19 (not yet released):
of local users, not just at the end.
* In multidrop mode, header parsing is now more verbose in -vv mode, so that it
becomes possible to see which header is used.
+* Make --antispam work from command line (these used to work in rcfiles).
+ Reported by Kees Bakker, BerliOS Bug #17599. (Sunil Shetye)
# KNOWN BUGS AND WORKAROUNDS:
(this section floats upwards through the NEWS file so it stays with the
diff --git a/options.c b/options.c
index d0c7c2ab..a298cb6e 100644
--- a/options.c
+++ b/options.c
@@ -487,7 +487,7 @@ int parsecmdline (int argc /** argument count */,
buf = xstrdup(optarg);
cp = strtok(buf, ",");
do {
- struct idlist *idp = save_str(&ctl->antispam, NULL, 0);;
+ struct idlist *idp = save_str(&ctl->antispam, STRING_DUMMY, 0);
idp->val.status.num = xatoi(cp, &errflag);
} while
diff --git a/sink.c b/sink.c
index 3abbd605..92f7b433 100644
--- a/sink.c
+++ b/sink.c
@@ -441,8 +441,6 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
{
int smtperr = atoi(smtp_response);
char *responses[1];
- struct idlist *walk;
- int found = 0;
responses[0] = xstrdup(smtp_response);
@@ -466,15 +464,7 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
* messages, which are probably in English (none of the
* MTAs I know about are internationalized).
*/
- for( walk = ctl->antispam; walk; walk = walk->next )
- if ( walk->val.status.num == smtperr )
- {
- found=1;
- break;
- }
-
- /* if (str_find(&ctl->antispam, smtperr)) */
- if ( found )
+ if (str_find(&ctl->antispam, smtperr))
{
/*
* SMTP listener explicitly refuses to deliver mail