Mailing list integration question [message #158742] |
Tue, 17 March 2009 12:51 |
Jim O
Messages: 4 Registered: March 2009
Karma: 0
|
Junior Member |
|
|
I am in the process of setting up a new forum part of which I want to integrate with a mailing list.
My question regards the headers sent out by FUDforum. Specifically will they include the "In-Reply-To:" and/or "References:" headers so that they are properly sorted by mailing list archives and MUA's?
Jim
|
|
|
|
Re: Mailing list integration question [message #158777 is a reply to message #158743] |
Fri, 20 March 2009 01:01 |
Jim O
Messages: 4 Registered: March 2009
Karma: 0
|
Junior Member |
|
|
Thanks Frank.
In doing some testing I found that all messages in a thread seem to default to "in reply to" the original entry, no the most recent one. That could affect threading on list archives and in MUA's.
Also, how hard would it be to add an extra field for references headers and include them? This is a request of list members.
Jim
|
|
|
|
|
|
Re: Mailing list integration question [message #168815 is a reply to message #168785] |
Sat, 27 July 2013 00:40 |
|
cpreston
Messages: 160 Registered: July 2012 Location: Oceanside
Karma: 6
|
Senior Member |
|
|
Frank,
I know you have a real job. So unless I hear a "yo!" real soon, I'm going to get my developers started on this. Here's what I've come up with for a plan. It would be great if you could take a look and see what you think.
I plan to edit the core FUDforum code so that it includes "In-Reply-To" and "References" headers when it sends a reply to an email.
As I understand it, to do this, I need to do the following:
1. Get the Message-ID of each message
- Grab the Message-ID from any incoming emails
- Create and/or get the Message-ID for any outgoing emails
2. Store the Message-ID of each post, associated with the post.
3. Insert "In-Reply-To" and "References" headers into any outgoing emails:
(In the following, "Previous-Message-ID" is the Message-ID of message currently being replied TO, AKA the Message-ID of the previous post in the thread -- not the message-ID of the outbound message.)
<code>In-Reply-To: <Previous-Message-ID>
References: <First-message-ID-of-current-thread> <next-message-ID-in-thread> <next-message-ID-in-thread> <etc> <Previous-message-ID></code>
(If there is only one previous message in thread, there is only one message-ID in the References line. If there are more than ten previous message IDs, you are supposed to drop the second one until you have ten or fewer. Always start with the first-message-ID and end with the Previous-Message-ID.)
I will submit diffs from the core code. It seems like adding a field to the posts table would be the most likely place to store the Message-ID for each post, but that does mean adding a field to a core table. What do you think about that, Frank?
Just in case I read it wrong, the details of how to do In-reply-to and References headers is based on the info in this web page:
http://cr.yp.to/immhf/thread.html
|
|
|
|
Re: Mailing list integration question [message #168828 is a reply to message #168823] |
Sun, 28 July 2013 03:38 |
|
cpreston
Messages: 160 Registered: July 2012 Location: Oceanside
Karma: 6
|
Senior Member |
|
|
You're using PHPMailer, right? It is generating the Message-ID, but it's making a random one because you're not specifying it as an environment variable MessageID. That is according to this:
http://www.tig12.net/downloads/apidocs/wp/wp-includes/PHPMailer.class.html# det_fields_MessageID
What message-ID are you grabbing if you're getting it from the one the list returns? Are you grabbing the message ID of the incoming email or the Message-ID of the email you sent that it is replying to, which would be the one you should specify in the "In-Reply-To" field. Whichever one you're grabbing, we end up with not enough info for a complete "References" tag. If you're grabbing the Message-ID of incoming message that is a reply to a forum post, you have the latest message-ID but not the first one, which is what you're supposed to put in the References tag. If you're getting the previous one, then you don't have the current one....
It seems more proper to generate the Message-ID for any outgoing messages, and then pass them on to PHPMailer (pretty easy to generate one http://www.jwz.org/doc/mid.html), then store it with the message in the mlist_msg_id column. Then you do what you're already doing and grab any Message-IDs of any incoming messages and store them in the same column. Then we've got Message-IDs for every message.
You're already doing the right thing with mail_list_post with the "In-Reply-To:" tag. Since we would have Message-IDs for all messages, then it's just a matter of a database query to get the first, last, and other Message-IDs so we can generate the References header.
What do you think?
|
|
|
|
Re: Mailing list integration question [message #168839 is a reply to message #168830] |
Sun, 28 July 2013 16:20 |
|
naudefj
Messages: 3771 Registered: December 2004
Karma: 28
|
Senior Member Administrator Core Developer |
|
|
cpreston wrote on Sun, 28 July 2013 08:38Lines 45-49 of mlist_post.inc seems to be creating our own Message ID, updating mlist_msg_id w/the value, and making it part of the email before it is sent. So isn't the code already doing what I'm suggesting regarding Message IDs?
Yes, you're right! Just remember that the mailing list may assign a different Message ID, and we will grab and store the list's ID as soon as we spot the message on the list.
cpreston wrote on Sun, 28 July 2013 08:38This one could be my misunderstanding of PHP, but doesn't line 12 of moist_post.inc set the reply_to to null no matter what is passed to the function? Lines 40-42 would then not do anything because reply-to will always be null?
It sets the default value to NULL. So, if no value is supplied, we will start with nothing.
cpreston wrote on Sun, 28 July 2013 08:38...it appears that the send_email function (with the class fur_smtp) in remail.php sends the actual email, so you're not using PHPMailer. is that correct?
Correct, we're most definitely not using PHPMailer. Should we?
|
|
|
Re: Mailing list integration question [message #168841 is a reply to message #168839] |
Sun, 28 July 2013 16:57 |
|
cpreston
Messages: 160 Registered: July 2012 Location: Oceanside
Karma: 6
|
Senior Member |
|
|
Quote:Yes, you're right! Just remember that the mailing list may assign a different Message ID, and we will grab and store the list's ID as soon as we spot the message on the list.
That's not how Message-ID is SUPPOSED to work. Each message should have a message-id and should not be changed. Some mailing lists (like Mailman) will give an email a message-id if it doesn't have one, because it should have one for proper threading. I've verified that mailman and listserv will only generate a message-id if the incoming message doesn't have one, or if IT is the one sending the message (e.g. a reminder or something).
Quote:we're most definitely not using PHPMailer. Should we?
Everybody else sending email in PHP sure does. Not sure how big of a deal it is to change that, though, or what benefit you would get by changing it.
[Updated on: Sun, 28 July 2013 19:37] Report message to a moderator
|
|
|
|
|
|