Opened 6 years ago
Closed 6 years ago
#1484360 closed Bugs (wontfix)
needless try to autodetect mail header delimiter
| Reported by: | lespocky@… | Owned by: | |
|---|---|---|---|
| Priority: | 2 | Milestone: | |
| Component: | Client Scripts | Version: | git-master |
| Severity: | minor | Keywords: | delimiter rfc 2822 |
| Cc: |
Description
RFC 2822 says explicitly that the delimiter for lines in e-mail should be CRLF, which is ASCII code 13 with directly following code 10. In 0.1beta2 in file program/steps/mail/sendmail.inc there is the following part:
// try to autodetect operating system and use the correct line endings // use the configured delimiter for headers if (!empty($CONFIG['mail_header_delimiter'])) $header_delm = $CONFIG['mail_header_delimiter']; else if (strtolower(substr(PHP_OS, 0, 3)=='win')) $header_delm = "\r\n"; else if (strtolower(substr(PHP_OS, 0, 3)=='mac')) $header_delm = "\r\n"; else $header_delm = "\n";
This is needless since $CONFIG['mail_header_delimiter'] can be hardcoded as chr(13).chr(10)
I don't know in which places this occurs at all, so please fix this everywhere else it occurs.
Change History (3)
comment:1 Changed 6 years ago by lespocky
- Priority changed from 8 to 2
comment:2 Changed 6 years ago by lespocky
- Version changed from 0.1-beta2 to svn-trunk
comment:3 Changed 6 years ago by thomasb
- Milestone 0.1-rc1 deleted
- Resolution set to wontfix
- Severity changed from major to minor
- Status changed from new to closed
According to the RFC you're absolutely right. But this does not mean, that all mail systems work like that. We had some problems when mails are being sent by PHP mail() to Gmail accounts, that the recipient could see all headers as page body because of wrong line endings. See #1376871 and #1438476
This is not a bug but a workaround. And why should we change it? You can configure the delimiters the way you want it.

I just checked source code and this is in svn, so I set version to svn-trunk ;-)