This email is to record how I set up Bio.pe.kr as a backup mail server
of Bio.cc in case bio.cc fails to respond.
I had to set up sendmail configuration whenever Bio.pe.kr has been
reinstalled (any idea on running sendmail from /BiO?).
Firstly, you need to setup MX record from the DNS setting either by
DNS server or from the domain register service (e.g. godaddy for
bio.cc).
Currently, it looks like as shown below:
----
[ssgong@malory Samul]$ dig bio.cc mx
; <<>> DiG 9.3.4-P1 <<>> bio.cc mx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53838
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;bio.cc. IN MX
;; ANSWER SECTION:
bio.cc. 1777 IN MX 10 backupmail.bio.cc.
bio.cc. 1777 IN MX 0 mail.bio.cc.
----
'mail.bio.cc' is A record of Bio.cc and 'backupmail.bio.cc' is A
record of Bio.pe.kr.
Note that, mail server address should be a real A record, not CNAME.
Then, from the backup machine (Bio.pe.kr), tweak several sendmail
configurations.
----
[neobio@cyrah mail]$ more local-host-names
# local-host-names - include all aliases for your machine here.
bio.pe.kr
backupmail.bio.cc
mail.bio.pe.kr
mail.bio.cc
bio.cc
----
[neobio@cyrah mail]$ more access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
bio.cc RELAY
mail.bio.cc RELAY
backupmail.bio.cc RELAY
----
Dont forget 'makemap hash /etc/mail/access.db < /etc/mail/access'
whenever you changed 'access' file.
For e-mail aliases and forwarding stuff:
----
[neobio@cyrah mail]$ tail /etc/aliases
ssgong: neobio
sung: neobio
neobio: gong.s...@gmail.com
j: jong...@yahoo.com
jong: jong...@yahoo.com
dmb: dan.b...@gmail.com
seminlee: semi...@gmail.com
----
Run 'newaliases' if you have modified '/etc/aliases'
Then, restart sendmail: sudo /etc/init.d/sendmail restart
For more info:
1. http://www.linuxselfhelp.com/quick/sendmail.html
2. http://www.linuxjournal.com/article/2469