1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

How do I count outoing emails per domain? (just a simple list)

Discussion in 'Plesk for Linux - 8.x and Older' started by rolo@, Dec 7, 2007.

  1. rolo@

    rolo@ Basic Pleskian

    23
    57%
    Joined:
    Dec 25, 2005
    Messages:
    35
    Likes Received:
    0
    All I need is something that will tell me how many emails each particular domain has sent. It doesn't even have to be very accurate, just ballpark numbers for a particular log file or even better for a particular period of time.

    domain1.com 200
    domain2.com 39
    domain3.com 489
    etc...


    Thanks!
     
  2. Hedgren

    Hedgren Guest

    0
     
    Nice idea, but, truly, it is technically quite difficult to implement this even in the newest Plesk versions. You see, when a mail user passes SMTP authorisation on the server to send an email, a record type 'smtp_auth' is added into the Plesk mail log (/usr/local/psa/var/log/maillog) to log this event. But the main problem is that each single 'smtp_auth' maybe followed by numerous mails having been sent by this user which is quite hard to trace, needless to say how messy this log looks when there dozens of well-functioning mailboxes on the server... I've been thinking about calculating the number of mails in the Qmail queues (/var/qmail/queue/*), however, it wouldn't work either: Qmail is so damn fast that you would hardly have a chance to parse\calculate the mail files in the queues... I wish there was such statistical feature on the domains, in a way like http://domain.com/plesk-stat/webstat/, say, http://domain.com/plesk-stat/mailstat...
     
  3. rolo@

    rolo@ Basic Pleskian

    23
    57%
    Joined:
    Dec 25, 2005
    Messages:
    35
    Likes Received:
    0
    Such a shame... And to think that with a simple string appended to each log entry this would be easily done...

    Anyways, thanks for the input.
     
  4. mattbmac

    mattbmac Guest

    0
     
    Check out this plesk maillog shell script for getting the count you're looking for. You can always remove the to or from in the regexp to see only a count of messages sent or received per domain.

    -Matt MacDougall
     
Loading...