3

I am using Postfix mail server. How can I count number of E-mails sent from a single account in an hour?

1
  • it looks like you can do this with anvil
    – chicks
    Oct 27, 2016 at 13:56

2 Answers 2

0
# now=`date '+%b %d %H:%M'`
# prev=`date '+%b %d %H:%M' -d  "1 hour ago"`
# sed -n "/$prev/,/$now/p" /var/log/mail.log | egrep 'from.*someuser' | wc -l
2
  • 1
    We can't rely on "from" since it can be spoofed. Oct 28, 2016 at 3:28
  • You will need to mitigate spoofed mail at the MTA (spamassassin). Anything downstream (procmail, maildrop, etc) which could be of use is going to assume the envelope info is all legit. Oct 28, 2016 at 14:15
2

Give a look at pflogsumm

It can show a per-email-count sorted list of both sent and received email.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .