Feng Forum

Support => Older versions => : sokki January 13, 2010, 04:17:20 PM

: [1.6.1] E-Mail: Wrong Message-ID in Header
: sokki January 13, 2010, 04:17:20 PM
Hi,

my fengoffice generates emails with a message-id in header like:
Message-ID: <og_1263400207_375307@xxx.de> <webmaster@xxx.de>

This breaks two rules of SpamAssasin :
1.6 MSGID_SPAM_LETTERS     Spam tool Message-Id: (letters variant)
 2.6 INVALID_MSGID          Message-Id is not valid, according to RFC 2822

Thanks a lot for this great tool!

: Re: [1.6.1] E-Mail: Wrong Message-ID in Header
: ignacio January 19, 2010, 04:13:24 PM
Strange, Feng Office shouldn't be adding the <webmaster@xxx.de> part.
: Re: [1.6.1] E-Mail: Wrong Message-ID in Header
: ignacio January 19, 2010, 04:28:54 PM
Ok, found what could be causing that. Try changing file 'library/swift/lib/Swift.php' line 1624 to:

:
public function buildMail($to, $from, $subject, $body, $type='text/plain', $encoding='8bit', $return_data_part=true, &$complete_mail)
{
if ($this->message_id) {
$msg_id = $this->message_id;
} else {
$id_right = substr($from, strpos($from, '@'));
if (strpos($id_right, ">") !== false) {
$id_right = substr($id_right, 0, strpos($id_right, ">"));
}
$id_right = preg_replace('/[^a-zA-Z0-9\.\!\#\/\$\%\&\'\*\+\-\=\?\^\_\`\{\|\}\~]/', '', $id_right);
$msg_id = "<" . gen_id() . "@" . $id_right . ">";
}

$date = date('r'); //RFC 2822 date
: Re: [1.6.1] E-Mail: Wrong Message-ID in Header
: sokki January 22, 2010, 01:40:03 PM
Hi ignacio,

thanks for the fix!

the messageid looks better now:
Message-ID:     <og_1264174702_167123>
this fix the MSGID_SPAM_LETTERS rule.

But Spamassasing sill throw:
2.6 INVALID_MSGID          Message-Id is not valid, according to RFC 2822

edit:
I've commented out the preg_replace() line cause it removes the @xxx.de part. SpamAssasin is happy now :-) with a messageid like:
<og_1264175573_712876@xxx.de>
: Re: [1.6.1] E-Mail: Wrong Message-ID in Header
: ignacio January 22, 2010, 02:26:42 PM
Yes, made two corrections to the code I posted. Added a missing ']' to the preg_replace and added an '@' to the following line.