Browsing the blog archives for June, 2009.

Disclaimer : Postfix-alterMIME-HOWTO

Linux

Belakangan ini penggunaan disclaimer pada email sudah menjadi hal yg umum dilakukan oleh perusahaan untuk menghindari hal-hal yang tidak diinginkan. Namun bagaimana cara menambahkan disclamer tersebut pada postfix?

Di website resminya pada bagian FAQ postfix sendiri mengklaim bahwa penambahan footer pada postfix belum dapat diimplementasikan seperti keterangan berikut :

How can I add or append a disclaimer (or other text) to the bottom of every email that gets sent from my mail server?

By design this is not implemented in Postfix directly. It’s not the job of an MTA, and it’s not as simple a problem as it seems because of MIME and digital signatures. MIME messages have a structure that can be very complex. Digital signatures attest to the fact that a signed message has not been modified. Adding a footer to the bottom of a message, breaks both of these. Some people add short text to the headers of email messages, but the text is not likely to be seen by most users. The real solution is to configure your clients to add whatever text is required.

Having said that, it is possible to configure a content filter that appends the text for you. Follow the directions for configuring Postfix to work with a content filter. Your filter should be MIME aware, and you should be aware that digital signatures will no longer work.

Namun bukan berarti bahwa di postfix tidak bisa menambahkan footer atau header. Hal ini bisa dilakukan salah satunya adalah dengan menggunakan alterMIME.

Berikut cara menambahkan footer pada postfix menggunakan alterMIME :

1. Download dan Install alterMIME

# wget http://www.pldaniels.com/altermime/altermime-0.3.10.tar.gz
# tar -xzvf altermime-0.3.10.tar.gz
# cd altermime-0.3.10
# make

# cp altermime /usr/bin/
# chown root.root /usr/bin/altermime
# chmod 755 /usr/bin/altermime

2. Tambahkan Non-Privileged User untuk menjalankan alterMIME

# useradd -c “Postfix Filters” -d /var/spool/filter filter
# mkdir /var/spool/filter
# chown filter.filter /var/spool/filter
# chmod 750 /var/spool/filter

3. Buat Script untuk menjalankan alterMIME

#vi /etc/postfix/disclaimer

isi file disclaimer :

#!/bin/sh
# Localize these.
INSPECT_DIR=/var/spool/filter
SENDMAIL=/usr/sbin/sendmail

# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69

# Clean up when done or when aborting.
trap “rm -f in.$$” 0 1 2 3 15

# Start processing.
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit
$EX_TEMPFAIL; }

cat >in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }

/usr/bin/altermime –input=in.$$ \
–disclaimer=/etc/postfix/disclaimer.txt \
–disclaimer-html=/etc/postfix/disclaimer.txt \
–xheader=”X-Copyrighted-Material: Please visit http://www.company.com/privacy.htm” || \
{ echo Message content rejected; exit $EX_UNAVAILABLE; }

$SENDMAIL “$@” <in.$$

exit $?

# chgrp filter /etc/postfix/disclaimer
# chmod 750 /etc/postfix/disclaimer

4. Buat file Disclaimer

# vi /etc/postfix/disclaimer.txt

This message is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. If you have received it by mistake, please let us know by e-mail reply and delete it from your system; you may not copy this message or disclose its contents to anyone. Please send us by fax any message containing deadlines as incoming e-mails are not screened for response deadlines. The integrity and security of this message cannot be guaranteed on the Internet.

5. Edit konfigurasi Postfix

Edit master.cf :

# vi /etc/postfix/master.cf

127.0.0.1:smtp  inet n – y – – smtpd
smtp                        inet n – y – – smtpd
-o content_filter=dfilt:
dfilt unix – n n – – pipe
flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} — ${recipient}

6. Restart Postfix

# postfix reload

7. Done

Sumber : http://blogninja.com/doc/altermime/html/postfix-altermime-howto.html#toc2

1 Comment