fetchmail-friends
[Top] [All Lists]

[fetchmail]Re: fetchmail SIGPIPE error with unescaped ^\.$

2002-06-07 03:31:28
Eric S Raymond <esr(_at_)thyrsus(_dot_)com> writes:

Neal McBurnett <neal(_at_)bcn(_dot_)boulder(_dot_)co(_dot_)us>:
I suggest the addition of a prominant notice in the release notes,
since affected users have to do something besides just installing:

  If your .fetchmailrc file invokes sendmail, it should do
  so with the "-i" option.  Otherwise fetchmail can get stuck
  on messages that contain "." on a line by itself.
  The fetchmail man page has been updated to reflect this.

I have added appropriate material to the FAQ.

I may have missed that, but configure.in seems to need patching to use
sendmail -i then, otherwise the fallback MDA will be hosed.

However, I think that "fallback MDA" is a dangerous beast and must
default to "no".

There are several compelling reasons:

1. there is no way to predict when the fallback is used. With some MTAs
   (such as those limiting load average), outer circumstances can cause
   the fallback to kick in.

2. the fallback changes fetchmail behaviour in unpredictable ways. It's
   not only about alias expansion, .forwards to special filters won't
   work, mail may end up in a different place (users claim "mail loss"
   for that).

3. fallback is hard to track.

4. My "extra CR" issue (which can only have happened through fallback)
   has not been officially resolved. It could not be reproduced at the
   time I reported it.

5. The claim procmail did the right thing with its exit codes is plain
   wrong. I've seen procmail exit with code 1 when it should have exited
   with code 75, like, configuration errors. Procmail is a dangerous
   beast and is best replaced by maildrop.

6. if multiple choices exist (like procmail and maildrop), fetchmail
   cannot tell which one it should choose. Say, your MTA is configured
   to use maildrop to deliver to user's mailboxes, if fetchmail then
   chooses procmail, this is plain wrong.

These technical reasons why fallback should be dropped or at least
disabled by default, there is one more thing:

7. procmail should *never* be chosen as default fallback for that reason.

fetchmail has the reputation of losing mail in adverse conditions, and
this fallback mechanism can cause such "loss" (even if "loss" is only
that the user does not find his mail because .forward or .mumblerc did
not get applied). Don't feed this reputation by keeping dangerous
mechanisms.

Last but not least, fetchmail -V does not dump the fallback
configuration which may be helpful to aid debugging. Below is a trivial
patch to correct this.


For the future, i. e. 6.0.1, it might be useful if fetchmail tried to
open its smtp sink BEFORE even looking at the remote server.


This patch fixes the whole stack:

Index: configure.in
===================================================================
RCS file: /var/CVS/fetchmail/configure.in,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 configure.in
--- configure.in        2002/06/05 16:31:43     1.1.1.3
+++ configure.in        2002/06/07 09:54:45
@@ -243,7 +243,7 @@
                                AC_ERROR([Sendmail selected as fallback, but 
not found])
                                #not reached
                        fi
-                       AC_DEFINE_UNQUOTED(FALLBACK_MDA, "$sendmail %T")
+                       AC_DEFINE_UNQUOTED(FALLBACK_MDA, "$sendmail -i %T")
                        echo "Will use $sendmail as fallback MDA."
                        ;;
        procmail)       if test -z "$procmail" ; then
@@ -262,13 +262,12 @@
                        ;;
        no|unset)       echo "Will not use a fallback MDA"
                        ;;
-       auto|yes|set)   if test -n "$procmail" ; then
-                               AC_DEFINE_UNQUOTED(FALLBACK_MDA,"$procmail -d 
%T")
-                               echo "Will use $procmail as fallback MDA."
-                       elif test -n "$sendmail" ; then
-                               AC_DEFINE_UNQUOTED(FALLBACK_MDA,"$sendmail %T")
+       auto|yes|set)   if test -n "$sendmail" ; then
+                               AC_DEFINE_UNQUOTED(FALLBACK_MDA,"$sendmail -i 
%T")
                                echo "Will use $sendmail as fallback MDA."
-                       else    echo "No fallback MDA available."
+                       else
+                               echo "No fallback MDA available. procmail and 
maildrop are not eligible"
+                               echo "for automatic fallback MDA configuration 
for reliability reasons."
                        fi
                        ;;
        *)              AC_ERROR([unkown value for --enable-fallback given: 
$enable_fallback])

Index: fetchmail.c
===================================================================
RCS file: /var/CVS/fetchmail/fetchmail.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 fetchmail.c
--- fetchmail.c 2002/06/03 14:35:08     1.1.1.2
+++ fetchmail.c 2002/06/07 10:10:39
@@ -223,6 +223,13 @@
        printf("+NLS");
 #endif /* ENABLE_NLS */
        putchar('\n');
+       fputs("Fallback MDA: ", stdout);
+#ifdef FALLBACK_MDA
+       fputs(FALLBACK_MDA, stdout);
+#else
+       fputs("(none)", stdout);
+#endif
+       putchar('\n');
        fflush(stdout);
 
        /* this is an attempt to help remote debugging */


-- 
Matthias Andree