Skip to content

Commit

Permalink
An array of Received: headers can now be provided.
Browse files Browse the repository at this point in the history
Bug: 4636


git-svn-id: http://svn.php.net/repository/pear/packages/Mail/trunk@189296 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
jparise committed Jun 26, 2005
1 parent 0165a97 commit 25e43a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Mail.php
Expand Up @@ -145,10 +145,20 @@ function prepareHeaders($headers)

$lines[] = $key . ': ' . $value;
} elseif (strcasecmp($key, 'Received') === 0) {
$received = array();
// If we've been given an array of Received: lines, join them.
if (is_array($value)) {
foreach ($value as $line) {
$received[] = $key . ': ' . $line;
}
}
else {
$received[] = $key . ': ' . $value;
}
// Put Received: headers at the top. Spam detectors often
// flag messages with Received: headers after the Subject:
// as spam.
array_unshift($lines, $key . ': ' . $value);
$lines = array_merge($received, $lines);
} else {
// If $value is an array (i.e., a list of addresses), convert
// it to a comma-delimited string of its elements (addresses).
Expand Down
1 change: 1 addition & 0 deletions package.xml
Expand Up @@ -37,6 +37,7 @@
<notes>
- Unfold long lines before parsing addresses in Mail_RFC822.
- The SMTP driver now supports a 'timeout' value. (Request #3776)
- An array of Received: headers can now be provided. (Bug #4636)
</notes>
<state>stable</state>

Expand Down

0 comments on commit 25e43a8

Please sign in to comment.