Membangun mail server dengan Postfix Bagian ke-2

tux

Instalasi Courier-authlib

1. Lakukan extract dan instalasi paket courier-authlib

#tar jxvf courier-authlib-0.55.tar.bz2
#cd courier-authlib-0.55
#vim authmysqlrc

2. Lakukan perubahan di file authmysqlrc, sehingga hasilnya adalah sebagai berikut.
#DEFAULT_DOMAIN intra.net
MYSQL_CRYPT_PWFIELD password
MYSQL_DATABASE postfix
MYSQL_GID_FIELD ‘33333’
MYSQL_HOME_FIELD ‘/usr/local/virtual’
MYSQL_LOGIN_FIELD username
MYSQL_MAILDIR_FIELD maildir
MYSQL_NAME_FIELD name
MYSQL_OPT 0
MYSQL_PASSWORD postfix
#MYSQL_PORT 0
MYSQL_QUOTA_FIELD quota
MYSQL_SERVER localhost
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_UID_FIELD ‘33333’
MYSQL_USERNAME postfix
MYSQL_USER_TABLE mailbox
#MYSQL_WHERE_CLAUSE server=’mailhost.example.com’

Setelah itu, lakukan instalasi
#./configure –prefix=/usr/local –exec-prefix=/usr/local –with-authmysql –disable-root-check –with-ssl

–with-authchangepwdir=/usr/local/libexec/authlib –with-redhat –with-mysql=yes

#make && make check
#make install-strip && make install-configure

Instalasi Courier-imap

Lakukan extract dan instalasi paket courier-imap
#tar jxvf Courier-imap-4.0.2

Non user root diperlukan untuk mengcompiled Courier-imap, dalam hal ini, non user root yang digunakan adalah

user adi. sehingga paket harus diubah kepemilikannya.
#chown -R adi:root courier-imap-4.0.2

#su adi

$./configure –prefix=/usr/local –exec-prefix=/usr/local -without-authldap –disable-root-check –with-ssl

–with-authchangepwdir=/usr/local/libexec/authlib –with-mysql=yes –with-authmysql –with-redhat

$make && make check

Balik ke root lagih yah!!!

#make install-strip && make install-configure

Membuat ssl certificate untuk imap-ssl server.
#/usr/local/sbin/mkimapdcert

Lakukan perubahan di
#vim /usr/local/etc/imapd.cnf
ubah postmaser@example.com menjadi postmaster@intra.net

#vim /usr/local/etc/imapd
pastikan konfigurasi berikut ini ada :
IMAPDSTART=YES

#vim /usr/local/etc/imapd-ssl
Pastikan konfigurasi berikut ini ada :
IMAPDSSLSTART=YES
TLS_CERTFILE=/usr/local/share/imapd.pem

#vim /usr/local/etc/authlib/authdaemonrc
Sesuaikan konfigurasi berikut ini ada :
authmodulelist=”authmysql”

#vim /usr/local/etc/pop3d
Pastikan konfigurasi berikut ini ada :
POP3DSTART=YES
POP3AUTH=”LOGIN”

Membuat script untuk startup

#cp /usr/local/libexec/imapd.rc /etc/rc.d/init.d/imap
#cp /usr/local/libexec/imapd-ssl.rc /etc/rc.d/init.d/imaps
#cp /usr/local/libexec/pop3d.rc /etc/rc.d/init.d/pop3

lakukan start-stop untuk imap dan imaps dan simpan dalam /etc/rc.local
#/usr/local/sbin/authdaemond stop

#/usr/local/sbin/authdaemond start

#/etc/rc.d/init.d/imap stop

#/etc/rc.d/init.d/imaps stop

#/etc/rc.d/init.d/imap start

#/etc/rc.d/init.d/imaps start

#/etc/rc.d/init.d/pop3 start

#postfix start

Lakukan tes telnet ke port imap 143, smtp postfix 25 dan pop3 110

[root@am authlib]# telnet localhost 143
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT

THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2005 Double

Precision, Inc. See COPYING for distribution information.

Untuk melihat port imap dan pop3 aktif.
#netstat -tapn
tcp 0 0 :::110 :::* LISTEN 3072/couriertcpd
tcp 0 0 :::143 :::* LISTEN 2385/couriertcpd

Untuk instalasi squirrelmail

1.extract paket squirelmail dan pindahkan ke document_root yg terdapat dalam configurasi httpd.conf.
#tar zxvf squirrelmail.x.x.tar.gz
#mv squirrelmail webmail
#mv webmail /var/www/html
#cd /var/www/html/webmail
#chown -R apache.apache data/

Sehingga tampilannya spt ini.

drwxrwxr-x 2 apache apache 4096 May 19 18:18 data

#cd /webmail/config
#./conf.pl
Di bagian server
1. Domain : intra.net

2. Invert Time : false
3. Sendmail or SMTP : SMTP

di bagiam imap
IMAP Settings
————–
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : courier
9. Delimiter : autodetect

dibagian smtp
SMTP Settings
————-
4. SMTP Server : localhost
5. SMTP Port : 25
6. POP before SMTP : false
7. SMTP Authentication : none
8. Secure SMTP (TLS) : false
9. Header encryption key :

Login ke webmail
http://%5Bip address postfix]/webmail/

To be continued –

Regards
Adi Maulana

