Logout

Alt-N Discussion Groups > MDaemon Discussion Groups > MDaemon API > CC a message from external CF filter process

 [F] Alt-N Discussion Groups  / MDaemon Discussion Groups  / MDaemon API  /

CC a message from external CF filter process

[md-api, Emanuele Aliberti via]
Emanuele Aliber…
Emanuele Aliberti via md-api - 06:49am, Dec 29 2020
Guest User

I am writing an external filter for MDaemon CF.

Is there a native API, or XML API, or raw message header that will CC
the message I am processing to another address?

I found that *.ctl file does not exist yet, when MDaemon hands me the
message to process, therefore I can not add a new recipient.



--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user
support and discussion. MDaemon staff members may participate in the
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------




  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items

Arron Caruth - Jan 4, 2021 12:37 pm (#1 Total: 3)  

Guest User  

Photo of Author
Posts: 1

If you are using the content filter to pass the message to a process, the CTL file will have already been created, used, and deleted.  At the point where the content filter is processing messages, there will be a single copy of the message for each recipient.  To add a recipient to the message you’ll need to create a copy of the message and change the CC and X-MDaemon-Deliver-To header.  You should probably also update the X-Rcpt-To, and X-MDRcpt-To headers.  Then if you want to control where a bounce or reply goes you’ll need to change those headers too.  If you want all the other recipients to be able to see that an address was added to the CC header, you will need to edit each copy of the message and add the address to the CC header in each copy (there should be 1 message for each recipient). 

If you do not need to update all copies of the message, then I don’t see any issues with simply creating another copy of the message without updating each copy of the message, however, you’ll want to be careful that you don’t create a copy of multiple messages.  For example, if a message is addressed to user1@domain.com and user2@domain.com, the content filter will be processing two messages, 1 to user1@domain.com and 1 to user2@domain.com. You’ll want to make sure that the criteria being used only create a copy of 1 message.

If the new recipient is a local user the new copy needs to be placed into the local queue.  If the recipient is not local it needs to be placed into the remote queue. 

I would recommend not saving the message file to the queue until all modifications have been made, or if you save it sooner than that, make sure to also create a LCK file so that MDaemon won’t  try to process the message before you are done.

And one last thing, if you do not want the new message to be processed by the content filter, change the first character in the file name from “m” to “p”.

--
Arron  Caruth
Vice President of Product Development
o: 817-601-3222    e: Arron.Caruth@mdaemon.com

MDaemon Technologies
Simple Secure Email
Visit us on www.mdaemon.com | Facebook | LinkedIn | YouTube
Sent using the MDaemon Email Server
-----Original Message-----
From: md-api@mdaemon.com [mailto:md-api@mdaemon.com]
Sent: Tuesday, December 29, 2020 5:50 AM
To: md-api List Member <md-api@mdaemon.com>
Subject: [md-api] CC a message from external CF filter process

I am writing an external filter for MDaemon CF.

Is there a native API, or XML API, or raw message header that will CC the message I am processing to another address?

I found that *.ctl file does not exist yet, when MDaemon hands me the message to process, therefore I can not add a new recipient.

 

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user
support and discussion.  MDaemon staff members may participate in the
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user
support and discussion.  MDaemon staff members may participate in the
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Emanuele Aliberti via md-api - Jan 8, 2021 5:04 am (#2 Total: 3)  

Guest User  

Photo of Author
Posts: 1
Thanks, Arron, for the detailed reply.

On 04/01/2021 18:37, Arron Caruth wrote:

If you are using the content filter to pass the message to a process, the CTL file will have already been created, used, and deleted.  At the point where the content filter is processing messages, there will be a single copy of the message for each recipient.

I had missed this important detail. I thought, mistakenly, that an external filter could be built to process messages in the incoming queue. Before router to kick in, I mean. Maybe I was deceived by the "If ALL MESSAGES" condition.


  To add a recipient to the message you’ll need to create a copy of the message and change the CC and X-MDaemon-Deliver-To header.  You should probably also update the X-Rcpt-To, and X-MDRcpt-To headers.  Then if you want to control where a bounce or reply goes you’ll need to change those headers too.  If you want all the other recipients to be able to see that an address was added to the CC header, you will need to edit each copy of the message and add the address to the CC header in each copy (there should be 1 message for each recipient). 

If you do not need to update all copies of the message, then I don’t see any issues with simply creating another copy of the message without updating each copy of the message, however, you’ll want to be careful that you don’t create a copy of multiple messages.  For example, if a message is addressed to user1@domain.com and user2@domain.com, the content filter will be processing two messages, 1 to user1@domain.com and 1 to user2@domain.com. You’ll want to make sure that the criteria being used only create a copy of 1 message.

If the new recipient is a local user the new copy needs to be placed into the local queue.  If the recipient is not local it needs to be placed into the remote queue. 

I would recommend not saving the message file to the queue until all modifications have been made, or if you save it sooner than that, make sure to also create a LCK file so that MDaemon won’t  try to process the message before you are done.


Thanks for the detailed description of options and caveats.

The solution that, in the end, we adopted was to delegate the management of Cc messages to the sender and simply process both messages in MDaemon's queues by our external filter.


And one last thing, if you do not want the new message to be processed by the content filter, change the first character in the file name from “m” to “p”.

Will you, please, add an item to the wish list for a future major MD release: dedicated queues for CF, AS, and AV?


Emanuele


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Arron Caruth - Jan 8, 2021 8:33 am (#3 Total: 3)  

Guest User  

Photo of Author
Posts: 1

> I thought, mistakenly, that an external filter could be built to process messages in the incoming queue. Before router to kick in, I mean.

 

We have experimented with allowing the  content filter to process messages in the incoming queue, but it caused all kinds of issues so we decided to not implement it yet. There is currently a way to process messages earlier in the message processing chain.  In order to do it you need to create a custom plugin. This is more complex than using the content filter but allows you to process messages during the inbound SMTP session.

 

More details on plugins can be found in the plugins.txt file in the MDaemon\Docs\API directory.

> Will you, please, add an item to the wish list for a future major MD release: dedicated queues for CF, AS, and AV?

I’ve added it to our wishlist.

 

Thanks!

--
Arron Caruth
Vice President of Product Development
o: 817-601-3222    e: Arron.Caruth@mdaemon.com

MDaemon Technologies
Simple Secure Email
Visit us on www.mdaemon.com | Facebook | LinkedIn | YouTube
Sent using the MDaemon Email Server

From: md-api@mdaemon.com [mailto:md-api@mdaemon.com]
Sent: Friday, January 8, 2021 4:05 AM
To: md-api List Member <md-api@mdaemon.com>
Subject: [md-api] CC a message from external CF filter process

 

Thanks, Arron, for the detailed reply.

 

On 04/01/2021 18:37, Arron Caruth wrote:

If you are using the content filter to pass the message to a process, the CTL file will have already been created, used, and deleted.  At the point where the content filter is processing messages, there will be a single copy of the message for each recipient.

I had missed this important detail. I thought, mistakenly, that an external filter could be built to process messages in the incoming queue. Before router to kick in, I mean. Maybe I was deceived by the "If ALL MESSAGES" condition.

 

  To add a recipient to the message you’ll need to create a copy of the message and change the CC and X-MDaemon-Deliver-To header.  You should probably also update the X-Rcpt-To, and X-MDRcpt-To headers.  Then if you want to control where a bounce or reply goes you’ll need to change those headers too.  If you want all the other recipients to be able to see that an address was added to the CC header, you will need to edit each copy of the message and add the address to the CC header in each copy (there should be 1 message for each recipient). 


If you do not need to update all copies of the message, then I don’t see any issues with simply creating another copy of the message without updating each copy of the message, however, you’ll want to be careful that you don’t create a copy of multiple messages.  For example, if a message is addressed to user1@domain.com and user2@domain.com, the content filter will be processing two messages, 1 to user1@domain.com and 1 to user2@domain.com. You’ll want to make sure that the criteria being used only create a copy of 1 message.

If the new recipient is a local user the new copy needs to be placed into the local queue.  If the recipient is not local it needs to be placed into the remote queue. 

I would recommend not saving the message file to the queue until all modifications have been made, or if you save it sooner than that, make sure to also create a LCK file so that MDaemon won’t  try to process the message before you are done.

 

Thanks for the detailed description of options and caveats.

The solution that, in the end, we adopted was to delegate the management of Cc messages to the sender and simply process both messages in MDaemon's queues by our external filter.

 

And one last thing, if you do not want the new message to be processed by the content filter, change the first character in the file name from “m” to “p”.

Will you, please, add an item to the wish list for a future major MD release: dedicated queues for CF, AS, and AV?

 

Emanuele

 
 
--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------
 
---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user
support and discussion.  MDaemon staff members may participate in the
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------



  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items



 Content:

Read New | Search

 Guest:

Email to Admin



You are visiting as a Guest user.