Solved SpamC and Syslog

Hello,

I was reading in the spamc man page that if you want to send log messages to stderr, instead of syslog, you can use this:
Code:
-l
Send log messages to stderr, instead of to the syslog.

So, my presumption is that it logs to syslog by default. Since I'm newer to syslog, is my presumption that it would fall under /var/log/messages with this line:
Code:
*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err

regardless if it does or doesn't, I would like to break that out into its own log file to catch any error/exit codes from spamc.

Any ideas where to look, I'm google'd some already, but still looking.

Additionally, if I understand correctly the manpage, it will always exit 0 and pass the message unless you specify -x, which will log an exit code, and keep the message queued for retry however, is there a way with spamc/procmailrc to pass the message even if I use -x (and log the results with formail)

my goal:

determine if spamc is failing because a spamd is busy or the host is unavailable and log the results in the message header.
 
So, my presumption is that it logs to syslog by default. Since I'm newer to syslog, is my presumption that it would fall under /var/log/messages with this line:
Code:
*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err

regardless if it does or doesn't, I would like to break that out into its own log file to catch any error/exit codes from spamc.
You need to be able to tell spamc which facility to use (LOCAL0 is a good candidate), then you can separate LOCAL0 to a different logfile.
Unfortunately I didn't see an option for that in the spamc switches.

I noticed that spamd does have the switch
-s facility, --syslog=facility
so it seems odd the client doesn't.
 
Note that spamc(1) is the client which will utilize spamd. You can indeed send logs out through stderr (and only that because the scanned results are sent through stdout) but why would you want to do that? Just make sure you handle the logs from spamd separately and you should be all good.

(edit) overlooked your actual question:

If there's a problem contacting the host or such then you should find those error messages in your MTA logs, that will trigger spamc and should notice the error during the exit.
 
Thanks Everyone,

Sorry for the late response. Unless I misunderstand you ShelLuser, the exit code will always be 0 (to deliver) the message and if you do trap the exit codes, then if it runs into one, it will leave the message in the queue till it can reach it. Depending on the circumstance, this may or may not be great since people expect their email right away. I was hoping to be able to log the exit code and still send the email.

Maybe you are saying their should be an exit code either way in the log file, but that is not how I was understanding spamc's man page :(.
 
Due to the age, I think I am going to resolve this thread. Thanks for the help. I still have questions, but I think I will do some more research
 
Back
Top