I've enabled the -v option on master.cf; but still my /var/log/maillog is almost empty. I'm having a problem i have my hard times debugging without any log.
5 Answers
is your syslogd setup to log stuff to maillog? like following:
[alexus@wcmisdlin02 ~]$ grep ^mail /etc/rsyslog.conf
mail.* -/var/log/maillog
[alexus@wcmisdlin02 ~]$
also make sure it's running
[alexus@wcmisdlin02 ~]$ sudo service rsyslog status
rsyslogd (pid 1356) is running...
[alexus@wcmisdlin02 ~]$
-
1
-
-
Where does this dash/hyphen come from? Is that there by default? I found this the other day and was convinced that I had been hacked and the hacker put the dash there to turn off my Postfix maillog. Why is the dash there? Feb 5, 2021 at 20:33
I had the same log problem on CentOS-7 with postfix but also with any logger command like: 'logger System testing my log'
Checking deeper, I found out that Rsyslogd was not listening anymore on /dev/log socket !!!! This can be checked with 'lsof /dev/log'
I fixed the problem, by forcing /dev/log in /etc/rsyslogd.conf.
-- after $ModLoad imuxsock
-- add this next line input(type="imuxsock" HostName="localhost" Socket="/dev/log")
This will force usage of /dev/log, which after my last update was no more the default. This is probably a bug. I have the problem with rsyslog-7.4.7-7.el7_0.x86_64 or
The problem is that the default Centos 8 install no longer includes rsyslog. The configuration file (/etc/rsyslog.conf) is there, but not the program.
dnf install rsyslog
systemctl start rsyslog
systemctl enable rsyslog
worked for me.
-
CentOS 7 and 8 log to the systemd journal; rsyslog now copies those logs from the journal to the traditional locations in
/var/log
. It is possible to do many other useful things by working directly with the journal, so it's worth looking at that first if you have any interesting needs (e.g. a centralized log server, more complex searching, etc). Dec 7, 2020 at 15:57
You can solve this issue with delete maillog file and restart rsyslog service:
cd /var/log/
rm -f maillog
service rsyslog restart
service postfix restart
I was having a similiar issue after moving from centos 7 to a new RHEL 8 install. Rsyslog was writing to maillog intermittently. Watching journalctl (journalctl -u postfix -f
) showed that most outgoing emails were not being logged. This meant I was missing records when a customer complained about not receiving a receipt. I tried removing the - before /var/log/maillog in rsyslog.conf but this did not solve the issue.
Since I really need an easy way to locate issues with outgoing email deliveries, I just went ahead and set postfix mail log directly
postfix stop
postconf maillog_file=/var/log/maillog
postfix start