Recently, I took a peek into the syslog, and to my surprise, it was brimming with messages from Fetchmail. It detailed the who, what, where, why, and how of every email being seen, loaded, and deleted. Intriguing, no doubt, but I wasn’t keen on cluttering up my syslog with this information.
Therefore, Fetchmail needed its own log, and here’s how I went about it: In /etc/fetchmailrc, I added the following lines to the beginning ot the file:
set no syslog
set logfile /var/log/fetchmail.log
Now, Fetchmail had its exclusive log file. However, it wasn’t enough; I wanted this log to rotate as well. So, I created a file called /etc/logrotate.d/fetchmail and populated it with the following:
/var/log/fetchmail.log {
weekly
create 0644 fetchmail adm
rotate 4
compress
delaycompress
}
Done! It might not seem overly complex, but I encountered some challenges before achieving the setup I desired. Hence, I decided to document it for future reference.