aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--conf.c1
-rw-r--r--fetchmail.c1
-rw-r--r--fetchmail.h1
-rw-r--r--fetchmail.man7
-rwxr-xr-xfetchmailconf18
-rw-r--r--rcfile_l.l1
-rw-r--r--rcfile_y.y5
-rw-r--r--sink.c11
9 files changed, 42 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 6d2023cd..19987f7d 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@
continue polling silently until service is restored (at which time the
user will get a notification).
* Samuel Leo's patch to add LMTP capability to the smtphost option.
+* Fix UIDL handling on skip entries.
+* Add Don Beausee's `spambounce' option (default off).
------------------------------------------------------------------------------
fetchmail-5.6.0 (Sun Nov 26 22:11:09 EST 2000), 19625 lines:
diff --git a/conf.c b/conf.c
index 6c17b253..0de4c2a8 100644
--- a/conf.c
+++ b/conf.c
@@ -192,6 +192,7 @@ void dump_config(struct runctl *runp, struct query *querylist)
stringdump("idfile", runp->idfile);
stringdump("postmaster", runp->postmaster);
booldump("bouncemail", runp->bouncemail);
+ booldump("spambounce", runp->spambounce);
stringdump("properties", runp->properties);
booldump("invisible", runp->invisible);
booldump("showdots", runp->showdots);
diff --git a/fetchmail.c b/fetchmail.c
index 43de191c..918ef93c 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -903,6 +903,7 @@ static int load_params(int argc, char **argv, int optind)
struct stat rcstat;
run.bouncemail = TRUE;
+ run.spambounce = FALSE; /* don't bounce back to innocent bystanders */
memset(&def_opts, '\0', sizeof(struct query));
def_opts.smtp_socket = -1;
diff --git a/fetchmail.h b/fetchmail.h
index 819ff6c7..b70bd48e 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -115,6 +115,7 @@ struct runctl
int poll_interval;
char *postmaster;
flag bouncemail;
+ flag spambounce;
char *properties;
flag use_syslog;
flag invisible;
diff --git a/fetchmail.man b/fetchmail.man
index 00faf901..b5719c6a 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -1109,6 +1109,9 @@ T}
set no bouncemail \& T{
Direct error mail to postmaster rather than sender
T}
+set no spambounce \& T{
+Send spam bounces
+T}
set logfile \& T{
Name of a file to dump error and status messages to
T}
@@ -2041,8 +2044,8 @@ temporarily discards any suid privileges it may have while running the
MDA. For maximum safety, however, don't use an mda command containing
%F or %T when fetchmail is run from the root account itself.
.PP
-Fetchmail's method of sending bouncemail requires that port 25 of localhost
-be available for sending mail via SMTP.
+Fetchmail's method of sending bouncemail and spambounce requires that
+port 25 of localhost be available for sending mail via SMTP.
.PP
If you modify a
.I .fetchmailrc
diff --git a/fetchmailconf b/fetchmailconf
index ef295ce6..83e319a8 100755
--- a/fetchmailconf
+++ b/fetchmailconf
@@ -20,6 +20,7 @@ class Configuration:
self.idfile = os.environ["HOME"] + "/.fetchids" # Default idfile, initially
self.postmaster = None # No last-resort address, initially
self.bouncemail = TRUE # Bounce errors to users
+ self.spambounce = FALSE # Bounce spam errors
self.properties = None # No exiguous properties
self.invisible = FALSE # Suppress Received line & spoof?
self.syslog = FALSE # Use syslogd for logging?
@@ -30,6 +31,7 @@ class Configuration:
('idfile', 'String'),
('postmaster', 'String'),
('bouncemail', 'Boolean'),
+ ('spambounce', 'Boolean'),
('properties', 'String'),
('syslog', 'Boolean'),
('invisible', 'Boolean'))
@@ -48,6 +50,10 @@ class Configuration:
str = str + ("set bouncemail\n")
else:
str = str + ("set nobouncemail\n")
+ if self.spambounce:
+ str = str + ("set spambounce\n")
+ else:
+ str = str + ("set nospambounce\n")
if self.properties != ConfigurationDefaults.properties:
str = str + ("set properties \"%s\"\n" % (self.properties,));
if self.poll_interval > 0:
@@ -640,6 +646,11 @@ Bounces to sender?
If this option is on (the default) error mail goes to the sender.
Otherwise it goes to the postmaster.
+Send spam bounces?
+ If this option is on, spam bounces are sent to the sender or
+ postmaster (depending on the "Bounces to sender?" option. Otherwise,
+ spam bounces are not sent (the default).
+
Invisible
If false (the default) fetchmail generates a Received line into
each message and generates a HELO from the machine it is running on.
@@ -728,6 +739,13 @@ class ConfigurationEdit(Frame, MyWidget):
'relief':GROOVE}).pack(side=LEFT, anchor=W)
pf.pack(fill=X)
+ sb = Frame(gf)
+ Checkbutton(sb,
+ {'text':'send spam bounces?',
+ 'variable':self.spambounce,
+ 'relief':GROOVE}).pack(side=LEFT, anchor=W)
+ sb.pack(fill=X)
+
sf = Frame(gf)
Checkbutton(sf,
{'text':'Log to syslog?',
diff --git a/rcfile_l.l b/rcfile_l.l
index e35ecd92..e26b19fa 100644
--- a/rcfile_l.l
+++ b/rcfile_l.l
@@ -68,6 +68,7 @@ invisible { return INVISIBLE; }
showdots { return SHOWDOTS; }
postmaster { return POSTMASTER; }
bouncemail { return BOUNCEMAIL; }
+spambounce { return SPAMBOUNCE; }
warnings { return WARNINGS; }
defaults { return DEFAULTS; }
diff --git a/rcfile_y.y b/rcfile_y.y
index c912d4f5..ea622118 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -65,7 +65,8 @@ extern char * yytext;
%token NETSEC INTERFACE MONITOR PLUGIN PLUGOUT
%token IS HERE THERE TO MAP WILDCARD
%token BATCHLIMIT FETCHLIMIT EXPUNGE PROPERTIES
-%token SET LOGFILE DAEMON SYSLOG IDFILE INVISIBLE POSTMASTER BOUNCEMAIL SHOWDOTS
+%token SET LOGFILE DAEMON SYSLOG IDFILE INVISIBLE POSTMASTER BOUNCEMAIL
+%token SPAMBOUNCE SHOWDOTS
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
@@ -94,6 +95,8 @@ statement : SET LOGFILE optmap STRING {run.logfile = xstrdup($4);}
| SET POSTMASTER optmap STRING {run.postmaster = xstrdup($4);}
| SET BOUNCEMAIL {run.bouncemail = TRUE;}
| SET NO BOUNCEMAIL {run.bouncemail = FALSE;}
+ | SET SPAMBOUNCE {run.spambounce = TRUE;}
+ | SET NO SPAMBOUNCE {run.spambounce = FALSE;}
| SET PROPERTIES optmap STRING {run.properties =xstrdup($4);}
| SET SYSLOG {run.use_syslog = TRUE;}
| SET INVISIBLE {run.invisible = TRUE;}
diff --git a/sink.c b/sink.c
index 11df1871..2b1b36ac 100644
--- a/sink.c
+++ b/sink.c
@@ -413,7 +413,13 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
* coming from this address, probably due to an
* anti-spam domain exclusion. Respect this. Don't
* try to ship the message, and don't prevent it from
- * being deleted. Default values:
+ * being deleted. There's no point in bouncing the
+ * email either since most spammers don't put their
+ * real return email address anywhere in the headers
+ * (unless the user insists with the SET SPAMBOUNCE
+ * config option).
+ *
+ * Default values:
*
* 571 = sendmail's "unsolicited email refused"
* 550 = exim's new antispam response (temporary)
@@ -421,7 +427,8 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
* 554 = Postfix antispam response.
*
*/
- send_bouncemail(ctl, msg, XMIT_ACCEPT,
+ if (run.spambounce)
+ send_bouncemail(ctl, msg, XMIT_ACCEPT,
"Our spam filter rejected this transaction.\r\n",
1, responses);
return(PS_REFUSED);