15

I cannot sent mail by using Postfix (SMTP) on Ubuntu Server 11.04. So, there must be some errors, But where to see the error message?

3 Answers 3

18

Have you already stumbled upon this comprehensive Postfix Debugging Howto? There's the following notice concerning logging:

Postfix logs all failed and successful deliveries to a logfile. The file is usually called /var/log/maillog or /var/log/mail; the exact pathname is defined in the /etc/syslog.conf file.

(syslog.conf specifies where the mail-facility logs get written to, it's rather self-explaining when you look at it.)

5
  • I don't have this file, I'm using ubuntu server 11.0
    – lovespring
    Commented Oct 27, 2011 at 14:44
  • No /etc/syslog.conf? Sorry, I don't know much about Ubuntu. Forget this then, how about /var/log/mail or similar? According to this, there should be a /var/log/mail.err log, I suppose. You'll find some Ubuntu-specific Postfix debugging hints on that page, too.
    – sr_
    Commented Oct 27, 2011 at 14:51
  • 1
    /var/log/mail.err this is it! Are all unix log file puted in this /var/log dir? Is it a 'must be'?
    – lovespring
    Commented Oct 27, 2011 at 15:23
  • For system logs this is mostly true, possibly varying for different distributions (and of course user-space programs, e.g. ~/.xsession-errors on some distributions).
    – sr_
    Commented Oct 27, 2011 at 18:12
  • On ubuntu, the syslogger is rsyslog. The configuration file is /etc/rsyslog.conf and in the /etc/rsyslog.d/ directory. In your case, /etc/rsyslog.d/50-default.conf say 'mail.* -/var/log/mail.log' and 'mail.err /var/log/mail.err'
    – Dom
    Commented Jun 22, 2012 at 9:44
6

log files for postfix can be

/var/log/mail.log
/var/log/mail.err
/var/log/mail.info

and also you can grep logs for /var/log/syslog file.

1
  • I found mine in /usr/local/psa/var/log/maillog, of all places. (CentOS server managed by Plesk.)
    – TRiG
    Commented Apr 29, 2014 at 10:50
0

I was not able to locate logs anywhere and I was running Ubuntu 20.04 LTS, turns out this was a permission issue for some strange reason. the problem was with the syslog permission. The following helped me to resolve it:

sudo chown syslog:adm /var/log
sudo chmod 0775 /var/log

sudo service rsyslog restart
sudo service postfix restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .