• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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

rolo@

Basic Pleskian
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!
 
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...
 
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.
 
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
 
Back
Top