Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Change TO part of email message to distribution list
PostPosted: 2010-08-31 18:24 
New user
New user

Joined: 2010-08-31 18:12
Posts: 22
Emails delivered to distribution list recipients show on TO: part of the message the address of the distribution list, e.g.
distribution list email address list@example.com.

Is there a way via scripting on event onDeliveryStart or onDeliverMessage to replace this TO part of the email header with the actual recipient's email?

For example

Original Message
From: info@example.com
To: list@example.com

Replaced Message
From: info@example.com
To: arecipient@domain.com

Thank you.


Top
 Profile  
 
 Post subject: Re: Change TO part of email message to distribution list
PostPosted: 2010-09-01 15:54 
Developer

Joined: 2010-04-24 23:16
Posts: 4925
Location: Michigan, USA
Seems you should be able to grab the path to the EML file & replace the TO header address in the file itself in OnAcceptMessage. Looked around at some user scripts to get examples of how to do it?
Bill

_________________
hMailServer build I'm using LIVE on my servers: 5.4-B2013040501
Latest test builds at: http://www.hmailserver.com/forum/viewtopic.php?f=10&t=21420


Top
 Profile  
 
 Post subject: Re: Change TO part of email message to distribution list
PostPosted: 2010-09-01 17:11 
New user
New user

Joined: 2010-08-31 18:12
Posts: 22
Bill48105 wrote:
Seems you should be able to grab the path to the EML file & replace the TO header address in the file itself in OnAcceptMessage. Looked around at some user scripts to get examples of how to do it?
Bill


Bill, Thanks for the reply!!!

So the event should be OnAcceptMessage? Ok with this.

What I am wondering though is that if I change the TO part of the message with a recipient email then this email will be delivered to just one address because this will stop the internal operation of the hMailServer sending to a distribution list!!!!!

Unless I open up the distribution list and query the recipients (even via a MySQL query if not via DOM) and create x number of email files in order to be sent to each member of the distribution list!!!! As you can see this again disengages the internal mechanism of handling and sending to a distribution list and creates a numerous of email files to be send to!!!! BAD practise I believe!!!!

So there must be another way to replace the TO part of the email with the actual email of the members' list without breaking the internals of the distribution list mechanism!!!!!!

Any insights on this?????


Top
 Profile  
 
 Post subject: Re: Change TO part of email message to distribution list
PostPosted: 2010-09-01 17:23 
Developer

Joined: 2010-04-24 23:16
Posts: 4925
Location: Michigan, USA
Yeah hmail may use only 1 EML file & multiple recipients rather than one EML for each, not sure.
Perhaps this would be useful for reference or to use in place of the built in dist lists:
viewtopic.php?f=20&t=15301
Bill

_________________
hMailServer build I'm using LIVE on my servers: 5.4-B2013040501
Latest test builds at: http://www.hmailserver.com/forum/viewtopic.php?f=10&t=21420


Top
 Profile  
 
 Post subject: Re: Change TO part of email message to distribution list
PostPosted: 2010-09-01 18:46 
New user
New user

Joined: 2010-08-31 18:12
Posts: 22
Bill48105 wrote:
Yeah hmail may use only 1 EML file & multiple recipients rather than one EML for each, not sure.
Perhaps this would be useful for reference or to use in place of the built in dist lists:
viewtopic.php?f=20&t=15301
Bill


True about the 1 email.
About this thread, I have seen it and looking at it right now to see if it will help me out. Thanks for this.
I have also send a feature request to include this functionality if possible, http://www.hmailserver.com/forum/viewtopic.php?f=2&t=19023


Top
 Profile  
 
 Post subject: Re: Change TO part of email message to distribution list
PostPosted: 2010-09-02 03:19 
Moderator
User avatar

Joined: 2007-06-14 05:12
Posts: 9562
Location: 'The Outback' Australia
Been watching this thread.

If you just change the To header without changing the SMTP Envelope Recipient address, you will still need to do that for each recipient, and create a separate email for each recipient...

This is certainly possible with scripting, but to what end? What exactly are you trying to achieve?

_________________
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
Documentation


Top
 Profile  
 
 Post subject: Re: Change TO part of email message to distribution list
PostPosted: 2010-09-02 09:56 
New user
New user

Joined: 2010-08-31 18:12
Posts: 22
mattg wrote:
Been watching this thread.

If you just change the To header without changing the SMTP Envelope Recipient address, you will still need to do that for each recipient, and create a separate email for each recipient...

This is certainly possible with scripting, but to what end? What exactly are you trying to achieve?


When I send an email to a distribution list, e.g. list@example.com every member of the distribution list receives the email showing that it was sent TO list@example.com.

I would like to know if it is possible instead of the default list@example.com to have the actual email of the recipient as it was sent to him personally and not via a list, but without creating a separate email for each (I don't want to break the internal operation of the DL mechs).

If I change the SMTP Envelope(Recipient Address) this will be a global change, just once, like masking the original address list@example.com with something else like customers@example.com which is not the desired solution.


Top
 Profile  
 
 Post subject: Re: Change TO part of email message to distribution list
PostPosted: 2010-09-02 10:57 
Moderator
User avatar

Joined: 2007-06-14 05:12
Posts: 9562
Location: 'The Outback' Australia
davidoster wrote:
I would like to know if it is possible instead of the default list@example.com to have the actual email of the recipient as it was sent to him personally and not via a list, but without creating a separate email for each (I don't want to break the internal operation of the DL mechs).

So how in your mind do you see this working without creating a separate message at some stage for each recipient?

If you want to do this as the message is being delivered, are you expecting that your list only has local recipients?

What is the end result that you want? Why do you want recipients to be the only recipient listed?

Have you tried BCC to the recipient list? or removing the SMTP recipient header completely, like a BCC...

_________________
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
Documentation


Top
 Profile  
 
 Post subject: Re: Change TO part of email message to distribution list
PostPosted: 2010-09-02 11:17 
New user
New user

Joined: 2010-08-31 18:12
Posts: 22
mattg wrote:
So how in your mind do you see this working without creating a separate message at some stage for each recipient?

I believe that via scripting is not possible(with what I know at least) to have the above functionality without creating a separate message. And this is why I am turning to this forum!!!!

mattg wrote:
If you want to do this as the message is being delivered, are you expecting that your list only has local recipients?

I don't quite understand your question about local recipients. The list can have a mixture of local / external recipients.

mattg wrote:
What is the end result that you want? Why do you want recipients to be the only recipient listed?

End result is to deliver a personal message to each recipient and display within the message a header(and footer) like information that he is part of a list along with (un)subscribe information and other relevant information.
The way I see it this functionality must come from within the hMailServer when SMTPDeliverer produces a temp message at the Data folder but before sending the actual message will have to replace the TO part (as a part of a while loop for each recipient on the list).
This functionality can't be (I think at least) achieved via any Rule or Scripting combination that we may write using Rule creation from the UI or DOM API.
And this is the reason that I have posted a feature request.

mattg wrote:
Have you tried BCC to the recipient list? or removing the SMTP recipient header completely, like a BCC...

This is an interesting thought!!!!! I will try it straight away!!!!! Simple solutions create amazing results!!!! Thanks for this!!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest



Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group