aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-11-30 20:10:02 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-11-30 20:10:02 +0000
commitb20a403a58d2a50e16b0057259b3c6d37e1685ea (patch)
tree2d33927872459562e13921f1c1a922fb16d49617 /driver.c
parent207601ccb5c5c4af8ebefb43ac58b5e95c7fe01e (diff)
downloadfetchmail-b20a403a58d2a50e16b0057259b3c6d37e1685ea.tar.gz
fetchmail-b20a403a58d2a50e16b0057259b3c6d37e1685ea.tar.bz2
fetchmail-b20a403a58d2a50e16b0057259b3c6d37e1685ea.zip
Try to accomodate spam filtering
svn path=/trunk/; revision=588
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/driver.c b/driver.c
index 70192ac5..c28098b2 100644
--- a/driver.c
+++ b/driver.c
@@ -547,10 +547,25 @@ struct query *ctl; /* query control record */
* ID. This won't affect replies, which use the header
* From address anyway.
*/
- if (!fromhdr || !(ap = nxtaddr(fromhdr))
- || SMTP_from(sinkfp, ap) != SM_OK)
+ if (!fromhdr || !(ap = nxtaddr(fromhdr)))
+ {
if (SMTP_from(sinkfp, user) != SM_OK)
return(PS_SMTP); /* should never happen */
+ }
+ else if (SMTP_from(sinkfp, ap) != SM_OK)
+ if (smtp_response == 571)
+ {
+ /*
+ * SMTP listener explicitly refuses to deliver
+ * mail coming from this address, probably due
+ * to an anti-spam domain exclusion. Respect
+ * this.
+ */
+ sinkfp = (FILE *)NULL;
+ goto skiptext;
+ }
+ else if (SMTP_from(sinkfp, user) != SM_OK)
+ return(PS_SMTP); /* should never happen */
/* now list the recipient addressees */
for (idp = xmit_names; idp; idp = idp->next)
@@ -574,6 +589,8 @@ struct query *ctl; /* query control record */
SMTP_data(sinkfp);
if (outlevel == O_VERBOSE)
fputs("SMTP> ", stderr);
+
+ skiptext:;
}
/* change continuation markers back to regular newlines */
@@ -594,7 +611,7 @@ struct query *ctl; /* query control record */
/* write all the headers */
if (ctl->mda[0])
n = write(mboxfd,headers,oldlen);
- else
+ else if (sinkfp)
n = SockWrite(headers, oldlen, sinkfp);
if (n < 0)
@@ -676,7 +693,7 @@ struct query *ctl; /* query control record */
/* ship out the text line */
if (ctl->mda[0])
n = write(mboxfd,bufp,strlen(bufp));
- else
+ else if (sinkfp)
n = SockWrite(bufp, strlen(bufp), sinkfp);
if (!ctl->mda[0])