Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using GNU Mailman with Postfix to run a mailing list, and would like to monitor the delivery of outgoing mail, that is: for each mail sent from the list, check whether a 250 (OK) message was answered, and if not, report back to me.

For now, I'm doing a quick-and-dirty:

# cat /var/log/syslog | grep "smtp.*to=.*" | grep -v 250

Is there a clean way to monitor smtpd's output?

share|improve this question
    
Surely this must be a useless use of cat? At the very least you can do grep "smtp.*to=.*" /var/log/syslog | grep -v 250 –  Michael Kjörling Jan 21 at 13:36

2 Answers 2

up vote 1 down vote accepted

There is no way to monitor the sent mails in a clean way. You can only grep the details from the maillog of postfix.

Hear i can give you some explanations,

log='logfile of postfix' grep "status=sent" $log | egrep -ve 'postfix/(cleanup|pickup|master|qmgr|smtpd|local|pipe)

And also avoid the logs for dkim etc. If you need the count of mails then use the wc -l

share|improve this answer

How about:

multitail -eX "smtp.*to=<(.*)>.*sent.*250" './bin/received' -f /var/log/maillog

./bin/received is a shell script that gets the destination email address as a parameter and does something with it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.