How To Automatically Add A Disclaimer To Outgoing Emails With alterMIME (Postfix On Debian Lenny)
How To Automatically Add A Disclaimer To Outgoing Emails With alterMIME (Postfix On Debian Lenny)Version 1.0 This tutorial shows how to install and use alterMIME. alterMIME is a tool that can automatically add a disclaimer to emails. In this article I will explain how to install it as a Postfix filter on Debian Lenny. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm assuming that Postfix is already installed and fully functional - I will not explain how to set up Postfix and configure email accounts in this tutorial.
2 Installing alterMIMEalterMIME can be installed as follows: aptitude install altermime Next we create the user filter with the home directory /var/spool/filter filter - alterMIME will be run as that user: useradd -r -c "Postfix Filters" -d /var/spool/filter filter Afterwards we create the script /etc/postfix/disclaimer which executes alterMIME. Debian's alterMIME package comes with a sample script that we can simply copy to /etc/postfix/disclaimer: cp /usr/share/doc/altermime/examples/postfix_filter.sh /etc/postfix/disclaimer Now the problem with this script is that it doesn't distinguish between incoming and outgoing emails - it simply adds a disclaimer to all mails. Typically you want disclaimers only for outgoing emails, and even then not for all sender addresses. Therefore I've modified the /etc/postfix/disclaimer script a little bit - we'll come to that in a minute. Right now, we create the file /etc/postfix/disclaimer_addresses which holds all sender email addresses (one per line) for which alterMIME should add a disclaimer: vi /etc/postfix/disclaimer_addresses
Now we open /etc/postfix/disclaimer and modify it as follows (I have marked the parts that I've changed): vi /etc/postfix/disclaimer
Next we need the text file /etc/postfix/disclaimer.txt which holds our disclaimer text. Debian's alterMIME package comes with a sample text that we can use for now (of course, you can modify it if you like): cp /usr/share/doc/altermime/examples/disclaimer.txt /etc/postfix/disclaimer.txt Finally we have to tell Postfix that it should use the /etc/postfix/disclaimer script to add disclaimers to outgoing emails. Open /etc/postfix/master.cf and add -o content_filter=dfilt: to the smtp line: vi /etc/postfix/master.cf
At the end of the same file, add the following two lines:
Restart Postfix afterwards: /etc/init.d/postfix restart That's it! Now a disclaimer should be added to outgoing emails sent from the addresses listed in /etc/postfix/disclaimer_addresses.
3 Links
|




Recent comments
5 hours 27 min ago
6 hours 26 min ago
10 hours 13 min ago
11 hours 27 min ago
15 hours 4 min ago
22 hours 19 min ago
1 day 7 hours ago
1 day 8 hours ago
1 day 23 hours ago
2 days 2 hours ago