aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--driver.c15
-rw-r--r--fetchmail.c8
-rw-r--r--fetchmail.h1
-rw-r--r--fetchmail.man17
-rw-r--r--rcfile_l.l3
-rw-r--r--rcfile_y.y6
-rw-r--r--sample.rcfile1
8 files changed, 42 insertions, 12 deletions
diff --git a/NEWS b/NEWS
index 8233d2ef..3ae41997 100644
--- a/NEWS
+++ b/NEWS
@@ -23,7 +23,8 @@ pl 3.9.9 ():
* We can now process multiple To headers a la Microsoft Exchange Server.
* Avoid sending LIST and getting an error when no messages are waiting.
* Allow `fetchmail' to do wakeup even when no .fetchmailrc.
-* Fix Paul Sutvliffe's headerless-mail bug.
+* Fixed Paul Sutcliffe's headerless-mail bug.
+* Added `pass8bits' to help prevent internationalization lossage.
pl 3.9.8 (Sat Jun 14 14:19:32 EDT 1997):
* Fetchmail is now normally built with optimization.
diff --git a/driver.c b/driver.c
index c90707e6..95f8eab4 100644
--- a/driver.c
+++ b/driver.c
@@ -771,13 +771,16 @@ char *realname; /* real name of host */
* desired tokenizing effect.
*/
options[0] = '\0';
- if ((ctl->server.esmtp_options & ESMTP_8BITMIME)
- && (ctt_offs >= 0)
- && (ctt = nxtaddr(headers + ctt_offs)))
- if (!strcasecmp(ctt,"7BIT"))
- sprintf(options, " BODY=7BIT");
- else if (!strcasecmp(ctt,"8BIT"))
+ if (ctl->server.esmtp_options & ESMTP_8BITMIME)
+ if (ctl->pass8bits)
sprintf(options, " BODY=8BITMIME");
+ else if ((ctt_offs >= 0) && (ctt = nxtaddr(headers + ctt_offs)))
+ {
+ if (!strcasecmp(ctt,"7BIT"))
+ sprintf(options, " BODY=7BIT");
+ else if (!strcasecmp(ctt,"8BIT"))
+ sprintf(options, " BODY=8BITMIME");
+ }
if ((ctl->server.esmtp_options & ESMTP_SIZE))
sprintf(options + strlen(options), " SIZE=%ld", len);
diff --git a/fetchmail.c b/fetchmail.c
index d29b6219..1466a2cc 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -651,6 +651,7 @@ static int load_params(int argc, char **argv, int optind)
DEFAULT(ctl->rewrite, TRUE);
DEFAULT(ctl->stripcr, (ctl->mda != (char *)NULL));
DEFAULT(ctl->forcecr, FALSE);
+ DEFAULT(ctl->pass8bits, FALSE);
DEFAULT(ctl->server.dns, TRUE);
DEFAULT(ctl->server.uidl, FALSE);
#undef DEFAULT
@@ -918,12 +919,15 @@ void dump_params (struct query *ctl)
printf(" Rewrite of server-local addresses is %sabled (--norewrite %s).\n",
ctl->rewrite ? "en" : "dis",
ctl->rewrite ? "off" : "on");
- printf(" Carriage-return stripping is %sabled (--stripcr %s).\n",
+ printf(" Carriage-return stripping is %sabled (stripcr %s).\n",
ctl->stripcr ? "en" : "dis",
ctl->stripcr ? "on" : "off");
- printf(" Carriage-return forcing is %sabled (--forcecr %s).\n",
+ printf(" Carriage-return forcing is %sabled (forcecr %s).\n",
ctl->forcecr ? "en" : "dis",
ctl->forcecr ? "on" : "off");
+ printf(" Interpretation of Content-Transfer-Encoding is %sabled (pass8bits %s).\n",
+ ctl->pass8bits ? "dis" : "en",
+ ctl->pass8bits ? "on" : "off");
if (ctl->limit > 0)
printf(" Message size limit is %d bytes (--limit %d).\n",
ctl->limit, ctl->limit);
diff --git a/fetchmail.h b/fetchmail.h
index ed3dc365..30a5c0f8 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -120,6 +120,7 @@ struct query
bool rewrite; /* if TRUE, canonicalize recipient addresses */
bool stripcr; /* if TRUE, strip CRs in text */
bool forcecr; /* if TRUE, force CRs before LFs in text */
+ bool pass8bits; /* if TRUE, ignore Content-Transfer-Encoding */
int limit; /* limit size of retrieved messages */
int fetchlimit; /* max # msgs to get in single poll */
int batchlimit; /* max # msgs to pass in single SMTP session */
diff --git a/fetchmail.man b/fetchmail.man
index 777f5c08..517bd862 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -645,6 +645,7 @@ Legal user options are
rewrite
stripcr
forcecr
+ pass8bits
dns
no keep
no flush
@@ -652,6 +653,7 @@ Legal user options are
no rewrite
no stripcr
no forcecr
+ no pass8bits
no dns
no envelope
limit
@@ -665,7 +667,7 @@ comma-separated list of names following them.
All options correspond to the obvious command-line arguments, except
the following: `interval', `aka', `is', `to', `dns'/`no dns', `password',
\&`preconnect', `localdomains', `stripcr'/`no stripcr' ,
-\&`forcecr'/`no forcecr' and `no received'.
+\&`forcecr'/`no forcecr', `pass8bits'/`no pass8bits' and `no received'.
.PP
The `interval' option (which takes a numeric argument) allows you to poll a
server less frequently than the basic poll interval. If you say
@@ -747,6 +749,19 @@ enabled) when there is an MDA declared but `off' (CR stripping
disabled) when forwarding is via SMTP. If `stripcr' and `forcecr' are
both on, `stripcr' will override.
.PP
+The `pass8bits' option exists to cope with Microsoft mail programs that
+stupidly slap a "Content-Transfer-Encoding: 7bit" on everything. With
+this option off (the default) and such a header present,
+.I fetchmail
+declares BODY=7BIT to an ESMTP-capable listener; this causes problems for
+messages actually using 8-bit ISO or KOI-8 character sets, which will
+be garbled by having the high bits of all characters stripped. If
+\&`pass8bits' is on,
+.I fetchmail
+is forced to declare BODY=8BITMIME to any ESMTP-capable listener. If
+the listener is 8-bit-clean (as all the major ones now are) the right
+thing will probably result.
+.PP
Legal protocol identifiers are
auto (or AUTO)
diff --git a/rcfile_l.l b/rcfile_l.l
index 80056028..bae66f0c 100644
--- a/rcfile_l.l
+++ b/rcfile_l.l
@@ -46,7 +46,7 @@ pass(word)? { return PASSWORD; }
folder(s)? { return FOLDER; }
smtp(host)? { return SMTPHOST; }
mda { return MDA; }
-pre(connect) { return PRECONNECT; }
+pre(connect)? { return PRECONNECT; }
interface { return INTERFACE; }
monitor { return MONITOR; }
@@ -65,6 +65,7 @@ fetchall { return FETCHALL; }
rewrite { return REWRITE; }
forcecr { return FORCECR; }
stripcr { return STRIPCR; }
+pass8(bits)? { return PASS8BITS; }
dns { return DNS; }
uidl { return UIDL; }
diff --git a/rcfile_y.y b/rcfile_y.y
index 6fa77305..decf6111 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -53,7 +53,8 @@ extern char * yytext;
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
-%token NO KEEP FLUSH FETCHALL REWRITE FORCECR STRIPCR DNS PORT UIDL INTERVAL
+%token NO KEEP FLUSH FETCHALL REWRITE FORCECR STRIPCR PASS8BITS
+%token DNS PORT UIDL INTERVAL
%%
@@ -215,6 +216,7 @@ user_option : TO localnames HERE
| REWRITE {current.rewrite = FLAG_TRUE;}
| FORCECR {current.forcecr = FLAG_TRUE;}
| STRIPCR {current.stripcr = FLAG_TRUE;}
+ | PASS8BITS {current.pass8bits = FLAG_TRUE;}
| NO KEEP {current.keep = FLAG_FALSE;}
| NO FLUSH {current.flush = FLAG_FALSE;}
@@ -411,6 +413,7 @@ static void record_current(void)
FLAG_FORCE(rewrite);
FLAG_FORCE(forcecr);
FLAG_FORCE(stripcr);
+ FLAG_FORCE(pass8bits);
FLAG_FORCE(limit);
FLAG_FORCE(fetchlimit);
FLAG_FORCE(batchlimit);
@@ -455,6 +458,7 @@ void optmerge(struct query *h2, struct query *h1)
FLAG_MERGE(rewrite);
FLAG_MERGE(forcecr);
FLAG_MERGE(stripcr);
+ FLAG_MERGE(pass8bits);
FLAG_MERGE(limit);
FLAG_MERGE(fetchlimit);
FLAG_MERGE(batchlimit);
diff --git a/sample.rcfile b/sample.rcfile
index 288bdf12..7547c2d5 100644
--- a/sample.rcfile
+++ b/sample.rcfile
@@ -47,6 +47,7 @@
# rewrite
# forcecr
# stripcr
+# pass8bits
# dns
# no keep
# no flush