Topic: Bare line feed in SMTP conversation.

Hello,

When sending mail to my users i use qmail on localhost. However, it seems that your coding did not take into fact that in an SMTP conversation there has to be a \r\n ending EVERY line, so the SMTP conversation needs to look like this:

connect localhost 25
-> 220 Localhost ESMTP\r\n
<- EHLO Remotehost\r\n
-> 250-Localhost\r\n
-> 250-AUTH LOGIN\r\n
-> 250 8BITMIME\r\n
<- AUTH LOGIN\r\n
-> 334 VXNlcm5hbWU6\r\n
<- base64(username)\r\n
-> 334 UGFzc3dvcmQ6\r\n
<- base64(password)\r\n
-> 250 Go ahead\r\n
<- MAIL FROM: punBB <forums@x-istence.com>\r\n
-> 250 ok\r\n
<- MAIL TO: username <usersemail@usersdomain.com>\r\n
-> 250 ok\r\n
<- DATA\r\n
-> 354 go ahead\r\n
<- From: punbb <forums@x-istence.com>\r\n
<- To: username <usersemail@usersdomain.com>\r\n
<- Date: a date here\r\n
<- \r\n
<- Message itself comes here. \r\n
<- More message \r\n
<- \r\n
<- .\r\n
-> 250 ok 1097339348 qp 28684\r\n
<- QUIT \r\n

Otherwise qmail spits out the following message:

451 See http://pobox.com/~djb/docs/smtplf.html.

Please fix it please smile.


Thank you,

J-W Regeer

BTW: I love PunBB, thanks to a friend of mine who said i should use it.

Re: Bare line feed in SMTP conversation.

It has been reported several times before and has been fixed in 1.2. Here's a temporary fix for 1.1: http://punbb.org/forums/viewtopic.php?id=3274

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Bare line feed in SMTP conversation.

Thanks a lot Rickard. I appreciate it smile

Re: Bare line feed in SMTP conversation.

Per your thread, i tried changing the header part and adding the $message str_replace stuff, but that did not work, so i changed it back to how it was and did this instead:

        $message = str_replace("\n", "\r\n", $message);
        $headers = str_replace("\n", "\r\n", $headers);

Sorry for posting about a previously answered question, i did search yet did not find anything.

X-Istence