Membangun Mail Server Postfix di Fedora

Instalasi BIND ( DNS Server )

1. Cek terlebih dahulu paket-paket yang harus terinstal di komputer anda dengan cara :
[root@linux root]# rpm -qa |grep bind
bind-libs-9.2.3-13
system-config-bind-2.0.2-5
bind-utils-9.2.3-13
ypbind-1.17.2-1
bind-9.2.3-13

2. Setting DNS
# vi /etc/named.conf
options {
directory “/etc”;
pid-file “/var/run/named/named.pid”;
};

zone “.” {
type hint;
file “/etc/db.cache”;
};

zone “linuxsite.com” {
type master;
file “/var/named/linuxsite.com.hosts”;
};
zone “cahpati.com” {
type master;
file “/var/named/cahpati.com.hosts”;
};
zone “7.168.192.in-addr.arpa” {
type master;
file “/var/named/192.168.7.rev”;
};

3. Setting zone yang telah anda buat, kalo saya buatnya cahpati.com.hosts
# vi /var/named/cahpati.com.hosts

$ttl 38400
cahpati.com. IN SOA linux.cahpati.com. wahyu.cahpati.com. (
1220975691 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
38400 ; minimum
)
cahpati.com. IN NS linux.cahpati.com.
linux.cahpati.com. IN A 192.168.7.51
mx.cahpati.com. IN A 192.168.7.51
mail.cahpati.com. IN CNAME mx.cahpati.com
cahpati.com. IN MX 10 mx.cahpati.com

# vi /var/named/192.168.7.rev

$ttl 38400
7.168.192.in-addr.arpa. IN SOA linux.cahpati.com. wahyu.cahpati.com. (
1220975740 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
38400 ; minimum
)
7.168.192.in-addr.arpa. IN NS linux.cahpati.com.
51.7.168.192.in-addr.arpa. IN PTR linux.cahpati.com.
51.7.168.192.in-addr.arpa. IN PTR mx.cahpati.com.

Restart service BIND
/etc/init.d/named restart

Untuk memastikan dns sudah jalan dapat mengecek dengan mengetikan sbb:
[root@linux root]# nslookup -sil
> set type=any
> cahpati.com
Server: 192.168.7.50
Address: 192.168.7.50#53
cahpati.com mail exchanger = 10 mx.cahpati.com.cahpati.com.
cahpati.com
origin = linux.cahpati.com
mail addr = wahyu.cahpati.com
serial = 1220975691
refresh = 10800
retry = 3600
expire = 604800
minimum = 38400
cahpati.com nameserver = linux.cahpati.com.

4. Untuk memastikan komputer anda menggunakan DNS Server yang sudah diatur maka gunakan cara:
#vi /etc/resolv.conf

domain cahpati.com
nameserver 192.168.7.50
nameserver 125.166.104.60  ip public

Restart service Bind
/etc/ini.d/named restart

Instalasi Postfix (SMTP)

Cek terlebih dahulu paket postfixnya dengan mengetikan perintah sbb:
[root@linux root]# rpm -qa |grep postfix
postfix-2.0.18-4

1. Setting pengaturan postfixnya di
#vi /etc/postfix/main.cf
#soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
#default_privs = nobody
myhostname = linux.cahpati.com
#myhostname = virtual.domain.tld
mydomain = cahpati.com
myorigin = $myhostname
#myorigin = $mydomain
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost
#proxy_interfaces =
#proxy_interfaces = 1.2.3.4
#mydestination = $myhostname, localhost.$mydomain
#mydestination = $myhostname, localhost.$mydomain $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
# mail.$mydomain, http://www.$mydomain, http://ftp.$mydomain

#local_recipient_maps = unix:passwd.byname $alias_maps
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
#local_recipient_maps =
unknown_local_recipient_reject_code = 550
#unknown_local_recipient_reject_code = 450
#mynetworks_style = class
mynetworks_style = subnet
#mynetworks_style = host
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table
mynetworks = 192.168.7.0/24, 127.0.0.0/8
#relay_domains = $mydestination
#relayhost = $mydomain
#relayhost = gateway.my.domain
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
#relay_recipient_maps = hash:/etc/postfix/relay_recipients
#in_flow_delay = 1s
#alias_maps = dbm:/etc/aliases
alias_maps = hash:/etc/postfix/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
#alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
#recipient_delimiter = +
#home_mailbox = Mailbox
home_mailbox = ./Maildir/
#mail_spool_directory = /var/mail
#mail_spool_directory = /var/spool/mail
#mailbox_command = /some/where/procmail
#mailbox_command = /some/where/procmail -a “$EXTENSION”
#mailbox_transport = lmtp:unix:/file/name
#mailbox_transport = cyrus
#fallback_transport = lmtp:unix:/file/name
#fallback_transport = cyrus
#fallback_transport =
#luser_relay = $user@other.host
#luser_relay = $local@other.host
#luser_relay = admin+$local
luser_relay = wahyu
#header_checks = regexp:/etc/postfix/header_checks
#fast_flush_domains = $relay_domains
#fast_flush_domains =
#smtpd_banner = $myhostname ESMTP $mail_name
#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
#local_destination_concurrency_limit = 2
#default_destination_concurrency_limit = 20
debug_peer_level = 2
#debug_peer_list = 127.0.0.1
#debug_peer_list = some.domain
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.0.18/samples

