From: Matthias A. <mat...@gm...> - 2005-08-16 14:46:43
|
Nico Golde <ni...@ng...> writes: > Hi, > > I received this bug message: > When i do 'fetchmail --bsmtp test.mail' > test.mail looks like that: > > MAIL FROM:us...@us... > RCPT TO: us...@us... > DATA.. > > Before 6.2.5.2 there was a space after the from. > This is caused by: > - "MAIL FROM: %s", (msg->return_path[0]) ? msg->return_path : user); > + "MAIL FROM:%s", (msg->return_path[0]) ? msg->return_path : user); > > Why was this space removed? Protocol conformance. The BSMTP writer is b0rked in 6.2.5.2, it lacks the angle brackets, too. What a mess. Anyways, the next 6.2.6-pre snapshot and the SVN repo versions have this fixed, too. Here's the patch from SVN, I don't know if it works for 6.2.5.2: Index: sink.c =================================================================== --- sink.c (Revision 4234) +++ sink.c (Revision 4237) @@ -713,6 +713,7 @@ /* open a BSMTP stream */ { struct idlist *idp; + int need_anglebrs; if (strcmp(ctl->bsmtp, "-") == 0) sinkfp = stdout; @@ -720,8 +721,12 @@ 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 @@ 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)++; } -- Matthias Andree |