« Setting up Amazon EC2 Virtual Machine | Main | Configuring auth_pam »
Sendmail Configuration Stuff
By mkivela | May 7, 2008
If you can’t switch to Postfix…
Configuring a client Linux server to relay via a host Linux server:
1) Does IP tables accept us?
# Accept SMTP from 192.168.2.2:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 25 -s 192.168.2.2 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT –reject-with icmp-host-prohibited
# If you want to log rejections instead, comment out the line above and uncomment this one. It will log to /var/log/messages
#-A RH-Firewall-1-INPUT -j LOG –log-prefix “FIREWALL:INPUT “
2) What IP address is smtp listening on?
netstat -an | grep 25
Which may reveal something like:
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
Which means SMTP is only listening on 127.0.0.1…need to make it listen on it’s private IP, too.
To add the private address to the loopback, add the following to /etc/mail/sendmail.mc:
DAEMON_OPTIONS(`Addr=192.168.10.215′)dnl
DAEMON_OPTIONS(`Addr=127.0.0.1′)dnl
You *may* need to yum or apt-get these packages:
yum install sendmail-cf.i386
yum install sendmail-devel.i386
Then
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
/etc/init.d/sendmail restart
3) Configure client (2.2) to use the host (10.215):
define(`SMART_HOST’, `hostname’)dnl
In this case, hostname resolves to 192.168.10.215
Add MAILER(smtp)
MAILER(smtp) comes before MAILER(procmail). Be careful if MAILER(local) is defined under a FEATURE to use procmail
Then put MAILER(smtp) ahead of it.
Use the m4 procecure to make the sendmail.cf
4) Configure server to accept the client:
DOMAIN(clientname)dnl
And make sure the clientname can resolve (i.e. hosts file if necessary).
Use the m4 procecure to make the sendmail.cf
5) Testing by Telnet:
http://www.yuki-onna.co.uk/email/smtp.html
Is a nice set of directions.
Topics: Uncategorized | No Comments »
Comments
You must be logged in to post a comment.