Berikut ini adalah tutorial untuk setting Email Server di komputer dengan OS Linux Ubuntu 11.04 server
1. Install postfix, dovecot, sasl2‐bin,apache2,php5 dengan cara :
apt-get install bind9 apache2 dovecot-postfix mysql-server php5 php5-mysql php5-mcrypt php-pear sasl2-bin libsasl2-modules libsasl2-2
2. Edit konfigurasi sasl
vi /etc/default/saslauthd
START=no
menjadi
START=yes
invoke-rc.d postfix restart
invoke-rc.d dovecot restart
invoke-rc.d saslauthd restart
3. Edit konfigurasi Postfix (ganti yang tercetak tebal sesuai spesifikasi komputer server anda saat instalasi atau konfigurasi domain anda)
vi /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = servervkj.pasarpagimanggadua.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.pasarpagimanggadua.com, pasarpagimanggadua.com, servervkj.pasarpagimanggadua.com, localhost.pasarpagimanggadua.com, localhost
relayhost = smtp.telkom.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.1.0/24
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth-client
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sender_restrictions = reject_unknown_sender_domain
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
#smtpd_tls_auth_only = yes
smtpd_tls_auth_only = no
tls_random_source = dev:/dev/urandom
inet_protocols = all
4. Konfigurasi Dovecot
vi /etc/dovecot/dovecot.conf
protocols = imap imaps pop3 pop3s
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_privileged_group = mail
protocol imap {
}
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}
protocol managesieve {
}
auth default {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
user = root
socket listen {
client {
path = /var/spool/postfix/private/auth-client
mode = 0660
user = postfix
group = postfix
}
}
!include_try /etc/dovecot/auth.d/*.auth
}
dict {
}
plugin {
}
!include_try /etc/dovecot/conf.d/*.conf
5. Setting Squirrelmail
cd /etc/squirrelmail
/usr/sbin/squirrelmail-configure
Command >> D
Kemudian Command >> dovecot
Kembali ke menu squirrelmail Setting General Options Command >> 4 Ganti Data Directory Command >> 1 Ganti dengan ../data/
6. Setting Web Server
vi /etc/apache2/apache2.conf
paling bawah tambahkan
Include /etc/squirrelmail/apache.conf
vi /etc/squirrelmail/apache.conf
di bawah tambahkan
<VirtualHost *:81>
ServerName mail.pasarpagimanggadua.com
DocumentRoot /usr/share/squirrelmail
<Directory "/usr/share/squirrelmail/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</Virtualhost>
Ganti baris ini
Alias /mail /usr/share/squirrelmail
Sehingga waktu panggil webmail di browser jadi 192.168.1.120/mail
vi /etc/apache2/sites-enabled/000-default
tambah paling bawah
<VirtualHost *:81>
ServerName mail.pasarpagimanggadua.com
DocumentRoot /usr/share/squirrelmail
<Directory "/usr/share/squirrelmail/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</Virtualhost>
7. Konfigurasi Domain
ARecord diisi dengan ip public / ip server redirect url
MX Record diisi dengan [mail.pasarpagimanggadua.com] ; [ip public]
8. Konfigurasi Modem
Setting di port forwarding redirect port 80 to ip server