1

I am currently managing an email server that is being handled by Exim 4.85 This server currently adds a footer to all outgoing messages. The line that adds this functionality can be found on several guides:

transport_filter=/usr/bin/altermime --input=- --disclaimer=/etc/exim_footer --disclaimer-html=/etc/exim_footer_html

However, it is now necessary to keep certain outgoing emails as they were originally. The advantage is that this has to be done for a single email address, namely [email protected], and all of these emails will be text-only (ie no HTML).

Example:

[email protected] sends email ===> exim adds footer ===> delivered
  [email protected] sends email =========================> delivered

I figured I could make use of the string expansion capabilities and make altermime use a blank file for that but it has been a nightmare so far. I have basically been getting

Expansion of [...] failed: condition name expected, but found ""

and

transport filter process failed (127): unable to execute command

What bothers me, is that testing the expansion via the exim -bem command returns the desired output.

These are just a few of my failed attempts:

transport_filter=/usr/bin/altermime --input=- --disclaimer='${if eq {$sender_address}{[email protected]}{/etc/exim_footer}{/etc/empty_file}}'
transport_filter=/usr/bin/altermime --input=- --disclaimer=${if eq {$sender_address}{[email protected]}{/etc/empty_file}{/etc/exim_footer}} --disclaimer-html=/etc/exim_footer_html
transport_filter={${if eq {$sender_address}{[email protected]}{/etc/empty_file}{/usr/bin/altermime --input=- --disclaimer=/etc/exim_footer --disclaimer-html=/etc/exim_footer_html}}}

Any ideas on how to do this?

1 Answer 1

3

Set your transport_filter to bash/python/.. script

transport_filter = /scripts/exim_add_signature.sh $sender_address

See http://www.exim.org/exim-html-current/doc/html/spec_html/ch-generic_options_for_transports.html for documentation about transport_filter.

In the script do the following (pseudo-code):

no_signature_mails = ["[email protected]"]
if (argv[1] isnotin no_signature_mails)
    /usr/bin/altermime --input=- --disclaimer=/etc/exim_footer --disclaimer-html=/etc/exim_footer_html
1
  • Sometimes it's the simple things that work. Thank you very much! I am going to look into further customizations in the future, for example to allow per user footers.
    – justabit
    Sep 3, 2015 at 1:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .