Use syslog instead of fprintf to log to a separate file from qmail-smtpd log