Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can't send out emails,

need to look into the logs,

but where is the log?

share|improve this question
1  
Care to let us know what OS you're using? As others have noted below, on most systems it's /var/log/maillog. On Solaris it's /var/adm/maillog. On Debian/Ubuntu it's /var/log/mail.log (note the dot). –  Gerald Combs Aug 27 '09 at 16:40
    
tail -f /var/log/maillog –  Thomas Denton Aug 28 '09 at 14:50
add comment

migrated from stackoverflow.com Aug 27 '09 at 16:05

This question came from our site for professional and enthusiast programmers.

5 Answers

check /var/log/maillog or /var/log/messages if you're on *nix

Also, if nothing is going out you may want to check your firewall as follows (be sure to do this as root):

[root@web01 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ms-v-worlds 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:imaps 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:imap 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:pop3 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:smtp 
           tcp  --  anywhere             anywhere            tcp dpt:ssh state NEW recent: SET name: SSH side: source 
DROP       tcp  --  anywhere             anywhere            tcp dpt:ssh state NEW recent: UPDATE seconds: 60 hit_count: 8 TTL-Match name: SSH side: source 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain RH-Firewall-1-INPUT (0 references)
target     prot opt source               destination         
[root@xxxx ~]# 
share|improve this answer
1  
Or, on *nix, look in /etc/syslog.conf to see where else those log messages might be getting sent to. –  Liudvikas Bukys Aug 27 '09 at 16:34
add comment

Where are the logs?

The default location depends on your linux/unix system, but the most common places are

  • /var/log/maillog
  • /var/log/mail.log
  • /var/adm/maillog
  • /var/adm/syslog/mail.log

If it's not there, look up /etc/syslog.conf. You should see something like this

mail.*         -/var/log/maillog

sendmail writes logs to the mail facility of syslog. Therefore, which file it gets written to depends on how syslog was configured.

If you system uses syslog-ng (instead of the more "traditional" syslog), then you'll have to look up your syslog-ng.conf file. You'll should something like this:

# This files are the log come from the mail subsystem.
#
destination mail     { file("/var/log/mail.log"); };
destination maillog  { file("/var/log/maillog"); };
destination mailinfo { file("/var/log/mail.info"); };
destination mailwarn { file("/var/log/mail.warn"); };
destination mailerr  { file("/var/log/mail.err"); };

Unable to send out emails?

One of the most common reason I've seen for a freshly installed sendmail not being able to send out emails is the DAEMON_OPTIONS being set to listen only on 127.0.0.1

See /etc/mail/sendmail.mc

dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

If that's your case, remove the "Addr=127.0.0.1" part, rebuild your conf file and you're good to go!

DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

[root@server]$ m4 sendmail.mc > /etc/sendmail.cf
[root@server]$/etc/init.d/sendmail restart

If you've been making changes to /etc/sendmail.cf manually thus far (instead of the *.m4 file) you can make similar changes in /etc/sendmail.cf. The offending line will look like this:

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

Change it to:

O DaemonPortOptions=Port=smtp, Name=MTA
share|improve this answer
    
tail -f /var/log/maillog –  Thomas Denton Aug 28 '09 at 14:49
add comment

Try looking at /var/log/mail.info or /var/log/mail.err

share|improve this answer
add comment
/var/log/maillog
share|improve this answer
add comment

also check /var/spool/mqueue for current cached outgoing mail

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.