The back story here is that I would like to start using an SMTP service to start sending my email (currently sent though sendmail running locally on the server), but in order to get a good idea of what this will cost I need to understand how many messages I am sending.
The best way I can think of to get a round figure is the sendmail logs- but I'm not sure exactly how to do this.
I do know that a single message usually (if not always) has multiple lines- if I knew how they were associated together I could write something to parse the log and count uniques (????).
Since I don't know what that is I am trying to figure out how to identify 1 record for each actual request and count those...
sudo cat maillog.* | grep 'mailer=relay' | grep '@' | wc
This amounts to about about 1/7th of the total lines in the logs, which conversely suggests that a message has an average of 7 records.
Is this a reasonable way to do this? Is there a better way?
Thanks as always!