I just attempted to upgrade Support Ticketing to 6.x-1.4 and also tried 6.x-1.x-dev (May 18, 2011) from 6.x-1.3. Both of these upgrades causes a failure in the sending of Support Ticketing emails from my website. Reverting back to 6.x-1.3 allows for the outbound emails to work as normal.

The website is being hosted on OpenSuse 11.3 with PostFix 2.7.1 and Amavisd-New 2.6.4. The log files show that the outbound Support Ticketing emails are being blocked due to the following error.
X-Amavis-Alert: BAD HEADER SECTION Duplicate header field: "Message-ID"

Checking the outbound file, it does show that with Support Ticketing 6.x-1.4 there are two fields listed in the HEADER with almost the same name. The second line is being generated by Support Ticketing, I found the second line description on line 932 of the SUPPORT.MODULE with the lowercase "d"
Message-ID: <9680caa8e4d205b1630927c08a437015@xxx.xxx.xxx.34>
Message-Id: <2226.2047@xxx.xxx.xxx.34>

Changing the Message-Id to Message-ID does get rid of the Duplicate Header field error, but AMAVISD still reports that the headers being generated by SUPPORT TICKETING 6.x-1.4 are still bad and are being quarantined. The format that is shown in the first Message-ID above is the correct format when there is no errors.

I am continuing to look for any possible solutions with changes to AMAVISD config, but with 6.x-1.3, there are no Bad Header errors being generated.

What other information can I supply to assist?

Comments

leevester’s picture

Priority: Normal » Major

Going through the code, I realized that on every function that you had specified, you had used "message_id", with the exception of code on line 932.

Original code in 6.x.1.4
// Set up message id and threading.
$message['headers']['Message-Id'] = _support_generate_message_id($params['nid'], $params['cid']);
if (!empty($references)) {
$message['headers']['In-Reply-To'] = $references[0];
$message['headers']['References'] = implode(' ', array_reverse($references));

I changed the 'Message-Id' to 'Message_Id' and now the emails are no longer be quarantined by the Spam filter for the Double Header error and are being delivered.

My question is the 'Message-Id' a mis-type in the code or is it necessary for another section of your module that I am probably not using.

leevester’s picture

After more testing and attempts to get this working, here is what I have found out. When I do change the Message-Id to Message_Id in the code, I am able to get the message through. But it is causing a lot of chatter in the message header that is not what I would consider a normal header. It adds the following section, about thirty five lines of this.

X-esp: ESP<6>=
SHA:<0>
SHA_FLAGS:<0>
UHA:<10>
ISC:<0>
BAYES:<-1>
SenderID:<0>
DKIM:<0>
TS:<-3>
SIG: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAUGgoqXbLonBTEg5BCZHMLXFsJM1Gm5mMh0UskfnCx
SA6DuH5pMAfpsANRtBmiHtulrAbanMiVAcowS8voBFmxCCxXA>
DSC:<0>
TRU_lotto_spam: <0>

Where the 6.x-1.4 conflicts, is with the new Support Ticketing's method of inserting the Message-Id to track and link messages and comments and the default Message-ID that Postfix generates for each new message. The spam filter Amavisd-New sees both Support Ticketing's "Message-Id" (lowercase "d") and the Server generated "Message-ID" (uppercase "D") as the same thing and flags the entire message with a Bad-Header and sends it to quarantine. While I do have the option to disable the Header Check in Amavisd-New in the outbound messages, I have a concern that other email servers will quarantine my site's incoming email and prevent it from reaching it's destination because of the duplicate Message-Ids. Also because this server is being used to generate email from multiple Drupal modules, I cannot simply disable the existing Message-ID generation.

Since I am not using the Inbound Mail Integration feature of Support, I have disabled the "Thread emails using mail headers" option under Administer > Support Ticketing System > Settings > Mail. But even with this disabled, when using the 6.x-1.4 or the 6.x-1.x-dev 2011-jun-28, all outbound emails include the message_id, in_reply_to and references mail headers that are generated by Support Ticketing 6.x-1.4. Since these Headers are not used or available in Support Ticketing 6.x.1.3 messaging, I would think that by disabling the "Thread emails using mail headers" option, that these would be disabled as well, but such is not the case.

I have looked around the Support.module, but I do not see a direct way to comment out or disable these three new fields that are now being generated in the Mail Header without breaking the module. I would like to to deploy 6.x-1.4 as it has a number of new features that would greatly improve our workflow on the site.

If someone can give me a hint of where or how to prevent the generation of Support Ticketing's message_id, in_reply_to and references mail headers, it would be a very big help.

jeremy’s picture

Status: Active » Fixed

Fix committed -- we only set Message-ID if not already set:
http://drupalcode.org/project/support.git/commit/6c6fdec

leevester’s picture

Version: 6.x-1.4 » 6.x-1.5-rc1

I have tried both the 6.x-1.5-rc1 and the 6.x-1.x-dev and I am still experiencing the same problem where STS is injecting a second Message-ID section into the email header. See header below from Quarantined message:

************ Start of Header ************************
Return-Path: <>
Delivered-To: bad-header-quarantine
X-Envelope-From:
X-Envelope-To:
X-Envelope-To-Blocked:
X-Quarantine-ID: <1enekCzB62Xk>
X-Amavis-Alert: BAD HEADER SECTION Duplicate header field: "Message-ID"
Received: from test.test.com ([127.0.0.1])
by localhost (linux-jfp8.site [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 1enekCzB62Xk for ;
Thu, 11 Aug 2011 13:18:47 -0400 (EDT)
Received: from 172.16.129.34 (localhost [127.0.0.1])
by test.test.com (Postfix) with ESMTP id 44D6A123B56
for ; Thu, 11 Aug 2011 13:18:47 -0400 (EDT)
Date: Thu, 11 Aug 2011 13:18:47 -0400
To: support@test.test.com
From: Support
Reply-to: support@test.test.com
Subject: [tkt:2048] new ticket
Message-ID: <0a5715d6f60c970b8a24feacfbd37276@172.16.129.34>
X-Priority: 3
X-Mailer: PHPMailer (phpmailer.codeworxtech.com) [version 2.3]
Errors-To: support@test.test.com
Sender: support@test.test.com
Message-ID: <2257.2048@172.16.129.34>
In-Reply-To: <0.2048@172.16.129.34>
References: <0.2048@172.16.129.34>
MIME-Version: 1.0
Content-Transfer-Encoding: 8Bit
Content-Type: text/plain; charset="utf-8"

************ End of Header ************************

The first Message-ID: is being generated by the system and the second Message-ID: is being generated by STS.

I found an easy work around that permits the sending of all messages.
Changing the Message-ID on lines 963 and 964 to Support-ID, allows Email messages to be sent normally with only the system generated Message-ID and a new field of Support-ID. Since my system is not using the Email generation and update features of STS, this will allow us to deploy this upgrade.

Not everyone runs their SPAM filters as tight as we are required by our HQ IT. This is the reason that it is flagging the Double Headers and sending them to quarantine. During the research on this, I have found several older systems that permitted two Message-ID fields, but now RFC2822 says no.

I do appreciate your time and effort in developing this module as does the managers and support groups that use it on a daily basis.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

izmeez’s picture

Subscribing, wondering if there is any followup to comment #4 ?

bdragon’s picture

Version: 6.x-1.5-rc1 » 7.x-1.x-dev
Status: Closed (fixed) » Fixed

Merged to 7.x-1.x.
http://drupalcode.org/project/support.git/commit/79e71cb7a82b2b7e146bbd7...
(Note: change was already included?)

@#4, #6: Please reopen the ticket if the problem has not been resolved with the latest dev snapshots.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

leevester’s picture

Version: 7.x-1.x-dev » 6.x-1.8
Status: Closed (fixed) » Needs work

Just upgraded to ver 6.x-1.8 and I am still experiencing the same problem where our spam filter is quarantining all messages with double Message-ID headers.

Changing the "Message-ID" in the two lines here to "Support-ID" only changes the email header text and allows the emails to pass through the Spam filter with no problems.

Original
// Set up message id and threading.
if (!isset($message['headers']['Message-ID'])) {
$message['headers']['Message-ID'] = _support_generate_message_id($params['nid'], $params['cid']);
}

Altered
// Set up message id and threading.
if (!isset($message['headers']['Support-ID'])) {
$message['headers']['Support-ID'] = _support_generate_message_id($params['nid'], $params['cid']);
}

No other changes were made to the code.

Just reminding you that I am running Postfix 2.7.1 on a Linux server. Postfix generates its own Message-ID header.

jeremy’s picture

Category: bug » support
Priority: Major » Normal
Status: Needs work » Postponed (maintainer needs more info)

Why is Postfix adding the Message-ID header if it's already defined in the email? This sounds like an MTA misconfiguration to me... have you reviewed your Postfix configuration?

The support module explicitly sets the Message-ID both so it can do proper threading and ticket matching when receiving replies from outside mail clients, and so other mail clients can thread support module generated emails. For this reason, we're unable to arbitrarily set a new mail header such as Support-ID.

leevester’s picture

Thanks for the feedback, I will double check the MTA Configuration very, very carefully to see if there is a misconfig.

Mojah’s picture

We had the same prob on a client's D5 site. It turned out to be the SMTP module, which was also creating a Message-ID value. Maybe you would like to look in that direction. In our case, the issue popped up after a site migration. I think the module weights changed between the two modules that created the Message-ID and that's why we never had the issue previously.

purencool’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)