fetchmail 6.3.15 (not yet released):
+# FEATURE
+* Fetchmail now supports a bad-header command line or rcfile option that takes
+ exactly one argument, pass or reject (default). If set to pass, fetchmail
+ will pass messages with bad headers on. This has been rejected for a long
+ time, and the right behaviour was disputed for too long.
+
# CHANGES
* The repository has been converted and moved from the Subversion (SVN) format
kindly hosted by Graham Wilson over the past years to Git format hosted on
if (ctl->server.esmtp_password)
stringdump("esmtppassword",ctl->server.esmtp_password);
booldump("tracepolls", ctl->server.tracepolls);
+ indent(0);
+ switch(ctl->server.badheader) {
+ /* this is a hack - we map this to a boolean option for
+ * fetchmailconf purposes */
+ case BHREJECT: puts("'badheader': FALSE,"); break;
+ case BHPASS: puts("'badheader': TRUE,"); break;
+ }
indent(0);
fputs("'users': ", stdout);
FLAG_MERGE(server.plugin);
FLAG_MERGE(server.plugout);
FLAG_MERGE(server.tracepolls);
+ FLAG_MERGE(server.badheader);
FLAG_MERGE(wildcard);
FLAG_MERGE(remotename);
def_opts.server.protocol = P_AUTO;
def_opts.server.timeout = CLIENT_TIMEOUT;
def_opts.server.esmtp_name = user;
+ def_opts.server.badheader = BHREJECT;
def_opts.warnings = WARNING_INTERVAL;
def_opts.remotename = user;
def_opts.listener = SMTP_MODE;
else if (outlevel >= O_VERBOSE)
printf(GT_(" No poll trace information will be added to the Received header.\n.\n"));
+ switch (ctl->server.badheader) {
+ case BHREJECT:
+ if (outlevel >= O_VERBOSE)
+ printf(GT_(" Messages with bad headers will be rejected.\n"));
+ break;
+ case BHPASS:
+ printf(GT_(" Messages with bad headers will be passed on.\n"));
+ break;
+ }
+
if (ctl->properties)
printf(GT_(" Pass-through properties \"%s\".\n"),
visbuf(ctl->properties));
flag retry; /* can getrange poll for new messages? */
};
+enum badheader { BHREJECT = 0, BHPASS };
+
struct hostdata /* shared among all user connections to given server */
{
/* rc file data */
flag tracepolls; /* if TRUE, add poll trace info to Received */
char *principal; /* Kerberos principal for mail service */
char *esmtp_name, *esmtp_password; /* ESMTP AUTH information */
+ enum badheader badheader; /* bad-header {pass|reject} */
#if defined(linux) || defined(__FreeBSD__)
#define CAN_MONITOR
reconstruction of MAIL FROM and RCPT TO lines is not guaranteed
correct; the caveats discussed under THE USE AND ABUSE OF MULTIDROP
MAILBOXES below apply.
+.TP
+.B \-\-bad\-header {reject|pass}
+(Keyword: bad\-header; since v6.3.15)
+.br
+Specify how fetchmail is supposed to treat messages with bad headers,
+i. e. headers with bad syntax. Traditionally, fetchmail has rejected such
+messages, but some distributors modified fetchmail to pass them. You can now
+configure fetchmail's behaviour per server.
+
.SS Resource Limit Control Options
.TP
.B \-l <maxbytes> | \-\-limit <maxbytes>
esmtppassword \& \& T{
Set password for RFC2554 authentication to the ESMTP server.
T}
+bad-header \& \& T{
+How to treat messages with a bad header. Can be reject (default) or pass.
+T}
.TE
Here are the legal user descriptions and options:
# Matthias Andree <matthias.andree@gmx.de>
# Requires Python with Tkinter, and the following OS-dependent services:
# posix, posixpath, socket
-version = "1.56 $Revision$"
+version = "1.57"
from Tkinter import *
from Dialog import *
self.esmtpname = None # ESMTP 2554 name
self.esmtppassword = None # ESMTP 2554 password
self.tracepolls = FALSE # Add trace-poll info to headers
+ self.badheader = FALSE # Pass messages with bad headers on?
self.users = [] # List of user entries for site
Server.typemap = (
('pollname', 'String'),
('esmtpname', 'String'),
('esmtppassword', 'String'),
('principal', 'String'),
- ('tracepolls','Boolean'))
+ ('tracepolls','Boolean'),
+ ('badheader', 'Boolean'))
def dump(self, folded):
res = ""
if self.interface or self.monitor or self.principal or self.plugin or self.plugout:
if folded:
res = res + "\n"
+ if self.badheader:
+ res = res + "bad-header pass "
if res[-1] == " ": res = res[0:-1]
ctlwin = Frame(leftwin, relief=RAISED, bd=5)
Label(ctlwin, text="Run Controls").pack(side=TOP)
Checkbutton(ctlwin, text='Poll ' + host + ' normally?', variable=self.active).pack(side=TOP)
+ Checkbutton(ctlwin, text='Pass messages with bad headers?',
+ variable=self.badheader).pack(side=TOP)
LabeledEntry(ctlwin, 'True name of ' + host + ':',
self.via, leftwidth).pack(side=TOP, fill=X)
LabeledEntry(ctlwin, 'Cycles to skip between polls:',
LA_LIMITFLUSH,
LA_IDLE,
LA_NOSOFTBOUNCE,
- LA_SOFTBOUNCE
+ LA_SOFTBOUNCE,
+ LA_BADHEADER
};
/* options still left: CgGhHjJoORTWxXYz */
{"timeout", required_argument, (int *) 0, 't' },
{"envelope", required_argument, (int *) 0, 'E' },
{"qvirtual", required_argument, (int *) 0, 'Q' },
+ {"bad-header",required_argument, (int *) 0, LA_BADHEADER},
{"user", required_argument, (int *) 0, 'u' },
{"username", required_argument, (int *) 0, 'u' },
case LA_SOFTBOUNCE:
run.softbounce = TRUE;
break;
+ case LA_BADHEADER:
+ if (strcasecmp(optarg,"pass") == 0) {
+ ctl->server.badheader = BHPASS;
+ } else if (strcasecmp(optarg,"reject") == 0) {
+ ctl->server.badheader = BHREJECT;
+ } else {
+ fprintf(stderr,GT_("Invalid bad-header policy `%s' specified.\n"), optarg);
+ errflag++;
+ }
+ break;
+
case 'p':
/* XXX -- should probably use a table lookup here */
if (strcasecmp(optarg,"auto") == 0)
#endif
P(GT_(" --plugin specify external command to open connection\n"));
P(GT_(" --plugout specify external command to open smtp connection\n"));
+ P(GT_(" --bad-header {reject|pass}\n"
+ " specify policy for handling messages with bad headers\n"));
P(GT_(" -p, --protocol specify retrieval protocol (see man page)\n"));
P(GT_(" -U, --uidl force the use of UIDLs (pop3 only)\n"));
principal { return PRINCIPAL; }
esmtpname { return ESMTPNAME; }
esmtppassword { return ESMTPPASSWORD; }
-
+bad-header { return BADHEADER; }
+pass { return PASS; }
+reject { return REJECT_; }
user(name)? {SETSTATE(NAME); return USERNAME; }
<INITIAL,NAME>pass(word)? {SETSTATE(NAME); return PASSWORD; }
%token BATCHLIMIT FETCHLIMIT FETCHSIZELIMIT FASTUIDL EXPUNGE PROPERTIES
%token SET LOGFILE DAEMON SYSLOG IDFILE PIDFILE INVISIBLE POSTMASTER BOUNCEMAIL
%token SPAMBOUNCE SOFTBOUNCE SHOWDOTS
+%token BADHEADER PASS REJECT_
%token <proto> PROTO AUTHTYPE
%token <sval> STRING
%token <number> NUMBER
| NO ENVELOPE {current.server.envelope = STRING_DISABLED;}
| TRACEPOLLS {current.server.tracepolls = FLAG_TRUE;}
| NO TRACEPOLLS {current.server.tracepolls = FLAG_FALSE;}
+ | BADHEADER PASS {current.server.badheader = BHPASS;}
+ | BADHEADER REJECT_ {current.server.badheader = BHREJECT;}
;
userspecs : user1opts {record_current(); user_reset();}
* message/rfc822 attachment and forward to postmaster (Rob
* MacGregor)
*/
- if (!refuse_mail && !isspace((unsigned char)line[0]) && !strchr(line, ':'))
+ if (!refuse_mail
+ && !ctl->server.badheader == BHPASS
+ && !isspace((unsigned char)line[0])
+ && !strchr(line, ':'))
{
if (linelen != strlen (line))
has_nuls = TRUE;