• 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.

Total mails in/out

R

redprive

Guest
Hi,

I would like to know how many mails arrives to my server everyday and how many mails are sent from my server.

Anybody could say me how can I know it?

Thank you very much
 
It's all in the logs ;)

Qmail is telling you everything you need.

Try these lines on your shell:
echo "Mails to local: "`cat /var/log/mail | egrep "starting delivery.*to local" | wc -l`
echo "Mails to remote: "`cat /var/log/mail | egrep "starting delivery.*to remote" | wc -l`

It can also be combined like this:
echo "Mails to local: "`cat /var/log/mail | egrep "starting delivery.*to local" | wc -l` \ &&
echo "Mails to remote: "`cat /var/log/mail | egrep "starting delivery.*to remote" | wc -l`

There might be a better solution as this is just a quick lookup. These are just searching for the strings "starting delivery to local" and "starting delivery to remote". The ".*" just stands for any text between.

wc -l is just counting the lines.

The disadvantage of this is that the whole log is counted 2 times, and the log is still appended by your mail-system.

But to see how much traffic you got - this might help.

Quick and dirty, isn't it? :)
 
One question more please.

How I can filter results by day?

Thank you very much
 
it can be done only with APM (Advanced Perl Magick =):

cat /usr/local/psa/var/log/maillog | \
egrep "starting delivery.*to remote" | \
perl -F -a -lne '{$r{$F[0]}->[$F[1]]++}END{foreach$k(%r){@d=@{$r{$k}};for(my$i=1;$i<=$#d;$i++){printf "%.3s %2d %d\n", $k, $i, $d[$i]}}}'

Good luck.
 
Back
Top