monitoring outgoing emails

Discussion in 'Server Operation' started by Poliman, Mar 29, 2018.

  1. Poliman

    Poliman Member

    Hi people. Do you know is there any tool/plugin for monitoring outgoing emails from server with postfix? Maybe postfix has this feature? I am looking for information which linux user sends email, how many of them and how often for example, per hour, day. That would be perfect plugin.
     
  2. Taleman

    Taleman Active Member HowtoForge Supporter

  3. Poliman

    Poliman Member

    This is really nice piece of code but I have to wrap it by some bash script. I need sending emails. ;)
     
  4. Taleman

    Taleman Active Member HowtoForge Supporter

    No need to wrap in bash script. I added this to root crontab:
    Code:
    #Taleman, pflogsum
    10 0 * * *  /usr/sbin/pflogsumm -d yesterday var/log/mail.log 2>&1 | /usr/bin/mailx -s "`uname -n` päivän postitilastot pflogsum" [email protected]
    The # is comment and one line, rest is all on one line.
     
  5. Poliman

    Poliman Member

    I did:
    Code:
    0 0 * * * `cat /var/log/mail.log | /root/pflogsumm-1.1.3/pflogsumm.pl | mail -s Report [email protected]`
    I have few questions:
    1. Is it possible to add some "content" to this mail?
    2. Is it required this redirection "2>&1"? My line does not generate any output to console.
    3.What is "-d yesterday"?
    I think I still need script, because I need fetch some data from generated report. Exactly how many emails send particular mail user per day.
     
    Last edited: Apr 3, 2018

Share This Page