MantisBT

View Issue Details Jump to Notes ] Wiki ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010040mantisbtemailpublic2009-01-09 20:162011-12-17 02:47
Reporterjpeeler 
Assigned Torombert 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSLinuxOS VersionUbuntu 8.04.1
Product Version1.1.6 
Target VersionFixed in Version 
Summary0010040: Email notification from new bug report submission Message-ID headers not RFC 822 compliant
DescriptionIn particular, the @hostname part is missing:

Message-ID: <fb300c6bcd2798e89e6668479ee8595c>
Additional InformationTwo places of interest:

- email_bug_info_to_one_user (the build headers)
- or where paulr suggested in email_send: http://mantis.pastebin.com/m36a690c [^]

diff --git a/core/email_api.php b/core/email_api.php
index 148254b..6fdf756 100644
--- a/core/email_api.php
+++ b/core/email_api.php
@@ -833,6 +833,12 @@ function email_send( $p_email_data ) {
                foreach( $t_email_data->metadata['headers'] as $t_key => $t_value ) {
                        switch( $t_key ) {
                                case 'Message-ID':
+ /* Note: hostname can never be blank here as we set metadata[host] just in only location mail gets queued for sending
+ * however as spamassasin treats a blank host part as potential spam, only include the hostname if set */
+ if ( !strchr( $t_value, '@' ) && !is_blank( $mail->Hostname ) ) {
+ $t_value = $t_value . '@' . $mail->Hostname
+ }
+
                                        $mail->set( 'MessageID', $t_value );
                                        break;
                                case 'In-Reply-To':

Which seemed to yield: MessageID: <3718723d794b4b75f14cc91587352886>@localhost

But the fix probably works with 1.2.
Tagsemail, threading
Attached Files

- Relationships
has duplicate 0011123closedvboctor Duplicate Message ID Header 

-  Notes
User avatar (0020576)
giallu (developer)
2009-01-10 13:01

Lately, I was actually wondering why emails from this tracker was all threaded except from the initial one. It turns out not only we are missing the domain part (a mistake from my original implementation) but right now we are not even enclosing the header in brackets.
For instance, here is the header from the mail I received from this issue:

Subject: [mantisbt 0010040]: Email notification from new bug report submission Message-ID headers not RFC 822 compliant
Message-ID: ec74c04a9d43505dd7a7896163fae7c8
X-Priority: 3
X-Mailer: PHPMailer (phpmailer.codeworxtech.com) [version 2.3]
keywords: [mantisbt] email
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="utf-8"

It would be nice to find out when this happened; if only I could manage to improve my git-fu...
User avatar (0020577)
giallu (developer)
2009-01-10 18:49

Some updates on this. The situation in the 1.1 branch is that we are still running an older phpmailer which is setting a Message-ID regardless if we push a custom one along with the other headers, so outgoing messages have a double Message-ID header.

I originally patched phpmailer as part of 0008706, but the patch I proposed to them was never included, so when they eventually added some very similar code, we picked it up and did not notice the new code is honouring the new message-ID, but not adding anything like brackets and/or hostname.

I'm preparing a patch based on paulr code above for the 1.2 branch. What to do with 1.1 is unclear because we usually do not make big changes in the released version.
User avatar (0020675)
jpeeler (reporter)
2009-01-21 15:13

I missed previously that there was already an open report for this. This issue is related to issue 0009753.
User avatar (0021412)
giallu (developer)
2009-04-07 03:44

Reminder sent to: jreese, vboctor

If we want to fix this on the 1.1 branch, we need to upgrade phpmailer. Are you okay with the change?
User avatar (0021418)
jreese (administrator)
2009-04-07 11:37

Well, in principle, I would agree that since it's fixing a bug, it should be fine. However, how much more will we need to backport from 1.2.x in order to move to the newer version of PHPMailer? If it's only a small bit of effort, then I say go for it; otherwise, I don't think it's a high-enough priority fix for a maintenance release.
User avatar (0021429)
giallu (developer)
2009-04-08 05:09

My guess is "not too much", but my memory may fail...
User avatar (0021438)
dhx (developer)
2009-04-08 10:49

Please note that RFC822 is obsoleted by RFC2822. It would be best to make sure this ticket still applies to the RFC2822 spec before making changes.
User avatar (0021525)
giallu (developer)
2009-04-14 11:14

dhx: you're right, but AFAICT we still need to fix this stuff according to RFC2822
User avatar (0021630)
jpeeler (reporter)
2009-04-22 18:14

Has a decision been made about this bug? I just heard a report of email notifications being filtered through a Bastion host getting rejected because of the invalid Message-ID.
User avatar (0023615)
vboctor (administrator)
2009-11-07 15:38

Losing notifications generates a lot of support requests, so it would be good if we can fix this in 1.1.8 branch.
User avatar (0030475)
rombert (developer)
2011-12-06 12:28

This work fine in 1.2 , should we close the bug?
User avatar (0030478)
jpeeler (reporter)
2011-12-06 13:14

Since 1.1 isn't maintained and it really is fixed in 1.2, then there's no reason to keep this open.
User avatar (0030479)
rombert (developer)
2011-12-06 14:54

Great, thanks.

- Related Changesets
MantisBT: master 69fd1739
Timestamp: 2009-01-10 23:23:40
Author: giallu
Details ] Diff ]
Fix 10040: Email notification from new bug report submission Message-ID headers not RFC 822 compliant
mod - core/email_api.php Diff ] File ]
MantisBT: master d5b6cf26
Timestamp: 2009-01-10 23:23:40
Author: giallu
Details ] Diff ]
Fix 10040: Email notification from new bug report submission Message-ID headers not RFC 822 compliant
mod - core/email_api.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2009-01-09 20:16 jpeeler New Issue
2009-01-10 13:01 giallu Note Added: 0020576
2009-01-10 18:49 giallu Note Added: 0020577
2009-01-10 19:10 giallu Changeset attached master 69fd1739 =>
2009-01-15 11:03 giallu Changeset attached master d5b6cf26 =>
2009-01-21 15:13 jpeeler Note Added: 0020675
2009-04-07 03:44 giallu Note Added: 0021412
2009-04-07 11:37 jreese Note Added: 0021418
2009-04-08 05:09 giallu Note Added: 0021429
2009-04-08 10:49 dhx Note Added: 0021438
2009-04-14 11:14 giallu Note Added: 0021525
2009-04-22 18:14 jpeeler Note Added: 0021630
2009-11-04 21:53 vboctor Relationship added related to 0011123
2009-11-07 15:34 vboctor Relationship replaced has duplicate 0011123
2009-11-07 15:38 vboctor Note Added: 0023615
2009-11-07 15:38 vboctor Status new => acknowledged
2010-05-14 08:00 klkl Tag Attached: email
2010-05-14 08:00 klkl Tag Attached: threading
2011-12-06 12:28 rombert Note Added: 0030475
2011-12-06 12:28 rombert Status acknowledged => feedback
2011-12-06 13:14 jpeeler Note Added: 0030478
2011-12-06 13:14 jpeeler Status feedback => new
2011-12-06 14:54 rombert Note Added: 0030479
2011-12-06 14:54 rombert Status new => resolved
2011-12-06 14:54 rombert Resolution open => no change required
2011-12-06 14:54 rombert Assigned To => rombert
2011-12-17 02:47 atrol Status resolved => closed


MantisBT 1.2.17 [^]
Copyright © 2000 - 2014 MantisBT Team
Time: 0.1072 seconds.
memory usage: 3,122 KB
Powered by Mantis Bugtracker