# readme_directory: The location of the Postfix README files.
############################################################################

readme_directory = /usr/share/doc/postfix-2.0.18/README_FILES
alias_database = hash:/etc/postfix/aliases
mail_spool_directory = /var/mail
smtpd_banner = $myhostname ESMTP $mail_name
smtp_sasl_auth_enable = no
smtpd_sasl_auth_enable = no
smtpd_use_tls = no
smtp_use_tls = no
mailbox_size_limit = 0
message_size_limit = 10240000
disable_dns_lookups = no

#defer_transports = smtp
#smtp_sasl_auth_enable = yes
#smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
#canonical_maps = hash:/etc/postfix/canonical
#relocated_maps = hash:/etc/postfix/relocated
#transport_maps = hash:/etc/postfix/transport
#sender_canonical_maps = hash:/etc/postfix/sender_canonical
#smtpd_sender_restrictions = hash:/etc/postfix/access
#masquerade_exceptions = root
#masquerade_classes = envelope_sender, header_sender, header_recipient
#smtpd_helo_required = no
#strict_rfc821_envelopes = no
#smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination

Cara buat Mailing List di Postfix
Edit vi /etc/postfix/aliases  setting sesuai yg di inginkan

2. Sebelum menjalankan postfix anda harus mematikan service dari sendmail dengan cara
# /etc/init.d/sendmail stop atau bisa juga menghapus paket sendmail yang sebelumnya sudah terinstall cara sbb.
rpm -e –nodeps sendmail

Restart service Postfix nya
# /etc/init.d/postfix restart

3. Untuk memastikan bahwa postfix telah berjalan, kita coba telnet pada port SMTP
#telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
220 linux.cahpati.com ESMTP Postfix
helo cahpati.com
250 linux.cahpati.com
mail from:putri@cahpati.com
250 Ok
rcpt to:wahyu@cahpati.com
250 Ok
data
354 End data with .
subject: test kirim email
hai test mail ya dari admin
yes masuk
.
250 Ok: queued as 6C0121BE5C
quit
221 Bye
Connection closed by foreign host.

Instalasi Dovecot (POP3/IMAP)

Cek terlebih dahulu paket dovecot dengan mengetikan perintah sbb:
[root@linux root]# rpm -qa |grep dovecot
dovecot-0.99.10.4-4
1. Sesudah itu anda atur POP3 dan IMAP, untuk itu kita gunakan program dovecot
#vi /etc/dovecot.conf
protocols = imap imaps pop3 pop3s
disable_plantext_auth = no

Setelah itu restart service dovecotnya dengan cara :
/etc/init.d/dovecot restart

Jangan lupa untuk membuat user baru, dimana user tersebut akan langsung dibuatkan di mailboxnya, dengan cara:

useradd wahyu
passwd wahyu
Changing password for user wahyu.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

Untuk memastikan bahwa Dovecot telah berjalan, kita coba telnet pada port 110

# telnet localhost 110
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
+OK dovecot ready.
user wahyu
+OK
pass wahyu
+OK Logged in.
list
+OK 1 messages:
1 471
.
retr 1
+OK 471 octets
Return-Path:
X-Original-To: wahyu@cahpati.com
Delivered-To: wahyu@cahpati.com
Received: from linux.cahpati.com (linuxer.cahpati.com [127.0.0.1])
by linuxer.cahpati.com (Postfix) with SMTP id 852FE17832
for ; Thu, 2 Oct 2008 18:49:29 +0700 (WIT)
subject:test ya
Message-Id:
Date: Thu, 2 Oct 2008 18:49:29 +0700 (WIT)
From: wahyu@cahpati.com
To: undisclosed-recipients:;
.
quit
+OK Logging out.
Connection closed by foreign host.
……….

Instalasi Squirrelmail

Untuk menginstalasi paket squirrelamail Anda bisa langsung mengcopy paket squirrelmail-1.4.15.tar.gz ke directory /var/www/html
lalu extrak difilenya
# tar -xzvf squirrelmail-1.4.15.tar.gz
# mv squirrelmail-1.4.15 webmail
# cd /webmail/config
# ./config.pl

Rubah lah sesuai dengan keinginan anda :

SquirrelMail Configuration : Read: config.php (1.4.0)
———————————————————
Main Menu —
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages

D. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q Quit

Untuk memberikan hak akses untuk group dan user apache dapat mengetikan perintah sbb :

# chown -R nobody.nobody /usr/apps/htdocs/webmail
# chown -R nobody.nobody /usr/apps/htdocs/webmail/data

Jangan lupa buat file attachment
# mkdir /var/attach
# chown -R nobody.nobody /var/attach

Selamat Anda telah memiliki Server Email yang dapat di pakai untuk kirim dan terima E-mail,selamat mencoba tutorial singkat dari saya semoga tutorial ini membatu heeee.Maju trus open source Indonesia

tq

wahyu hendro p

Advertisements

3 Responses

  1. thanks om, tutorialnya sangat berguna buat ane yang masih nubie, ijin copy tutorialnya mo ane coba dulu.

  2. gNiie Bos Ketika saya masuk squirrelmai

    Ada tulisan ” ERROS : CONNECTIN DROPPED BY IMAP SERVER ” saya minta solusinya ……gmna itu ?

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: