I can't send out emails,

need to look into the logs,

but where is the log?

  • 5
    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). Aug 27, 2009 at 16:40
  • 3
    tail -f /var/log/maillog Aug 28, 2009 at 14:50
  • 3
    +1 for the wonderful haiku Apr 11, 2020 at 18:49
  • 1
    @armadadrive just need to remove the "I" in the first line. But yes, great haiku :-D
    – osullic
    May 2, 2020 at 23:16
  • 1
    Note: If none of these paths work, or if you're using cPanel, you might be using Exim (a drop-in replacement for Sendmail). If so, your log may be at /var/log/exim/main.log.
    – rinogo
    Jun 12, 2020 at 22:51

7 Answers 7


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

See /etc/mail/sendmail.mc

dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 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=, Name=MTA')dnl

If that's your case, remove the "Addr=" 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=, Name=MTA

Change it to:

O DaemonPortOptions=Port=smtp, Name=MTA
  • 1
    tail -f /var/log/maillog Aug 28, 2009 at 14:49
  • 1
    I think, the key here is: "DaemonPortOptions=Port=smtp,Addr=, Name=MTA" in /etc/mail/sendmail.mc Very good tip. Saved my day, thanks
    – serfer2
    Jun 30, 2017 at 7:17
  • 1
    But why remove Having daemon to listen on public interface does not seem as most secure way to do. (I'd suggest to remove the whole "Unable to send out emails" part as it's not relevant to OP.) Aug 24, 2017 at 16:23
  • 1
    Being unable to send out emails seems relevant, as it's basically the topic behind the topic of the OP. At any rate, that info helped me get sendmail sending. In the process, I found that changing Addr to my machine's 192.168.x.x IP, so sendmail only listens on my IP, is sufficient to enable sending without enabling receipt from the world. May 7, 2021 at 17:16
  • on debian-WSL none of those files exist.
    – Jonathon
    Aug 30, 2023 at 3:04

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 ~]# 
  • 1
    Or, on *nix, look in /etc/syslog.conf to see where else those log messages might be getting sent to. Aug 27, 2009 at 16:34
  • i see no entry of smtp in iptables
    – Umair Ayub
    Feb 13, 2019 at 7:49

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


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


For fedora et al. journalctl _COMM=sendmail will show messages from sendmail.

I was directed to this answer via a search. /var/log/mail only contains a 'statistics' file on Fedora. And all other mentioned directories are non-existent.

journalctl is not intuitive enough if you don't know what parameter to use, ymmv. so I've posted this solution.


You can create your own log file

[admin@local ~]# killall sendmail
[admin@local ~]# touch /var/log/sendmail.log
[admin@local ~]# sendmail -bd -q15m >> /var/log/sendmail.log

and then

[admin@local ~]# tail -f /var/log/sendmail.log

451 4.0.0 /fake/path/sendmail.cf: line 0: cannot open: No such file or directory

You must log in to answer this question.