fetchmail-friends
[Top] [All Lists]

[fetchmail]Re: No bounce mail...

2001-09-05 00:38:12
Quoting from Sunil Shetye's mail on Wed, Sep 05, 2001 at 12:06:33PM +0530:
fetchmail does not send any bounce message now on a bad address.

I think the patch in 5.8.17 has removed the call the send_bouncemail()
causing no bounce messages to be sent in any case.

This patch should undo it...

The patch was incomplete because the variable itself was removed...

Here is the complete patch (after the previous one is undone)...
=================================================================
--- fetchmail-5.9.0.orig/sink.c Mon Aug  6 13:32:53 2001
+++ fetchmail-5.9.0/sink.c      Wed Sep  5 12:52:15 2001
@@ -586,6 +586,7 @@
        const char      *ap;
        char            options[MSGBUFSIZE]; 
        char            addr[HOSTLEN+USERNAMELEN+1];
+       char            **from_responses;
        int             total_addresses;
 
        /*
@@ -665,6 +666,7 @@
        total_addresses = 0;
        for (idp = msg->recipients; idp; idp = idp->next)
            total_addresses++;
+       xalloca(from_responses, char **, sizeof(char *) * total_addresses);
        for (idp = msg->recipients; idp; idp = idp->next)
            if (idp->val.status.mark == XMIT_ACCEPT)
            {
@@ -694,6 +696,20 @@
 
                    handle_smtp_report(ctl, msg);
 
+#ifdef HAVE_SNPRINTF
+                   snprintf(errbuf, sizeof(errbuf), "%s: %s",
+                                   idp->id, smtp_response);
+#else
+                   strncpy(errbuf, idp->id, sizeof(errbuf));
+                   strcat(errbuf, ": ");
+                   strcat(errbuf, smtp_response);
+#endif /* HAVE_SNPRINTF */
+
+                   xalloca(from_responses[*bad_addresses], 
+                           char *, 
+                           strlen(errbuf)+1);
+                   strcpy(from_responses[*bad_addresses], errbuf);
+
                    (*bad_addresses)++;
                    idp->val.status.mark = XMIT_RCPTBAD;
                    if (outlevel >= O_VERBOSE)
@@ -702,7 +718,10 @@
                              ctl->listener, addr);
                }
            }
-
+       if (*bad_addresses)
+           send_bouncemail(ctl, msg, XMIT_RCPTBAD,
+                            "Some addresses were rejected by the MDA fetchmail 
forwards to.\r\n",
+                            *bad_addresses, from_responses);
        /*
         * It's tempting to do local notification only if bouncemail was
         * insufficient -- that is, to add && total_addresses > *bad_addresses
=================================================================

Sunil Shetye.


<Prev in Thread] Current Thread [Next in Thread>