$(srcdir)/acconfig.h
scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs $(srcdir)/specgen.sh
all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
- $(srcdir)/MANIFEST contrib
+ $(srcdir)/contrib/* $(srcdir)/MANIFEST
MANIFEST: $(srcdir)
@echo $(all) | tr "[ \t]" '\n' | sort | sed "s/\\./fetchmail-$(VERS)/" >MANIFEST
* --check now turns off --daemon.
* --syslog is now independent of --daemon.
* Multiple-error X- headers are improved.
+* Added `forcecr' to fix qmail problems by forcing CRLF termination.
-There are 246 people on the fetchmail-friends list.
-(24 bad addresses were dropped)
+There are 225 people on the fetchmail-friends list.
+(many bad addresses were dropped after the switchover to SmartList)
------------------------------------------------------------------------------
fetchmail-3.9 (Wed Apr 2 13:36:22 EST 1997)
** Support for ESMTP ETRN command.
- ** The stripcr option to explicitly control carriage-return
- stripping before mail forwarding.
+ ** The stripcr and forcecr option to explicitly control carriage-return
+ stripping and LF->CRLF mapping before mail forwarding.
Since 2.0:
do {
if (!SockGets(buf, sizeof(buf)-1, sockfp))
return(PS_SOCKET);
+
+ /* lines may not be properly CRLF terminated; fix this for qmail */
+ if (ctl->forcecr)
+ {
+ cp = buf + strlen(buf) - 1;
+ if (cp > buf && *cp == '\n' && cp[-1] != '\r')
+ {
+ *cp++ = '\r';
+ *cp++ = '\n';
+ *cp++ = '\0';
+ }
+ }
+
set_timeout(ctl->server.timeout);
/* leave extra room for reply_hack to play with */
line = realloc(line, strlen(line) + strlen(buf) + HOSTLEN + 1);
}
remaining -= n;
+ /* fix messages that have only \n line-termination (for qmail) */
+ if (ctl->forcecr)
+ {
+ cp = buf + strlen(buf) - 1;
+ if (cp > buf && *cp == '\n' && cp[-1] != '\r')
+ {
+ *cp++ = '\r';
+ *cp++ = '\n';
+ *cp++ = '\0';
+ }
+ }
+
/* check for end of message */
if (delimited && *buf == '.')
if (buf[1] == '\r' && buf[2] == '\n')
<BODY>
<H1>Frequently Asked Questions About Fetchmail</H1>
-$Id: fetchmail-FAQ.html,v 1.3 1997/04/16 20:29:43 esr Exp $<p>
+$Id: fetchmail-FAQ.html,v 1.4 1997/04/17 07:56:59 esr Exp $<p>
(Added <a href="http:#C6">C6</a> on working with qmail and
<a href="http:#C7">C7</a> on managing fetchmail in the presence of
<a href="#C3">C3. How do I know what interface and address to use with --interface?</a><br>
<a href="#C4">C4. How can I get fetchmail to work with ssh?</a><br>
<a href="#C5">C5. How can I set up support for sendmail's anti-spam 571 response?</a><br>
-<a href="#C6">C6. How can I use fetchmail multidrop mode with qmail?</a><br>
+<a href="#C6">C6. How can I use fetchmail with qmail?</a><br>
<a href="#C7">C7. How can I do automatic startup/shutdown of fetchmail
when I may have multiple login sessions going?</a><br>
message to the sender. <p>
<hr>
-<h2><a name="C6">C6. How can I use fetchmail multidrop mode with qmail?</a></h2>
+<h2><a name="C6">C6. How can I use fetchmail with qmail?</a></h2>
+
+Turn on the <tt>forcecr</tt> option; qmail's listener mode doesn't like
+header or message lines terminated with bare linefeeds.<p>
(This information is thanks to Robert de Bath
<robert@mayday.cix.co.uk>.)<p>
DEFAULT(ctl->fetchall, FALSE);
DEFAULT(ctl->rewrite, TRUE);
DEFAULT(ctl->stripcr, (ctl->mda != (char *)NULL));
+ DEFAULT(ctl->forcecr, FALSE);
DEFAULT(ctl->server.dns, TRUE);
DEFAULT(ctl->server.uidl, FALSE);
#undef DEFAULT
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",
+ ctl->forcecr ? "en" : "dis",
+ ctl->forcecr ? "on" : "off");
if (ctl->limit)
printf(" Message size limit is %d bytes (--limit %d).\n",
ctl->limit, ctl->limit);
int flush;
int rewrite;
int stripcr;
+ int forcecr;
int limit;
int fetchlimit;
int batchlimit;
fetchall
rewrite
stripcr
+ forcecr
dns
no keep
no flush
no fetchall
no rewrite
no stripcr
+ no forcecr
no dns
no envelope
limit
.PP
All options correspond to the obvious command-line arguments except
the following: `aka', `is', `to', `dns'/`no dns', `password',
-\&`preconnect', `localdomains', `stripcr'/`no stripcr' and
-\&`no received'.
+\&`preconnect', `localdomains', `stripcr'/`no stripcr' ,
+\&`forcecr'/`no forcecr' and `no received'.
.PP
The `is' or `to' keywords associate the following local (client)
name(s) (or server-name to client-name mappings separated by =) with
attempting to set up secure POP connections with the aid of
.IR ssh (1).
.PP
+The `forcecr' option controls whether lines terminated by LF only are
+given CRLF termination before forwarding. Strictly speaking RFC821
+requires this, but few MTAs enforce the requirement it so this option
+is normally off (only one such MTA, qmail, is in significant use at
+time of writing).
+.PP
The `stripcr' option controls whether carriage returns are stripped
out of retrieved mail before it is forwarded. It is normally not
necessary to set this, because it defaults to `on' (CR stripping
enabled) when there is an MDA declared but `off' (CR stripping
-disabled) when forwarding is via SMTP.
+disabled) when forwarding is via SMTP. If `stripcr' and `forcecr' are
+both on, `stripcr' will override.
.PP
Legal protocol identifiers are
flush { return FLUSH; }
fetchall { return FETCHALL; }
rewrite { return REWRITE; }
+forcecr { return FORCECR; }
stripcr { return STRIPCR; }
dns { return DNS; }
uidl { return UIDL; }
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
-%token NO KEEP FLUSH FETCHALL REWRITE STRIPCR DNS PORT UIDL
+%token NO KEEP FLUSH FETCHALL REWRITE FORCECR STRIPCR DNS PORT UIDL
%%
| FLUSH {current.flush = FLAG_TRUE;}
| FETCHALL {current.fetchall = FLAG_TRUE;}
| REWRITE {current.rewrite = FLAG_TRUE;}
+ | FORCECR {current.forcecr = FLAG_TRUE;}
| STRIPCR {current.stripcr = FLAG_TRUE;}
| NO KEEP {current.keep = FLAG_FALSE;}
| NO FLUSH {current.flush = FLAG_FALSE;}
| NO FETCHALL {current.fetchall = FLAG_FALSE;}
| NO REWRITE {current.rewrite = FLAG_FALSE;}
+ | NO FORCECR {current.forcecr = FLAG_FALSE;}
| NO STRIPCR {current.stripcr = FLAG_FALSE;}
| LIMIT NUMBER {current.limit = $2;}
FLAG_FORCE(flush);
FLAG_FORCE(fetchall);
FLAG_FORCE(rewrite);
+ FLAG_FORCE(forcecr);
FLAG_FORCE(stripcr);
FLAG_FORCE(limit);
FLAG_FORCE(fetchlimit);
FLAG_MERGE(flush);
FLAG_MERGE(fetchall);
FLAG_MERGE(rewrite);
+ FLAG_MERGE(forcecr);
FLAG_MERGE(stripcr);
FLAG_MERGE(limit);
FLAG_MERGE(fetchlimit);
# flush
# fetchall
# rewrite
+# forcecr
# stripcr
# dns
# no keep
# no flush
# no fetchall
# no rewrite
+# no forcecr
# no stripcr
# no dns
# no envelope