aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--sink.c11
2 files changed, 9 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index a225672f..07a9aad3 100644
--- a/NEWS
+++ b/NEWS
@@ -173,6 +173,7 @@ fetchmail 6.3.0 (not yet released officially):
* Switched to automake. Matthias Andree.
* Got rid of alloca() in fetchmail proper. Matthias Andree
* Got rid of ipv6-connect, inner_connect and thereabouts. Matthias Andree
+* Write RFC-compliant BSMTP envelopes. Reported by Nico Golde. Matthias Andree.
fetchmail-6.2.5 (Wed Oct 15 18:39:22 EDT 2003), 23079 lines:
diff --git a/sink.c b/sink.c
index a3c52a5b..5483ca04 100644
--- a/sink.c
+++ b/sink.c
@@ -713,6 +713,7 @@ static int open_bsmtp_sink(struct query *ctl, struct msgblk *msg,
/* open a BSMTP stream */
{
struct idlist *idp;
+ int need_anglebrs;
if (strcmp(ctl->bsmtp, "-") == 0)
sinkfp = stdout;
@@ -720,8 +721,12 @@ static int open_bsmtp_sink(struct query *ctl, struct msgblk *msg,
sinkfp = fopen(ctl->bsmtp, "a");
/* see the ap computation under the SMTP branch */
- fprintf(sinkfp,
- "MAIL FROM:%s", (msg->return_path[0]) ? msg->return_path : user);
+ need_anglebrs = (msg->return_path[0] != '<');
+ fprintf(sinkfp,
+ "MAIL FROM:%s%s%s",
+ need_anglebrs ? "<" : "",
+ (msg->return_path[0]) ? msg->return_path : user,
+ need_anglebrs ? ">" : "");
if (ctl->pass8bits || (ctl->mimemsg & MSG_IS_8BIT))
fputs(" BODY=8BITMIME", sinkfp);
@@ -746,7 +751,7 @@ static int open_bsmtp_sink(struct query *ctl, struct msgblk *msg,
for (idp = msg->recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_ACCEPT)
{
- fprintf(sinkfp, "RCPT TO: %s\r\n",
+ fprintf(sinkfp, "RCPT TO:<%s>\r\n",
rcpt_address (ctl, idp->id, 1));
(*good_addresses)++;
}