Lokasi Ardelindo Aples Depok


View Ardelindo Aples in a larger map

Senin, 13 Juli 2009

Authentifikasi SMTP Postfix SASL & Database MySQL

Sekarang kita bahas cara membuat authentifikasi SMTP postfix SASL yang terintegrasi dengan database MySQL (masih berhubungan dengan artikel postfix admin sebelumnya).
Dengan authentifikasi SASL, email client bisa melakukan relay dari sembarang IP, sebelum mengirimkan email ke SMTP pengguna akan ditanyakan username dan password virtual domain.
Oke kita langsung aja, langkah pertama adalah melakukan instalasi library sasl ...

Instalasi Paket SASL

apt-get install postfix-tls sasl2-bin libsasl2 libsasl2-modules libpam-mysql openssl

Konfigurasi PAM SMTP

vim /etc/pam.d/smtp

auth required pam_mysql.so user=postfix passwd=yourpass host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=1 md5=1

account sufficient pam_mysql.so user=postfix passwd=yourpass host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=1 md5=1

Konfigurasi SASL SMTPD
vim /etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd

mech_list: PLAIN LOGIN

log_level: 5


Autorun SASLAUTHD

vim /etc/default/saslauthd

START=yes

MECHANISMS="pam"

OPTIONS="-c -r -m /var/spool/postfix/var/run/saslauthd"


Buat Direktori Postfix SASL

mkdir /var/spool/postfix/var/
mkdir /var/spool/postfix/var/run/
mkdir /var/spool/postfix/var/run/saslauthd
chown -R root:sasl /var/spool/postfix/var/
chmod 710 /var/spool/postfix/var/run/saslauthd
adduser postfix sasl

ln -s /var/spool/postfix/var/run/saslauthd /var/run/saslauthd


Konfigurasi Postfix SMTP

vim /etc/postfix/main.cf

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_local_domain =

broken_sasl_auth_clients = yes

smtpd_sasl_authenticated_header = yes

smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unauth_destination


Test Authentifikasi Postfix
root@aples-desktop:~# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 aples-desktop.bengkel-linux.co.cc ESMTP Postfix (Ubuntu)
ehlo aples-desktop.bengkel-linux.co.cc
250-aples-desktop.bengkel-linux.co.cc
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN


Setup Evolution Email SASL


Test Authentifikasi SASL Evolution Mail

Tidak ada komentar:

Posting Komentar