Set network ke yang bisa internetan.
Setel /etc/apt/sources.list agar bisa update, misal ke alamat old-releases.ubuntu.com. untuk ubuntu 12.04:
deb http://old-releases.ubuntu.com/ubuntu/ precise main restricted multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted multiverse universe
jalankan satu satu :
apt-get update
apt-get upgrade
apt-get install ssh apache2 php5
apt-get install postfix
Perhatikan setelan dari /etc/postfix/main.cf terutama untuk (asumsi nama domain adalah bagus.com), dengan network lokalnya 192.168.xxx.xxx:
mydomain = bagus.com
myhostname = mail.bagus.com
myorigin = bagus.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost, bagus.com
mynetworks = 127.0.0.0/8, 192.168.0.0/16
smtpd_sasl_exceptions_networks = $mynetworks
relay_domains = $mydestination
header_checks = regexp:/etc/postfix/header_checks
/^Subject: .*been hacked/ DISCARD 550 User unknown/^From: .*SureVoIP/ DISCARD 550 User unknown
apt-get install dovecot-core dovecot-imapd dovecot-pop3d
disable_plaintext_auth = noauth_mechanisms = plain login
di file /etc/dovecot/conf.d/10-mail.conf boleh pakai:
mail_location = mbox:~/mail:INBOX=/var/mail/%u
Jalankan perintah
squirrelmail-configure
Terutama untuk bagian server, pilih model dovecot untuk IMAP servernya. Lalu jalankan:
cp /etc/squirrelmail/apache.conf /etc/apache2/sites-available/squirrelmail.conf
a2ensite squirrelmail.conf
service apache2 reload
Jalankan squirrelmail lewat http://alamatnya/squirrelmail
Kalau misal migrasi, bisa copykan isi /etc/passwd dan /etc/shadow ke komputer yang baru, tapi editnya pakai vi .
Karena user baru nggak ada home, maka setel:
chmod 777 /home
chmod 777 /var/mail
kalau untuk forward port dari luar bisa pakai /etc/iptables.rules
# Generated by iptables-save v1.3.3 on Fri Nov 15 13:32:49 2013
*nat
:PREROUTING ACCEPT [428:47001]
:POSTROUTING ACCEPT [5:559]
:OUTPUT ACCEPT [5:559]
-A PREROUTING -i eth1 -p tcp -m tcp --dport 1110 -j REDIRECT --to-ports 110
-A PREROUTING -i eth1 -p tcp -m tcp --dport 3310 -j REDIRECT --to-ports 110
-A PREROUTING -i eth1:1 -p tcp -m tcp --dport 1110 -j REDIRECT --to-ports 110
-A PREROUTING -i eth1:1 -p tcp -m tcp --dport 3110 -j REDIRECT --to-ports 110
-A INPUT -s 80.94.95.204 -j DROP
-A INPUT -s 176.111.173.25 -j DROP
COMMIT
# Completed on Fri Nov 15 13:32:49 2013
Sumber:
https://www.alibabacloud.com/blog/how-to-setup-email-server-with-postfix%2C-dovecot%2C-directmail-and-squirrelmail-on-ubuntu-16-04-alibaba-ecs_594092