Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Reading Custom Headers Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
billymac
Newbie
Newbie
Avatar

Joined: 29 September 2014
Location: Canada
Online Status: Offline
Posts: 5
Posted: 29 September 2014 at 6:32am | IP Logged Quote billymac

I am writing an email based forum type application and need help with determining what the original thread a reply is for.
A previous version of this app I have been using for 4 years simply stripped Re: etc from the incoming email subject and looked up the original thread message based on the subject.
That worked OK but is definately not bulletproof
For example, the user could change the subject or another thread could be created with the same subject.
Also, various mail clients indicate replies in different ways other than putting RE: at the beginning of the subject.
Any suggestions on a bullet proof solution to this not requiring use of subject and something that will work with any mail client?

I was thinking of writing a costom header when sending out the original new thread email that uses the record ID for the original thread and then when replies come in check for that value to figure out if its a reply and then query the db to get the original thread.

I've coded the part to add the custom header but not sure how to check for it when polling for new pop3 messages and if the custom header will be in the reply for all mail clients

Or is there a better way?
Note: my mailbee licenses version is a few years old (maybe 5 or so)

Thanks
Back to Top View billymac's Profile Search for other posts by billymac
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 29 September 2014 at 6:43am | IP Logged Quote Igor

Well, in our WebMail Pro PHP application, we obtain thread-related information from IMAP server, assuming that server supports threading. That way, things are not client-specific there. However, there's no such support in MailBee.NET Objects yet, so handling message headers is pretty much the only option. One of the ways is to use MailMessage.References which holds a list of Message IDs. Just bear in mind that it's not going to be an easy way, as you'll have to maintain a database of all the messages found within the account and update it when the account itself is updated.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
billymac
Newbie
Newbie
Avatar

Joined: 29 September 2014
Location: Canada
Online Status: Offline
Posts: 5
Posted: 29 September 2014 at 6:54am | IP Logged Quote billymac

I am already storing all threads (loriginal message) and replies in my db so that is not a problem but...
According the docs on MailMessage.References :
The value of this property is taken from References header.
This header usually contains a space-separated list of Message-ID values of all messages in a thread. However, building message threads using this header is not reliable since many e-mail clients do not support this mechanism.


Is there any more reliable way to handle threading that works in any mail client.
I assume that if I add a custom header that gmail (for example) might mess with it???

Maybe I just need to add hidden HTML in the email (html comment or white text maybe) with the thread ID as long as mail clients don't frig with that as well
Back to Top View billymac's Profile Search for other posts by billymac
 
billymac
Newbie
Newbie
Avatar

Joined: 29 September 2014
Location: Canada
Online Status: Offline
Posts: 5
Posted: 29 September 2014 at 7:01am | IP Logged Quote billymac


Since all replies would be to a specific original thread and all replies will be back to my mail server:

Would this perhaps work:
Set the Thread ID in the reply-to

mailer.Message.ReplyTo.Add("MySystem@MyServer.com", ThreadID)
Back to Top View billymac's Profile Search for other posts by billymac
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 29 September 2014 at 7:02am | IP Logged Quote Igor

Adding a custom header only works for the message you compose. It in no way ensures that information from that custom header will be available in a response, and without that there's no point of adding that custom information.

I actually mentioned our webmail app because it features the most reliable way of getting threading information. But it has another problem - not all email servers support that.

Sad as it is, there's no 100% universal approach here. Too many clients and too many mailservers, will different behavior across them.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
billymac
Newbie
Newbie
Avatar

Joined: 29 September 2014
Location: Canada
Online Status: Offline
Posts: 5
Posted: 29 September 2014 at 7:13am | IP Logged Quote billymac

Well at least I would prefer the dependencies to be on the server side and not the mail clients as that way we have more control.
I will be using a mail server on an Arvixe.com Windows dedicated VPS host server.
To find out if threading is supported I assume I could ask Arvixe but they might not know the answer, or just code it and see what happens?
Hopefully that is not a new feature and is included in my old mailbee version.
I will probably upgrade mailbee but only after the app is making money.
Back to Top View billymac's Profile Search for other posts by billymac
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 29 September 2014 at 7:17am | IP Logged Quote Igor

Information on checking threading support on IMAP server can be found at relevant WebMail Pro documentation page.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide