mail-count script

Discussion in 'Tutorials and Guides' started by sleddog, Oct 21, 2014.

  1. sleddog

    sleddog New Member

    128
    84
    May 16, 2013
    This is something I've been working on lately, wondering if anyone is interested.

    It's called mail-count, and consists of a bash script that examines a server's mail log periodically via cron, and a PHP script to show the results.

    It's focused solely on numbers -- the number of outgoing SMTP deliveries. It can help you keep tabs on the mail your server is sending....
     

    sYCIdQX.png
     
  2. DomainBop

    DomainBop Dormant VPSB Pathogen

    2,260
    2,190
    Oct 11, 2013
    Useful script.  So the reports could be emailed when the cron is run...
     
  3. agentmishra

    agentmishra New Member

    24
    0
    Jul 20, 2014
    and how do we get to use this script...
     
  4. HalfEatenPie

    HalfEatenPie The Irrational One Retired Staff

    2,890
    1,385
    Mar 25, 2013
    HalfEatenPie
    This reminds me of a feature on Zimbra.  Get daily mail notifications on the previous day's stats (how many incoming, how many sent out, etc.)

    Basically... THIS IS REALLY USEFUL :)
     
  5. sleddog

    sleddog New Member

    128
    84
    May 16, 2013
    The cron script gives you two counters to work with: number of mails sent this run (e.g. 15 minutes), and total mails sent today. You can use either to configure actions, e.g. send an alert, insert an iptables rule, shutdown the mailserver... by default the script simply logs numbers and takes no action.

    I'll put it up somewhere in a few days.

    It only tracks outgoing mail, to help an admin understand how his/her server is sending mail - with the objective of curtailing abuse.
     
    HalfEatenPie likes this.
  6. ssgsunny

    ssgsunny Member

    57
    0
    Jul 18, 2014
    Good script is very useful.
     
  7. sleddog

    sleddog New Member

    128
    84
    May 16, 2013
  8. HalfEatenPie

    HalfEatenPie The Irrational One Retired Staff

    2,890
    1,385
    Mar 25, 2013
    HalfEatenPie
    Interesting!

    Thanks bud will take a look at it!  
     
  9. ndelaespada

    ndelaespada Member Verified Provider

    82
    8
    Aug 29, 2013
    very useful script
     
  10. Epidrive

    Epidrive New Member Verified Provider

    277
    44
    May 16, 2013
    Effective for monitoring spamming activities. Thanks for the share! :)
     
  11. IntegralHost

    IntegralHost New Member Verified Provider

    26
    2
    Nov 15, 2014
    Suggestion: It would be great if you can include the count of mails generated from every email accounts
     
  12. IntegralHost

    IntegralHost New Member Verified Provider

    26
    2
    Nov 15, 2014
    Also the possible spam script location, so that users can track the attacker easily.

    Anyway Good Job  
     
  13. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,710
    May 13, 2013
    Yeah I see a need for this.

    Would be nice to be able to calculate inbound and outbound.

    Was just talking about this need for someone that is a high volume pressure cooker environment where the bosses are blissfully unaware of the volume of things.
     
  14. Raymii

    Raymii New Member

    114
    43
    Jun 22, 2013
  15. Mahadev

    Mahadev New Member

    1
    0
    Jan 11, 2018
    1
    I'm wondering, where is the script?
     
  16. Lee

    Lee Retired Staff Retired Staff Verified Provider

    410
    204
    Mar 25, 2013