The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HOW: Find out how many emails sent to Yahoo email addresses?

Discussion in 'E-mail Discussions' started by SuperBaby, Jun 7, 2008.

  1. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    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??
     
  2. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    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
     
    mohit likes this.
  3. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    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
    >
     
  4. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    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
     
  5. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    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.

    Mike
     
  6. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    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
     
Loading...

Share This Page