Issue Details (XML | Word | Printable)

Key: ZF-2624
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Satoru Yoshida
Reporter: Gianluca Sforna
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Message-ID getter/setter

Created: 12/Feb/08 11:31 AM   Updated: 14/Jan/09 09:29 PM   Resolved: 08/Jan/09 08:50 AM
Return to search "Fixed in 1.5.1"
Component/s: Zend_Mail
Affects Version/s: 1.0.3, 1.7.2
Fix Version/s: 1.7.3

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0 minutes
Remaining Estimate - 0 minutes
Time Spent: 3 hours, 30 minutes
Time Spent - 3 hours, 30 minutes

File Attachments: 1. Text File ZF-2624.patch (3 kB)


Fix Version Priority: Nice to Have


 Description  « Hide

I'm evaluating moving Mantis issue tracker code (http://www.mantisbt.org) from phpmailer to Zend::Mail.
When notification mails are sent from a mantis installation, the Message-ID is set in such a way that subsequent mails coming from the same issue are threaded properly by email readers.

Right now, I can not find (neither in 1.5PR) any method for setting and getting the value of the Message-ID header, so this is clearly a blocker, at least in my use case.



Wil Sinclair added a comment - 18/Apr/08 03:48 PM

Please evaluate and categorize/assign as necessary.


Gianluca Sforna added a comment - 19/Apr/08 03:03 AM

Will, I guess your comment is not addressed to me?


Wil Sinclair added a comment - 04/Aug/08 08:17 AM

No. I was addressing Nico, who is the lead for the Zend_Mail component.
Would you like to fix this one yourself?


Gianluca Sforna added a comment - 20/Aug/08 12:43 AM

The attached patch provides the required functions.

I am not sure if the setMessageId() method needs the same "sanitization" as you do in other header setters like setSubject(); that would be trivial to add though


Gianluca Sforna added a comment - 20/Aug/08 01:30 PM

Will, Nico, are there any chances this could be reviewed/pushed to SVN in time for 1.6 gold?


Gianluca Sforna added a comment - 09/Sep/08 07:34 AM

Ok, now that 1.6 is released, are you able to assign a target version to this?


Nico Edtinger added a comment - 12/Sep/08 12:48 PM

Hadn't much time lately, but my current target for most mail issues is 1.7.

One question about this. You say you want the mails to be in the correct thread. Wouldn't it be more correct to add a message-id to the references header? I don't know how you decide to which thread a message belongs, but it seems like you'd sending several messages with the same message-id, which is not correct.


Gianluca Sforna added a comment - 13/Sep/08 07:59 AM

Yes, re-reading the description I realize the wording was not really clear.

Basically, the first mail we send on bug creation has a Message-ID composed from some unique data about the bug (ID, creation timestamp, etc).

When notes are added or other events trigger a mail to be sent, we are able to set a "In-Reply-To" header with the original Message-ID, and threading works as expected.


Gianluca Sforna added a comment - 12/Nov/08 02:27 PM

Anything more I can do here?


Gianluca Sforna added a comment - 13/Dec/08 08:56 AM

ping...


Satoru Yoshida added a comment - 03/Jan/09 07:30 AM

I think following is better.

1) At first , user calls enableMessageId() function that enables creating id before sending message.
for example,

public function enableMessageId($flag)
{
$this->_useMessageId = (boolean) $flag;
}

2)At second, user calls send method without calling creating id method.

send() method has creating message id logic,

if ($this->_useMessageId === true) { //Here is logic that creates message id. }

3) Thus, each time own id will be created without forgetting change value.


Nico Edtinger added a comment - 03/Jan/09 06:23 PM

We can support both. Make it public function setMessageId($id = true)
If $id is null or false no message-id header is added, if it's true a new id is generated, else the given one is taken.
I didn't had the time to really look into the format for message-ids, but we already have to generate unique ids for writing to maildir. If we could reuse the functionality (making it a static method in Zend_Mail), that would be great.


Gianluca Sforna added a comment - 05/Jan/09 09:41 AM

Nico, I guess you did not notice my patch?


Satoru Yoshida added a comment - 05/Jan/09 11:29 PM

Hi, Gianluca Sforna .
I will try to update this issue in next holiday


Gianluca Sforna added a comment - 06/Jan/09 12:58 AM

Hi Satoru (I guess that's your first name... mine is Gianluca); nice to see some activity here!

I just hope the next holiday where you live is not next Christmas

Feel free to let me know if/how my patch should be revised and I can provide you an updated one.


Satoru Yoshida added a comment - 08/Jan/09 08:50 AM

Solved in SVN r13555

I added 4 methods.

setMessageId, getMessageId, clearMessageId, createMessageId.

Hi, Gianluca
Thank you for your kindness, but never mind.
I am not in the Orthodox church, a Buddhist

I will be happy if you try new functions!


Satoru Yoshida added a comment - 14/Jan/09 09:29 PM

Additional Fix in SVN r13643.

Message-Id should be error on addHeader() function.