19 responses to “Membangun mail server dengan Postfix Bagian ke-2

  1. Pingback: Adi Maulana

  2. Bos…bagian ke-3 nya mana neeh..:-)

  3. mas adi, saya sudah ngikutin step by step how tonya mas adi,
    untuk smtp udah bisa jalan, tapi yang aneh kok pop3 ama imap nya ga jalan ya ??

    aku dah bikin domain baru via postfixadmin,

    telnet localhost 143
    a login ipunk@test.com ipunk
    * BYE Temporary problem, please try again later
    Connection closed by foreign host.

    sebabnya apa ya mas ?? aku dah cek, authdaemon nya udah jalan

    mohon bantuannya ya mas adi

  4. bos, aku ga bisa jalanin perintah ini :

    $./configure –prefix=/usr/local –exec-prefix=/usr/local -without-authldap –disable-root-check –with-ssl
    –with-authchangepwdir=/usr/local/libexec/authlib –with-mysql=yes –with-authmysql –with-redhat
    …..
    configure: error: invalid variable name: –prefix
    …..

    makasii, bantuannya mas.

  5. Mas Ipung,

    Sepertinya ada tahap-tahap yang mas ipung lewatkan, ikut saja tahap-tahap berikut ini dengan benar dan betul.
    https://adimaulana.wordpress.com/2007/05/31/mambangun-mail-server-dengan-postfix-bagian-ke-2/

    Regards
    Adi Maulana

  6. Kang Maman,

    bukan -prefix tapi yang benar adalah – -prefix(tanda double strip, tanpa space)

    Regards
    Adi Maulana

  7. Mas Adi,

    saya mengalami hal yang sama dengan mas ipunk,
    tidak bisa login di port 110 dan 143 (pop3 dan imap)
    dg message:
    ERR – login failed

    sebelumnya error messagenya sama dg mas ipunk:
    * BYE Temporary problem, please try again later
    Connection closed by foreign host.

    trus saya compile ulang Courier-IMAP nya..

    Terimakasih..

  8. Mas Fauji,

    Terima kasih sudah berbagi informasi dan solusi.

    Adi Maulana

  9. Dh mas adimaulana,
    Terimakasi mas buat toturial nya, saya sudah ikuti alur manual yang mas buat, tapi sampai command dibawah ini ada pesan error, command nya :
    ./configure –prefix=/usr/local –exec-prefix=/usr/local –with-authmysql –disable-root-check –with-ssl –with-authchangepwdir=/usr/local/libexec/authlib –with-centos –with-mysql=yes

    Pesan error nya :
    configure: error: Cannot find either the gdbm or the db library.

    Thx atas bantuannya mas.

    Regards,
    Dave

  10. Mas Dave,

    Sepertinya, Paket perl DB blom di install, coba install aja dulu.

    #perl -MCPAN -e shell
    cpan> install DB_File
    cpan> quit

    Semoga membantu.
    Adi Maulana

  11. Pingback: Delivery Temporarily Suspended: Connect To 127.0.0.1[127.0.0.1]: « Adi Maulana

  12. Saya sudah ikutin saran mas

    #perl -MCPAN -e shell
    cpan> install DB_File
    cpan> quit

    namun pop3 saya masih nggak bisa login, ada setingan lainkah ? kalo postfixnya sudah bisa kirim dan nerima di maildir nya.

  13. salam, mas say mau nanaya, ada beebrapa pertanayaan :
    1. kalo postfixnya dah diinstallin langsung dari CD CentOS 5 64 Bit itu dah langsung bisa databasenya di mysql ngak?
    2. postfixnya dah jalan, terus Courier-IMAP nya dah jalan, Squirelmailnya dah jalan, cuman pas login error “ERROR: Connection dropped by IMAP server.”. terus di cek pake configtest.php ada tulisan gini :
    ” Checking database functions…
    not using database functionality.”
    itu maksudnya ngak konek ke Mysql atau gmn ya??
    mohon bantuannya, terimakasih …

  14. mas..mas nanya dunk…kan bila sudah bisa keluar tampilan squirrelmailnya, tp username dan password standarnya apa sih…koq saya mencoba login postfix. postfix tidak bisa login yach mas..error..unknown user or password..makasih mas..

  15. salam kenal,, mas saya mau bertanya nih..
    pertannyaan nya sangat aneh mas,,heee..
    manfaat mail server berbasis postfix apa ya??
    saya lagi nyari bahan untuk skripsi nih?? pleass mas.. jawab ya??? mengap juga menngunakan mySql…??? makasih

  16. salam kenal,
    mas mo nanya???
    setelah mengeksekusi perintah berikut

    ./configure –prefix=/usr/local –exec-prefix=/usr/local –with-authmysql –disable-root-check –with-ssl –with authchangepwdir=/usr/local/libexec/authlib –with-redhat –with-mysql=yes

    saya cek folder berikut gag da ya
    /usr/local/libexec/authlib

    (di dlm libexec tidak ada folder authlib)

  17. mas begitu saya login ke squirelmailnya muncul pesan “Error connecting to IMAP server: localhost.
    111 : Connection refused ” itu kenapa ya mas??

  18. udah jelas masalahnya…imapnya lom up., coba evaluasi dibagian “Instalasi Courier-imap”, kalo sudah, pastikan bisa di telnet localhost 110

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 )

Facebook photo

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

Connecting to %s