# Statistics mail server by Pflogsumm - Postfix

**URL:** https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768
**Category:** Discuss
**Tags:** english
**Created:** [November 6, 2017, 10:50pm UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768 "2017-11-06T22:50:27Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![petrus](https://forum.yunohost.org/user_avatar/forum.yunohost.org/petrus/32/407_2.png) [@petrus](https://forum.yunohost.org/u/petrus)
#### Post date: [November 6, 2017, 10:50pm UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/1 "2017-11-06T22:50:27Z")

</div>

Hey,  
There is a script called **pflogsumm** ( [http://jimsun.linxnet.com/postfix\_contrib.html](http://jimsun.linxnet.com/postfix_contrib.html) ) who is able **to collect everyday Postfix’s statistics**.  
Those stats can be sent to a mail address, to keep an eye on what is doing your mail server.  
I think It’s really useful and interesting, you can read it quickly if there’s a shit somewhere (soo many mails pending… waiting to deliver… relaying spam?.. etc.).

If I’m not wrong, only **cron** is needed to launch this **perl** script, to read a log generated by Postfix.  
May be this feature can be added to every admin who want to receive everyday stats from the server ? And I think it will be easy to integrate it to Yunohost ?  
I’ve got it running really fast on a RPi with ~50 mails/day

To see a report : 1st example found at random on the web : [https://calomel.org/pflogsumm.html](https://calomel.org/pflogsumm.html)

Thx for reading 😉  
I hope it can be interesting!!

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [November 9, 2017, 4:33am UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/2 "2017-11-09T04:33:40Z")

</div>

> [@petrus](#):
>
> I’ve got it running really fast on a RPi with ~50 mails/day

Can you give a brief detail on how you configured it?

---

<div class="post-metadata">

### Author: ![petrus](https://forum.yunohost.org/user_avatar/forum.yunohost.org/petrus/32/407_2.png) [@petrus](https://forum.yunohost.org/u/petrus)
#### Post date: [November 9, 2017, 10:18am UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/3 "2017-11-09T10:18:26Z")

</div>

Hey,  
I got some notes about… I hope it’s working with current linux version…

`apt-get install pflogsumm`  
(or it’s possible to wget the script from the website on my first message)

Everyday it will scan the mail server log + send a mail to a @mail address, just before 00:00  
as root :  
`crontab -e`  
Then add this to your crontab :

```
# STATS MAIL SERVER pflogsumm
59 23 * * * /usr/sbin/pflogsumm -u 5 -h 5 -d today /var/log/mail.log | mail -s "Postfix Report of `date`" yourmail@domain.tld

```

(the “`date`” variable will write the current day to the mail title)

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [November 11, 2017, 9:50am UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/4 "2017-11-11T09:50:30Z")

</div>

@petrus Thanks

---

<div class="post-metadata">

### Author: ![petrus](https://forum.yunohost.org/user_avatar/forum.yunohost.org/petrus/32/407_2.png) [@petrus](https://forum.yunohost.org/u/petrus)
#### Post date: [November 13, 2017, 9:35pm UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/5 "2017-11-13T21:35:58Z")

</div>

I got no Yunohost for the moment near me,  
so I hope it’s working for current Yunohost version (if everything is logged in the file /var/log/mail.log, it will be ok), and I’ll be glad if this little and quick tuto can help 😉

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [November 15, 2017, 10:22am UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/6 "2017-11-15T10:22:59Z")

</div>

@petrus Yes it works very well. Thanks for the tutorial.

---

<div class="post-metadata">

### Author: ![petrus](https://forum.yunohost.org/user_avatar/forum.yunohost.org/petrus/32/407_2.png) [@petrus](https://forum.yunohost.org/u/petrus)
#### Post date: [December 6, 2017, 9:13am UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/7 "2017-12-06T09:13:28Z")

</div>

Happy to read this 🙂  
I’ll try to set up a new server with Yunohost, and for sure I’ll try this!  
So I think it can be a nice feature to add as an option for server owners 😉 This option will activate this script and add the cron task!

---

<div class="post-metadata">

### Author: ![Jaxom99](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jaxom99/32/776_2.png) [@Jaxom99](https://forum.yunohost.org/u/Jaxom99)
#### Post date: [August 5, 2019, 7:10pm UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/8 "2019-08-05T19:10:30Z")

</div>

Finally decided to run it on my server. Thanks for the tip !

---

<div class="post-metadata">

### Author: ![petrus](https://forum.yunohost.org/user_avatar/forum.yunohost.org/petrus/32/407_2.png) [@petrus](https://forum.yunohost.org/u/petrus)
#### Post date: [August 9, 2019, 7:48am UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/9 "2019-08-09T07:48:37Z")

</div>

Yes, it’s fast and light on a personal server (running fine on a RPi 2), and useful for keeping an eye easilly on the mail server activity everyday 😉

---

<div class="post-metadata">

### Author: ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)
#### Post date: [January 18, 2023, 8:25pm UTC](https://forum.yunohost.org/t/statistics-mail-server-by-pflogsumm-postfix/3768/10 "2023-01-18T20:25:02Z")

</div>


