..:: Nank\’s Blog ::..

Born To Learn Died To Be Honour

Memproteksi Distribution List Dari Domain Yang Tidak Diinginkan (Solved)

Beberapa hari lalu terjadi insiden kecil di kantor saya, tiba – tiba saja ada email yang ‘kurang menyenangkan’ yang datang dari domain luar, tepatnya dari salah satu account gmail. Hal ini tentu saja membuat gerah pihak manajemen… menurut mereka harusnya Millis (lebih tepatnya yang saya gunakan disini adalah Distribution List, fasilitas dari mail server Zimbra Collaboration Suite) hanya digunakan untuk kebutuhan internal, jadi harus steril dari user diluar perusahaan / diluar domain perusahaan. Ujung – ujungnya tantangan baru nih… :) , setelah googling kesana – sini, browsing ke zimbra, nanya – nanya ke millis…so akhirnya semua dapat teratasi dengan baik.Pada kesempatan ini saya mencoba menuliskan ulang langkah – langkahnya, mudah – mudahan saja tulisan ini dapat menjadi ‘rekam peristiwa’ yang dapat berguna nantinya, in case saya lupa misalnya, lebih – lebih kalau dapat berguna buat teman – teman yang mengalami kejadian yang sama.

Catatan :

1. Langkah – langkah ini adalah langkah merubah postfix,

dengan membuat rule baru, untuk menentukan domain mana yang boleh

mengirim, atau tidak ke dalam distribution list.

2. Dalam hal ini

nantinya akan terbentuk beberapa file baru dan beberapa manipulasi

konfigurasi postfix. Sangat saya sarankan untuk melakukan backup

sebelum melakukan eksekusi.

3. Langkah – langkah ini sudah teruji

dalam mail server saya, namun mungkin saja tidak dapat dilakukan dimail

server yang lain, atau butuh penyesuaian. Maka ada baiknya sebelum

melakukannya, anda pelajari dulu langkah – langkah yang saya tulis ini

secara menyeluruh.

4. Resiko apapun yang timbul dikarenakan

perubahan konfigurasi pada mail server anda, sepenuhnya menjadi

tanggung jawab anda dan bukan tanggung jawab saya selaku penulis.

Create a ‘permitted senders’ list (as user zimbra) – This is your list of domains and/or users who can email your protected email addresses:

vi /opt/zimbra/postfix/conf/permitted_senders

[paste in contents below editing as required]

localhost               OK
mydomain.com            OK
zimbra.mydomain.com     OK
okuser@externaldom.com  OK

Create a ‘protected recipients’ list (as user zimbra) – This is your list of email addresses that may only receive email from ‘permitted senders’

vi /opt/zimbra/postfix/conf/protected_recipients

[paste in contents below editing as required]

test-dist-list@mydomain.com
permitted_senders_list
protected-user@mydomain.com
permitted_senders_list

Create a simple bash script to create postfix DB files (as user zimbra):

vi /opt/zimbra/postfix/conf/update_protected_recipients

[paste in contents below editing as required]

#!/bin/bash
echo "rebuild permitted_senders..."
postmap /opt/zimbra/postfix/conf/permitted_senders
echo "rebuild protected_recipients..."
postmap /opt/zimbra/postfix/conf/protected_recipients

Make new script executable, then run it

chmod 755 /opt/zimbra/postfix/conf/update_protected_recipients
/opt/zimbra/postfix/conf/update_protected_recipients

You should now see permitted_senders.db and protected_recipients.db in the directory

Add necessary settings to /opt/zimbra/postfix/conf/main.cf

vi /opt/zimbra/postfix/conf/main.cf

[add these items to the file - note permitted_senders_list must match value in protected_recipients]

permitted_senders_list = check_sender_access hash:/opt/zimbra/postfix/conf/permitted_senders, reject
smtpd_restriction_classes = permitted_senders_list
**Note this change to the main.cf won't survive upgrades. Be sure to save a copy of your main.cf file**

Now add your new restriction to the top of postfix_recipient_restrictions.cf

vi /opt/zimbra/conf/postfix_recipient_restrictions.cf

[paste this into the first line of the file, above any other settings]

check_recipient_access hash:/opt/zimbra/postfix/conf/protected_recipients

Reload postfix to activate settings:

postfix reload

Note 3 from talk: files ownership should be set to root:postfix before reloading postfix. This avoids annoying warning messages in logfile.

SAATNYA UNTUK MELAKUKAN TESTING :

Test your settings via telnet:

Enter command:

telnet zimbra.mydomain.com 25

You will see:

Trying 192.168.1.1...
Connected to zimbra.mydomain.com.
Escape character is '^]'.
220 zimbra.mydomain.com ESMTP Postfix

Enter command:

HELO test.com

You will see:

250 zimbra.mydomain.com

Enter command:

MAIL FROM: jdoe@test.com

You will see:

250 Ok

Enter command:

RCPT TO: test-dist-list@mydomain.com

You will see:

554 <test-dist-list@mydomain.com>: Recipient address rejected: Access denied
QUIT
221 Bye
Connection closed by foreign host.
That’s it. If you need to protect new distribution lists or emails, or add new senders, just edit and re-run the update script, then reload postfix.

Sumber berita : http://wiki.zimbra.com/index.php?title=RestrictPostfixRecipients

June 9, 2009 - Posted by | Linux, Tutorial, Zimbra | , , , , , , , ,

2 Comments »

  1. Emang pakar zimbra beda deh…luar biasa

    Comment by Yahya | June 19, 2009 | Reply

  2. sptnya perlu dicoba nih. Selama ini gw pasang ASSP sebagai SMTP Proxy di depan Zimbra. Pembatasan akses ke dist list dilakukan di ASSP.

    Comment by papandut | June 27, 2009 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.