I would like to find out how, approximately, many emails are sent to xxx@yahoo.xxx addresses on per day or per week basis. How can I do so??
I would like to find out how, approximately, many emails are sent to xxx@yahoo.xxx addresses on per day or per week basis. How can I do so??
SuperBaby
This is really off the cuff. There are more efficient ways. But try this:
grep 'yahoo\.com ' /var/log/exim_mainlog|grep '=>'|wc
That'll tell you how many were sent over the course of your current exim_mainlog (which could be many days). If you want to see, for instance, on 6-4-2008 then do:
grep 'yahoo\.com ' /var/log/exim_mainlog|grep '=>'|grep '2008-06-04|wc
The space at the end of 'yahoo\.com ' makes sure it doesn't count emails to yahoo.com.hk and other non-US Yahoo.
Piping those results to wc (word count) via |wc will give you the number sent, at least a very good approximation.
Mike
I am getting this. What do the numbers mean?
# grep 'yahoo\.com ' /var/log/exim_mainlog|grep '=>'|wc
125 1152 16541
# grep 'yahoo\.com' /var/log/exim_mainlog|grep '=>'|wc <== without a white space after "yahoo.com"
127 1172 16856
On the other hand, I got only " > " for this:
# grep 'yahoo\.com' /var/log/exim_mainlog|grep '=>'|grep '2008-06-04|wc
>
SuperBaby
The first number is the line count - which is going to give you the approximation you want. There are line counts, word counts and character counts and some other things.
If you just want it to display what you're looking for, pipe it to wc -l instead of just wc
wc -l will display the line count (# of lines that matched)
Mike
The difference between the two indicates [most likely] that you have 2 emails that were sent to @yahoo.com.??? addresses - like yahoo.com.hk or something like that. When you put the whitespace after it, it makes sure to only give you the values for emails sent specifically to @yahoo.com addresses.
That's because you don't have an ending single-quote after 2008-06-04 - If you add the ending ' then it'll work.On the other hand, I got only " > " for this:
# grep 'yahoo\.com' /var/log/exim_mainlog|grep '=>'|grep '2008-06-04|wc
>
Mike
I use configserver's mailscanner package. Part of that is mailwatch, which is perfect for monitoring this kind of stuff. I don't know much about using mailwatch as a stand-alone, but it may be of interest to you.
mailwatch.sourceforge.net