How do I forward a copy of all incoming messages, without including any attachments, to another destination?

  1. Home
  2. Knowledge Base
  3. Softalk
  4. Softalk Mail Server
  5. How do I forward a copy of all incoming messages, without including any attachments, to another destination?

Symptoms

A requirement could exist where, as well as being delivered to the intended recipients, incoming messages must also be forwarded without the attachments to another recipient.

Resolution

This is best done in two rules as follows. Note that these rules must be in the order shown and must be at the end of the list of rules.

Send Copy of All mail (rule 1)
Check messages when they arrive. If message not sent from MailScan and X-Copy-To header field does not exist add X-Copy-To header field with copy@domain.com and also blind carbon copy message to copy@domain.com and stop processing message.

Strip Attachments to Copy account (rule 2)
Check all messages. If X-Copy-To header field exists strip attachments

The first rule runs adding a custom header field to mark the message, if one does not already exist. It also forwards on a copy of the message. Then, processing is stopped for the message in order to prevent rule 2 running and stripping the attachments from the original message. The original message is then delivered (with attachments) and the forwarded message is sent, via SMTP, back into the mail server. This causes the forwarded message to pass once more through the Content Filter. This time the second rule is activated and this strips the attachment.

Another way this could be done is as follows

Send Copy of All mail (rule 1)
Check messages when they arrive. If message not sent from MailScan add X-Copy-To header field with copy@domain.com and also blind carbon copy message to copy@domain.com

Strip Attachments to Copy account (rule 2)
Check all messages. If X-Copy-To header field exists and message sent to *copy@domain.com* strip attachments

In this case, rule 1 adds the custom header to any incoming messages and forwards a copy to the Copy account. The second rule does not run for the original message, unless it was sent to the Copy account. The original message is delivered with the attachments and the forwarded copy is sent via SMTP back into the mail server. The forwarded message passes once more through the Content Filter. Rule 1 does not run for the forwarded message, as this message was sent by mailscan, but this time the second rule is activated, stripping the attachment.

More Info

NB. This cannot be performed in one rule in Content Filtering as the attachments will be stripped from the original message as well as the forwarded message.

Was this article helpful?

Related Articles