1

Topic: postfix not writing to /var/log/maillog because of truncating

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: CentOS 6.6
- Related log if you're reporting an issue:
====

Hi, yesterday I was trying to truncate postfix log files because I want to download it from production server to development server and analyze it.

I wrote a Perl script making use of 'move' command in File::Copy module and move /var/log/maillog to another file while postfix is still running. Then postfix didn't append /var/log/maillog at all. I also tried to touch a new /var/log/maillog but postfix didn't recognize this new file, even after restarting postfix service. But sending out emails still works fine.

So questions are:

1. Does anybody know how to make postfix still writing logs to /var/log/maillog in this case?

2. Somebody suggests using logrotate but I have never used this utility before, Could anybody confirm that logrotate could be used for my purpose and it did works for all iRedMail applications, i.e. postfix, devocat, etc?

Thanks.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: postfix not writing to /var/log/maillog because of truncating

That'll be due to permissions. Delete the file and then restart your Syslog Daemon

3

Re: postfix not writing to /var/log/maillog because of truncating

*) Restarting syslog service should fix your issue.
*) Logrotate is better for this job, check its manual page for more details (command 'man logrotate'). there's an option to force logrotate a log file (-f).