Posted on 21. Jan, 2012 by malik in Server Debian
Mail server adalah sistem yang memungkinkan pengguna (user) untuk dapat mengirim dan menerima surat elektronik (Email) satu sama lain dalam satu jaringan atau dengan internet. Sedangkan webmail server yaitu sarana yang memungkinkan user dapat mengakses email melalui web. Jadi mail server adalah mesinnya dan webmail server adalah interfacenya. Mail server yang akan kita bahas disini adalah dengan menggunakan postfix dan dovecot. Sedangkan untuk webmailnya kita menggunakan squirrelmail. Untuk mempersingkat mari kita langsung ke cara menginstallannya di linux debian.
Install Postfix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
| naditkj:~# apt-get install postfix Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: postfix-mysql postfix-pgsql postfix-ldap postfix-pcre sasl2-bin libsasl2-modules resolvconf postfix-cdb ufw The following packages will be REMOVED: exim4 exim4-base exim4-config exim4-daemon-light The following NEW packages will be installed: postfix 0 upgraded, 1 newly installed, 4 to remove and 0 not upgraded. Need to get 0B/1224kB of archives. After this operation, 1008kB disk space will be freed. Do you want to continue [Y/n]? y Media change: please insert the disc labeled 'Debian GNU/Linux 5.0.0 _Lenny_ - Official i386 DVD Binary-1 20090214-16:54' in the drive '/cdrom/' and press enter Preconfiguring packages ... (Reading database ... 36888 files and directories currently installed.) Removing exim4 ... dpkg: exim4-base: dependency problems, but removing anyway as you request: exim4-daemon-light depends on exim4-base (>= 4.69). Removing exim4-base ... Stopping MTA: exim4_listener. Removing exim4-config ... dpkg: exim4-daemon-light: dependency problems, but removing anyway as you request: bsd-mailx depends on exim4 | mail-transport-agent; however: Package exim4 is not installed. Package mail-transport-agent is not installed. Package exim4-daemon-light which provides mail-transport-agent is to be removed. at depends on exim4 | mail-transport-agent; however: Package exim4 is not installed. Package mail-transport-agent is not installed. Package exim4-daemon-light which provides mail-transport-agent is to be removed. lsb-core depends on exim4 | mail-transport-agent; however: Package exim4 is not installed. Package mail-transport-agent is not installed. Package exim4-daemon-light which provides mail-transport-agent is to be removed. Removing exim4-daemon-light ... Stopping MTA:. Processing triggers for man-db ... Selecting previously deselected package postfix. (Reading database ... 36752 files and directories currently installed.) Unpacking postfix (from .../postfix_2.5.5-1.1_i386.deb) ... Processing triggers for man-db ... Setting up postfix (2.5.5-1.1) ... Adding group `postfix' (GID 114) ... Done. Adding system user `postfix' (UID 108) ... Adding new user `postfix' (UID 108) with group `postfix' ... Not creating home directory `/var/spool/postfix'. Creating /etc/postfix/dynamicmaps.cf Adding tcp map entry to /etc/postfix/dynamicmaps.cf Adding group `postdrop' (GID 115) ... Done. Postfix was not set up. Start with cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf . If you need to make changes, edit /etc/postfix/main.cf (and others) as needed. To view Postfix configuration values, see postconf(1). After modifying main.cf, be sure to run '/etc/init.d/postfix reload'. |
1
| naditkj:~# dpkg-reconfigure postfix |
Kemudian isi system mail name misalnya nady.net nama tersebut digunakan untuk domain alamat email user anda misalnya nama@nady.net (Saya sarankan samakan dengan nama domain anda di DNS) agar lebih mudah mengkonfigurasinya.
Untuk postmaster dan root pada menu berikutnya isikan dengan user debian anda saja. Dan untuk pilihan berikutnya pilih ok saja sampai ke menu dibawah
Ubah hingga menjadi ip localhost, ip network anda seperti contoh di atas. 127.0.0.0/8 itu adalah ip localhost sedangkan 192.168.0.0/24 itu adalah network pada jaringan kita. (Bisa di ubah sesuai dengan IP anda). Selanjutnya pada pilihan use mail delivery pilih No. Dan berikutnya enter saja hingga tampilan pemilihan IPv4 dan IPv6 pilih All saja.
Install Dovecot (IMAP & POP3)
Penginstallan postfix telah selesai, selanjutnya kita install dovecot untuk mengaktifkan POP3 dan IMAP.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| naditkj:~# apt-get install dovecot-common dovecot-imapd dovecot-pop3d Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: dovecot-common dovecot-imapd dovecot-pop3d 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 0B/3176kB of archives. After this operation, 6386kB of additional disk space will be used. Selecting previously deselected package dovecot-common. (Reading database ... 36915 files and directories currently installed.) Unpacking dovecot-common (from .../dovecot-common_1.0.15-2.3_i386.deb) ... Selecting previously deselected package dovecot-imapd. Unpacking dovecot-imapd (from .../dovecot-imapd_1.0.15-2.3_i386.deb) ... Processing triggers for man-db ... Media change: please insert the disc labeled 'Debian GNU/Linux 5.0.0 _Lenny_ - Official i386 DVD Binary-2 20090214-16:54' in the drive '/cdrom/' and press enter Selecting previously deselected package dovecot-pop3d. (Reading database ... 37168 files and directories currently installed.) Unpacking dovecot-pop3d (from .../dovecot-pop3d_1.0.15-2.3_i386.deb) ... Setting up dovecot-common (1:1.0.15-2.3) ... Creating config file /etc/dovecot/dovecot.conf with new version Creating config file /etc/dovecot/dovecot-ldap.conf with new version Creating config file /etc/dovecot/dovecot-sql.conf with new version adduser: Warning: The home directory `/usr/lib/dovecot' does not belong to the user you are currently creating. Creating generic self-signed certificate: /etc/ssl/certs/dovecot.pem (replace with hand-crafted or authorized one if needed). Setting up dovecot-pop3d (1:1.0.15-2.3) ... Restarting IMAP/POP3 mail server: dovecot. Setting up dovecot-imapd (1:1.0.15-2.3) ... Restarting IMAP/POP3 mail server: dovecot. |
1
| naditkj:~# nano /etc/dovecot/dovecot.conf |
Kemudian cari mail_location dan ganti menjadi seperti ini:
Tahap dovecot sudah selesai selanjutnya kita install squirrelmail untuk interfacenya.
Install Squirrelmail (Webmail)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| naditkj:~# apt-get install squirrelmail Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: squirrelmail-locales Suggested packages: squirrelmail-decode imapproxy php-pear php4-pear php5-ldap php4-ldap The following NEW packages will be installed: squirrelmail squirrelmail-locales 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 0B/3114kB of archives. After this operation, 12.6MB of additional disk space will be used. Do you want to continue [Y/n]? y Selecting previously deselected package squirrelmail. (Reading database ... 37175 files and directories currently installed.) Unpacking squirrelmail (from .../squirrelmail_1.4.15-4_all.deb) ... Selecting previously deselected package squirrelmail-locales. Unpacking squirrelmail-locales (from .../squirrelmail-locales_1.4.13-20071220-1_all.deb) ... Processing triggers for man-db ... Setting up squirrelmail (2:1.4.15-4) ... Installing default squirrelmail config. Run /usr/sbin/squirrelmail-configure as root to configure/upgrade config. Setting up squirrelmail-locales (1.4.13-20071220-1) ... |
1
| naditkj:~# nano /etc/apache2/apache2.conf |
1
| Include /etc/squirrelmail/apache.conf |
Setelah selesai semuanya mari kita membuat misalnya 2 user email untuk percobaan
1
2
3
4
5
6
7
8
9
10
| naditkj:~# useradd admin -s /bin/false -m naditkj:~# passwd admin Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully naditkj:~# useradd umi -s /bin/false -m naditkj:~# passwd umi Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully |
Restart Semua Servis yang bersangkutan
1
2
3
4
| naditkj:~# /etc/init.d/apache2 restart Restarting web server: apache2. naditkj:~# /etc/init.d/dovecot restart Restarting IMAP/POP3 mail server: dovecot. |
Silakan login dengan user yang dibuat tadi kemudian coba kirim email seperti gambar berikut:
Pada Gambar tersebut mengirim dari admin@nady.net ke umi@nady.net dan silakan logout dan coba login ke umi@nady.net maka jika berhasil yaitu seperti berikut:
0 comments:
Post a Comment