Oleh : Imam A.W., S.Kom., M.Kom.

  1. Tambahkan alamat mail server di dalam konfigurasi DNS Server yang sebelumnya telah dibuat. (Perhatikan yang ditulis dengan huruf tebal)

    root@ubuntu:/ # pico /etc/bind/db.nabiha

    ;

    ; BIND data file for local loopback interface

    ;

    $TTL 604800

    @ IN SOA ns.nabiha.com. root.nabiha.com. (

    4 ; Serial

    604800 ; Refresh

    86400 ; Retry

    2419200 ; Expire

    604800 ) ; Negative Cache TTL

    ;

    @ IN NS ns.nabiha.com.

    @ IN A 192.168.137.2

    @ IN MX 10 mail.nabiha.com.

    @ IN AAAA ::1

    ns IN A 192.168.137.2

    mail IN A 192.168.137.2

    www IN A 192.168.137.2

    ftp IN A 192.168.137.2

  2. Restart dns server dengan perintah :

    root@ubuntu:/ # /etc/init.d/bind9 restart

  3. Periksa DNS dengan nslookup atau gunakan perintah dig

    root@ubuntu:/# nslookup mail.nabiha.com

    Server: 192.168.137.1

    Address: 192.168.137.1#53

    Non-authoritative answer:

    Name: mail.nabiha.com

    Address: 192.168.137.2

    Name: ns.nabiha.com

    Address: 192.168.137.2

    root@ubuntu:/# dig mx nabiha.com

    ; <<>> DiG 9.7.3 <<>> mx nabiha.com

    ;; global options: +cmd

    ;; Got answer:

    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2887

    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

    ;; QUESTION SECTION:

    ;nabiha.com. IN MX

    ;; ANSWER SECTION:

    nabiha.com. 604800 IN MX 10 mail.nabiha.com.

    ;; AUTHORITY SECTION:

    nabiha.com. 604800 IN NS ns.nabiha.com.

    ;; ADDITIONAL SECTION:

    mail.nabiha.com. 604800 IN A 192.168.137.2

    ns.nabiha.com. 604800 IN A 192.168.137.2

    ;; Query time: 40 msec

    ;; SERVER: 192.168.137.1#53(192.168.137.1)

    ;; WHEN: Sat Nov 17 09:35:46 2012

    ;; MSG SIZE rcvd: 98

  4. Instalasi postfix dengan perintah

    root@ubuntu:/#apt-get install postfix

  5. Instalasi squirrelmail dengan perintah

    root@ubuntu:/#apt-get install squirrelmail

  6. Konfigurasi pada postfix dengan perintah :

    root@ubuntu:/#dpkg-reconfigure postfix

  7. Konfigurasi pada squirrelmail dengan perintah :

    root@ubuntu:/# squirrelmail-configure

  8. Restart postfix dengan perintah :

    root@ubuntu:/#/etc/init.d/postfix restart

  9. Instalasi paket dovecot dengan perintah :

    root@ubuntu:/#apt-get install dovecot-postfix

  10. Cek port dengan perintah nmap

    root@ubuntu:/# nmap mail.nabiha.com

    Starting Nmap 5.21 ( http://nmap.org ) at 2012-11-17 09:46 PST

    Nmap scan report for mail.nabiha.com (192.168.137.2)

    Host is up (0.000090s latency).

    rDNS record for 192.168.137.2: nabiha.com

    Not shown: 989 closed ports

    PORT STATE SERVICE

    21/tcp open ftp

    22/tcp open ssh

    25/tcp open smtp

    53/tcp open domain

    80/tcp open http

    110/tcp open pop3

    143/tcp open imap

    443/tcp open https

    993/tcp open imaps

    995/tcp open pop3s

    3306/tcp open mysql

    Nmap done: 1 IP address (1 host up) scanned in 0.32 seconds

  11. Tambahkan virtual hosting untuk subdomain mail.nabiha.com. Arahkan DocumetRoot nya (/etc/apache2/site-available/default) ke default squirrelmail yang berada pada directori /usr/share/squirrelmail .

    root@ubuntu:/# pico /etc/apache2/sites-available/default

    <VirtualHost *:80>

    ServerAdmin webmaster@localhost

    DocumentRoot /usr/share/squirrelmail

    ServerName mail.nabiha.com

    ServerAlias mail.nabiha.com

    <Directory />

    Options FollowSymLinks

    AllowOverride None

    </Directory>

    <Directory /usr/share/squirrelmail/>

    Options Indexes FollowSymLinks MultiViews

    AllowOverride None

    Order allow,deny

    allow from all

    </Directory>

    —–sebagian code dibuang————–

    </VirtualHost>

  12. Restart web server, postfix, dovecot, dan dns dengan perintah :

    root@ubuntu:/#/etc/init.d/apache2 restart

    root@ubuntu:/#/etc/init.d/postfix restart

    root@ubuntu:/#/etc/init.d/dovecot restart

    root@ubuntu:/#/etc/init.d/bind9 restart

  13. Buka browser. Tuliskan http://mail.nabiha.com pada url . Jika konfigurasi benar maka akan tampil email client sebagaimana gambar berikut ini.

  14. Buatlah 3 buah user dengan data sebagai berikut.
No Username password
1 adminweb admin
2 user1 user1
3 user2 user2

  1. Untuk menambahkan user baru gunakan perintah :

    root@ubuntu:/#adduser adminweb

    Adding user `adminweb’ …

    Adding new group `adminweb’ (1004) …

    Adding new user `adminweb’ (1004) with group `user3′ …

    Creating home directory `/home/adminweb’ …

    Copying files from `/etc/skel’ …

    Enter new UNIX password:

    Retype new UNIX password:

    passwd: password updated successfully

    Changing the user information for adminweb

    Enter the new value, or press ENTER for the default

    Full Name []: adminweb

    Room Number []: 1111

    Work Phone []: 111

    Home Phone []: 111

    Other []: 111

    Is the information correct? [Y/n] y

    Gunakan perintah di atas untuk menambahkan user-user yang lainnya.

  2. Masukkan user dan password ke halaman login.

  3. Log mail server dapat di lihat di var/log/mail.log

    root@ubuntu:/#tail -f /var/log/mail.log

    Nov 17 09:57:24 ubuntu dovecot: lda(root): Error: chdir(/root) failed: Permission denied

    Nov 17 09:57:24 ubuntu dovecot: lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, euid is not dir owner)

    Nov 17 09:57:24 ubuntu dovecot: lda(root): Fatal: Invalid user settings. Refer to server log for more information.

    Nov 17 09:57:25 ubuntu postfix/local[23861]: 7A9704606: to=<root@nabiha.com>, orig_to=<root>, relay=local, delay=1069, delays=1068/0.25/0/0.39, dsn=4.3.0, status=deferred (temporary failure)

    Nov 17 10:05:25 ubuntu dovecot: imap-login: Login: user=<user1>, method=PLAIN, rip=::1, lip=::1, mpid=23908, secured

    Nov 17 10:05:25 ubuntu dovecot: imap(user1): Disconnected: Logged out bytes=44/697

    Nov 17 10:05:25 ubuntu dovecot: imap-login: Login: user=<user1>, method=PLAIN, rip=::1, lip=::1, mpid=23910, secured

    Nov 17 10:05:25 ubuntu dovecot: imap(user1): Disconnected: Logged out bytes=417/1637

    Nov 17 10:05:26 ubuntu dovecot: imap-login: Login: user=<user1>, method=PLAIN, rip=::1, lip=::1, mpid=23912, secured

    Nov 17 10:05:26 ubuntu dovecot: imap(user1): Disconnected: Logged out bytes=292/1898