tags:

views:

379

answers:

2

I accidently delelte /var/log/maillog, after I recreate it, but postfix wouldn't write any mail log into it anymore, I restart postfix, no help, anyone know why?

A: 

You will need to check the permissions and the file ownership, such that the syslog process can write to it.

man chmod
man chown
Brian Agnew
+3  A: 

maillog is usually managed by syslog, not postfix directly.

Restarting syslog should be enough, as to permissions just ensure they're similar to other files in /var/log and that should be enough.

On my debian system all logs are owned either root:adm or root:root, are usually mode 644 or 640 (u+rw, g+r, optional o+r)

And on debian/ubuntu to restart syslog: /etc/init.d/sysklogd restart

On RHEL/CentOS: service syslog restart

LapTop006
You can also restore contents of your deleted file if you did not restart syslogd yet. Got to /proc/`cat /var/run/syslogd.pid`/fd/ and check which descriptor has contents of maillog, copy its contents and then restart syslog.
Tometzky