aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2003-10-10 10:55:46 +0000
committerEric S. Raymond <esr@thyrsus.com>2003-10-10 10:55:46 +0000
commit30884a491e4fca0ade13b594565beef2136bb1e8 (patch)
treeaa5f0af47e0570af98e321798e96d6b7745eae57
parent33bc965543517dedfbff9299f9e8af6ffa14c5db (diff)
downloadfetchmail-30884a491e4fca0ade13b594565beef2136bb1e8.tar.gz
fetchmail-30884a491e4fca0ade13b594565beef2136bb1e8.tar.bz2
fetchmail-30884a491e4fca0ade13b594565beef2136bb1e8.zip
Close a Debian bug.
svn path=/trunk/; revision=3840
-rw-r--r--NEWS2
-rw-r--r--fetchmail.man4
-rw-r--r--sink.c34
-rw-r--r--todo.html15
4 files changed, 51 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 10ae4ded..1d9bb62f 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@
flushing if both "flush" and "limit" were specified.
* rfc822.c fixes for CAN-2003-0790 and CAN-2003-0792 potential
remote DOS attack vulnerabilities.
+* Benjamin Drieu's patch for Debian bug #156592, incorrect handing of host/port
+ option.
fetchmail-6.2.4 (Wed Aug 13 04:27:35 EDT 2003), 22625 lines:
diff --git a/fetchmail.man b/fetchmail.man
index 522de040..06dc9b41 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -418,7 +418,9 @@ after removing any single quotes they may contain, before the MDA
command is passed to the shell. Do \fInot\fR use an MDA invocation
like "sendmail -i -t" that dispatches on the contents of To/Cc/Bcc, it
will create mail loops and bring the just wrath of many postmasters
-down upon your head.
+down upon your head. Also, do \fInot\fR try to combine multidrop
+mode with an MDA such as procmail that can only accept one addressee;
+you will lose.
.TP
.B \-\-lmtp
(Keyword: lmtp)
diff --git a/sink.c b/sink.c
index 6f437532..fd69c5ad 100644
--- a/sink.c
+++ b/sink.c
@@ -211,7 +211,39 @@ int smtp_open(struct query *ctl)
ctl->destaddr = (ctl->smtphost && ctl->smtphost[0] != '/') ? ctl->smtphost : "localhost";
}
else
- ctl->destaddr = ctl->smtpaddress ? ctl->smtpaddress : ( ctl->smtphost && ctl->smtphost[0] != '/' ? ctl->smtphost : "localhost");
+ {
+ /*
+ * Here we try to find a correct domain name part for the RCPT
+ * TO address. If smtpaddress is set, no need to guestimate
+ * it. Otherwise, using ctl->smtphost as a base is a good
+ * base, although we may have to strip any port appended to
+ * communicate with SMTP servers that do not listen on the
+ * SMTP port. (benj) */
+ if (ctl->smtpaddress)
+ ctl->destaddr = ctl->smtpaddress;
+ else if (ctl->smtphost && ctl->smtphost[0] != '/')
+ {
+ char * cp;
+ if (cp = strchr (ctl->smtphost, '/'))
+ {
+ /* As an alternate port for smtphost is specified, we
+ need to strip it from domain name. */
+ char *smtpname;
+ xalloca(smtpname, char *, cp - ctl->smtphost + 1);
+ strncpy(smtpname, ctl->smtphost, cp - ctl->smtphost +1);
+ cp = strchr(smtpname, '/');
+ *cp = 0;
+ ctl->destaddr = smtpname;
+ }
+ else
+ /* No need to strip port, domain name is smtphost. */
+ ctl->destaddr = ctl->smtphost;
+ }
+ /* No smtphost is specified or it is a UNIX socket, then use
+ localhost as a domain part. */
+ else
+ ctl->destaddr = "localhost";
+ }
if (outlevel >= O_DEBUG && ctl->smtp_socket != -1)
report(stdout, GT_("forwarding to %s\n"), ctl->smtphost);
diff --git a/todo.html b/todo.html
index 5d695b55..0ce5014a 100644
--- a/todo.html
+++ b/todo.html
@@ -19,7 +19,7 @@ content="Known bugs and to-do items in fetchmail" />
<tr>
<td width="30%">Back to <a href="/~esr">Eric's Home Page</a></td>
<td width="30%" align="center">Up to <a href="/~esr/sitemap.html">Site Map</a></td>
-<td width="30%" align="right">$Date: 2003/07/17 00:55:18 $</td>
+<td width="30%" align="right">$Date: 2003/10/10 10:55:46 $</td>
</tr>
</table>
@@ -72,6 +72,17 @@ SockOpen (this will get rid of the kluge in rcfile_y.y).</p>
@ ought to be treated as an smtpname option, with the domain part
removed for other purposes such as local-address matching.</p>
+<p>Maybe refuse multidrop configuration unless "envelope" is _explicitly_
+configured (and tell the user he needs to configure the envelope
+option) and change the envelope default to nil. This would
+prevent a significant class of shoot-self-in-foot problems.</p>
+
+<p>Given the above change, perhaps treat a delivery as "temporarily
+failed" (leaving the message on the server, not putting it into
+.fetchids) when the header listed in the "envelope" option is not
+found. (This is so you don't lose mail if you configure the wrong
+envelope header.)</p>
+
<p>The <a
href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=fetchmail&amp;archive=no">
Debian bug-tracking page for fetchmail</a> lists other bug
@@ -82,7 +93,7 @@ reports.</p>
<tr>
<td width="30%">Back to <a href="/~esr">Eric's Home Page</a></td>
<td width="30%" align="center">Up to <a href="/~esr/sitemap.html">Site Map</a></td>
-<td width="30%" align="right">$Date: 2003/07/17 00:55:18 $</td>
+<td width="30%" align="right">$Date: 2003/10/10 10:55:46 $</td>
</tr>
</table>