View Issue Details

IDProjectCategoryView StatusLast Update
0008706mantisbtemailpublic2009-03-27 23:29
Reportershaddyz Assigned Togiallu  
Status closedResolutionfixed 
Product Version1.1.0 
Fixed in Version1.2.0a1 
Summary0008706: Bad email headers for notifications

My mail server rejected an email sent from mantis because of its headers.

Steps To Reproduce

You must be using Postfix w/ amavis-new installed with the sendmail replacement. Postfix will append its headers of Message-ID and then amavis will get mad:

X-Amavis-Alert: BAD HEADER, Duplicate header field: "Message-ID"

Mantis should only add custom headers that are prefixed with an X- to avoid situations such as this. I have included my changes to email_api.php below to reflect this.

Additional Information
    # build headers
    $t_bug_id = $p_visible_bug_data['email_bug'];
    $t_message_md5 = md5( $t_bug_id . $p_visible_bug_data['email_date_submitted'] );
    $t_mail_headers = array( 'X-Keywords' => $p_visible_bug_data['set_category'] );
    if ( $p_message_id == 'email_notification_title_for_action_bug_submitted' ) {
        $t_mail_headers['X-Message-ID'] = "<{$t_message_md5}>";
    } else {
        $t_mail_headers['X-In-Reply-To'] = "<{$t_message_md5}>";
TagsNo tags attached.




2008-01-05 05:12

reporter   ~0016555

I agree on your diagnosis (I always thought having duplicate Message-IDs was a kludge) but the proposed solution does not work.

We add those two headers to allow for proper threading of messages (and it works like a charm, at least in Thunderbird); adding the X- prefix to those basically breaks it.

I think that what we need instead is phpmailer (the library we use for sending mails) to expose a method for setting the Message-ID, so we can still set it with the same strategy as today.



2008-01-10 12:39

reporter   ~0016624

If you are able to set the message-id that would be a good solution, however, I'm not sure if that is possible from what I've been looking at in postfix. If not, maybe it can be an option in the config so it can be turned off? Thanks for the quick response.



2008-02-08 18:59

reporter   ~0016987

I submitted a patch to phpmailer to have a configurable message-id.

and modified our code to use it

Related Changesets

MantisBT: master 29ec1030

2008-02-08 23:57:40


Details Diff
Fix 8706: Bad email headers for notifications

git-svn-id: <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
mod - core/email_api.php Diff File

Issue History

Date Modified Username Field Change
2008-01-04 16:21 shaddyz New Issue
2008-01-05 05:12 giallu Note Added: 0016555
2008-01-05 12:21 giallu Status new => acknowledged
2008-01-10 12:39 shaddyz Note Added: 0016624
2008-02-08 18:59 giallu Status acknowledged => resolved
2008-02-08 18:59 giallu Fixed in Version => 1.2.0
2008-02-08 18:59 giallu Resolution open => fixed
2008-02-08 18:59 giallu Assigned To => giallu
2008-02-08 18:59 giallu Note Added: 0016987
2008-04-19 04:10 vboctor Status resolved => closed
2008-10-21 11:45 Changeset attached master b8bcb243 =>
2008-11-11 08:34 giallu Changeset attached master 29ec1030 =>
2008-11-11 08:47 giallu Changeset attached master 29ec1030 =>