set q=mx
example
to ensure the mail server is ready
add MX to example.com.zone and 192.168.1.zone
rndc reload
ensure port25 is open (smtp) in both send and reciepient.
nmap localhost to check
install postfix and sendmail to ensure the port25 is open
yum install system-switch-mail
sendmail.mc must be dnl 127.0.0.1
un dnl to enable ipv4 and ipv6 to sendmail
m4 sendmail.mc > sendmail.cf
vi /etc/mail/local-host-name
server.example.com
vi /etc/mail/access
192.168.1. relay
vi /etc/aliases
newaliase
make -C /etc/mail
send to mail server will work while send to account on other machine on the lan is not working
such as mail xing@server.example.com ok
mail xing@client.example.com no mail will be received
------------------
test email
[root@station15 mail]# telnet 192.168.0.6 25
Trying 192.168.0.6...
Connected to station6.example.com (192.168.0.6).
Escape character is '^]'.
220 station6.example.com ESMTP Sendmail 8.13.8/8.13.8; Sun, 31 Oct 2010 16:41:38 +0800
helo station6
250 station6.example.com Hello station15.example.com [192.168.0.15], pleased to meet you
mail from:root@station6.example.com
250 2.1.0 root@station6.example.com... Sender ok
rcpt to:root@station15.example.com
250 2.1.5 root@station15.example.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
this is test.
.
250 2.0.0 o9V8fcLC006097 Message accepted for delivery
quit
221 2.0.0 station6.example.com closing connection
Connection closed by foreign host.
------
check if the email received.
/var/spool/mail/root
-------