aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2005-08-16 12:45:24 +0000
committerMatthias Andree <matthias.andree@gmx.de>2005-08-16 12:45:24 +0000
commitd32771d1135542b16137c90ec9382294bb98c0ed (patch)
tree0d6b1221d68393cac3451da0c38b290bc1db22a1 /sink.c
parenta167aa1d43692041646f84e7da5c3fbbfe2453d7 (diff)
downloadfetchmail-d32771d1135542b16137c90ec9382294bb98c0ed.tar.gz
fetchmail-d32771d1135542b16137c90ec9382294bb98c0ed.tar.bz2
fetchmail-d32771d1135542b16137c90ec9382294bb98c0ed.zip
Write RFC-compliant BSMTP envelopes. Reported by Nico Golde.
svn path=/trunk/; revision=4237
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c11
1 files changed, 8 insertions, 3 deletions
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)++;
}