Membuat Mail Server Using Postfix ( SMTP ) dan Dovecot ( IMAP / POP3 ) Fedora 14

IP Address : 192.168.11.11
Network : 192.168.11.0/24

Note :

Pastikan DNS Server Nya sudah berjalan lancar dan sudah di Config MX ( Mail Excange ) Recordnya buat IP Mail Server Tsb..

Langsung Aja Bos..

1. Install Postfix
- yum install postfix

2. Edit file /etc/postfix/main.cf
- vi /etc/postfix/main.cf
• Hilangkan tanda ( # ) pada myhostname line, dan rubah host.domain.tld dengan domain mail server anda, sbg contoh mail.irdhy.com.
• Hilangkan tanda ( # ) pada mydomain line, dan rubah domain.tld dengan domain anda, sbg contoh irdhy.com.
• Hilangkan tanda ( # ) pada myorigin = $mydomain line
• Hilangkan tanda ( # ) pada myorigin = $myhostname line.
• Hilangkan tanda ( # ) pada mydestination = $myhostname, localhost.$mydomain line.
• Hilangkan tanda ( # ) pada mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
• Hilangkan tanda ( # ) pada inet_interfaces = all line.
• Tambahkan tanda ( # ) pada inet_interfaces = localhost line.
• Hilangkan tanda ( # ) pada mynetworks = 168.100.189.0/28, 127.0.0.1; replace 168.100.189.0/28 Sbg contoh saya ganti dengan network 192.168.11.0/24
• Hilangkan tanda ( # ) pada home_mailbox = Maildir/
• Hilangkan tanda ( # ) pada mail_spool_directory = /var/mail
• Hilangkan tanda ( # ) pada mail_spool_directory = /var/spool/mail

3. Secara default fedora 14 Sudah terinstall Sendmail agar Postfix bisa berjalan edit alternaif MTA
- alternatives --config mta

There are 2 programs which provide 'mta'.

Selection Command
-----------------------------------------------
* 1 /usr/sbin/sendmail.sendmail
+ 2 /usr/sbin/sendmail.postfix

Enter to keep the current selection[+], or type selection number: 2
* Pilih postfix dengan memilih nomor 2

4. Matikan sendmail karena bila service sendmail aktif akan bentro port 25 dan saat restart postfix ada ada log FAILED
- service sendmail stop
- chkconfig sendmail off

5. Restart postfix dan cek konfigurasi agar autorun
- /etc/init.d/postfix restart
- service postfix restart
- chkconfig postfix on

6. Install Dovecot ( Untuk POP3 / IMAP Server )
- yum install dovecot

7. Masuk Direktori Dovecot Conf
- vi /etc/dovecot/dovecot_conf
Line #protocols = imap pop3 lmtp -->> Hilangkan tanda ( # )

8. Masuk Direktori Autentikasi Dovecot
- vi /etc/dovecot/conf.d/10-auth.conf
Line #disable_plaintext_auth = yes -->> Hilangkan tanda ( # )
* Rubah menjadi
- disable_plaintext_auth = no

9. Restart Dovecot
- /etc/init.d/dovecot restart
- service dovecot start
- chkconfig dovecot on

10. Add User
- adduser irdhy
- passwd irdhy
Changing password for user irdhy.
New password: test
Retype new password: test
passwd: all authentication tokens updated successfully.

11. Login Menggunakan Mail Client / Outlook setting sesuai konfigurasi diatas.
* Incoming ( POP3/IMAP ) n Outgoing ( SMTP ) menggunakan mail.irdhy.com

Selesai..

Konfigurasi SSL / TLS Encryption Dovecot dan Postfix
( Untuk Enkripsi Biar lebih aman.. Biar lebih secure deh pokonya )

Konfigurasi SSL / TLS Encryption Dovecot dan Postfix
( Untuk Enkripsi Biar lebih aman.. Biar lebih secure deh pokonya )

1. Remove Certificate dan Key Default Dovecot
- rm /etc/pki/dovecot/certs/dovecot.pem
- rm /etc/pki/dovecot/private/dovecot.pem.

2. Install Sertifikasi Baru
- /usr/libexec/dovecot/mkcert.sh
Script diatas akan membuat sertifikasi dan key baru didalam direktori /etc/pki/dovecot/certs dan /etc/pki/
dovecot/private.

3. Masuk direktori Dovecot SSL Configuration
- vi /etc/dovecot/conf.d/10-ssl.conf
Line # SSL/TLS support: yes, no, required.
==== Hilangkan tanda ( # ) untuk mengaktifkan SSL ===
#ssl = yes

4. Restart Dovecot
- /etc/init.d/dovecot restart
- service dovecot restart

5. Masuk direktori Postfix dan Buat direktori untuk Certificate dan Key
- mkdir /etc/postfix/certs
- mkdir /etc/postfix/private

6. Copi Certificate n Key Dovecot
- cp /etc/pki/dovecot/certs/dovecot.pem /etc/postfix/certs
- cp /etc/pki/dovecot/private/dovecot.pem /etc/postfix/private

7. Buat File di Postfix Main.cf
- vi /etc/postfix/main.cf
========== Tambahkan di Line terakhir Konfigurasi seperti di bawah ============
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/postfix/certs/dovecot.pem
smtpd_tls_key_file = /etc/postfix/private/dovecot.pem

8. Masuk Direktori Postfix master.cf
- vi /etc/postfix/master.cf
========== Hilangkan Tanda ( # ) Pada :
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes

Login menggunakan Mail Client Untuk Receive Gunakan TLS / SSL Encryption dan Untuk Transport dunakan TLS Encryption.

Terima kasih

Hasilnya Boss

[root@fedora irdhy]# telnet mail.irdhy.com 25
Trying 192.168.11.11...
Connected to mail.irdhy.com.
Escape character is '^]'.
220 fedora.irdhy.com ESMTP Postfix

[root@fedora irdhy]# telnet 192.168.11.11 25
Trying 192.168.11.11...
Connected to 192.168.11.11.
Escape character is '^]'.
220 fedora.irdhy.com ESMTP Postfix

[root@irdianto irdhy]# telnet mail.irdhy.com 110
Trying 192.168.11.11...
Connected to mail.irdhy.com.
Escape character is '^]'.
+OK Dovecot ready.

[root@irdianto irdhy]# telnet 192.168.11.11 110
Trying 192.168.11.11...
Connected to 192.168.11.11.
Escape character is '^]'.
+OK Dovecot ready.

Silahkan mencoba..

Antispam
Install Amavisd-new, SpamAssassin And ClamAV ( Untuk Mail Security )

Tutorialnya Dapat Dilihat Disini..

http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-fedora-14-x86_64-p4
http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-fedora-14-x86_64-p5