If you don't set your smtp_server in main.inc.php and you are on *nix you'll run into problems with extra lines in your sent headers. Since roundcube uses the mail() function if you don't set smtp_server in main.inc.php, shouldn't it account for its environment and strip the "\r" from the sending headers?
From Ben Cooke on the php page on the mail() function:
"Note that there is a big difference between the behavior of this function on Windows systems vs. UNIX systems. On Windows it delivers directly to an SMTP server, while on a UNIX system it uses a local command to hand off to the system's own MTA.
The upshot of all this is that on a Windows system your message and headers must use the standard line endings \r\n as prescribed by the email specs. On a UNIX system the MTA's "sendmail" interface assumes that recieved data will use UNIX line endings and will turn any \n to \r\n, so you must supply only \n to mail() on a UNIX system to avoid the MTA hypercorrecting to \r\r\n.
If you use plain old \n on a Windows system, some MTAs will get a little upset. qmail in particular will refuse outright to accept any message that has a lonely \n without an accompanying \r."
--Jason
We noticed that there are different behaviors on several systems when using PHPs mail function but I didn't know the facts you describe here. Anyway, with the latest CVS snapshot you can configure the header delimiters used when sending a message with RoundCube: $rcmail_config['mail_header_delimiter'] = "\r\n";
Either we keep this configuration parameter or RoundCube has to check on which platform it's running and choose the delimiters automatically.
Thanks a lot for the details on this topic. Thomas
Jason wrote:
If you don't set your smtp_server in main.inc.php and you are on *nix you'll run into problems with extra lines in your sent headers. Since roundcube uses the mail() function if you don't set smtp_server in main.inc.php, shouldn't it account for its environment and strip the "\r" from the sending headers?
From Ben Cooke on the php page on the mail() function:
"Note that there is a big difference between the behavior of this function on Windows systems vs. UNIX systems. On Windows it delivers directly to an SMTP server, while on a UNIX system it uses a local command to hand off to the system's own MTA.
The upshot of all this is that on a Windows system your message and headers must use the standard line endings \r\n as prescribed by the email specs. On a UNIX system the MTA's "sendmail" interface assumes that recieved data will use UNIX line endings and will turn any \n to \r\n, so you must supply only \n to mail() on a UNIX system to avoid the MTA hypercorrecting to \r\r\n.
If you use plain old \n on a Windows system, some MTAs will get a little upset. qmail in particular will refuse outright to accept any message that has a lonely \n without an accompanying \r."
--Jason