Email access reports

When configured, the users can receive weekly, monthly and yearly reports about their email access. The reports can be send in plain text, HTML, or both, which is the default option if nothing specified.

  • A weekly report is sent every Sunday at midnight, containing the analysis of the previous week.
  • A monthly report is sent the first day of every month, containing the analysis of the previous month.
  • A yearly report is sent the first day of every year, containing the analysis of the previous year.

The report can contains the following sections:

  • Connections per country, if you are travelling.
  • Connections per ISP (Internet Service Provider).
  • Warned and denied connections.
  • Client statistics (Roundcube / SOGo / IMAP)
  • Statistics per hour of the day

Note

This functionality requires the activation of access check option. See the access monitoring page for more details.

Users selection

By default, only the postmaster and the users specified will receive access reports. This is done in the users section:

users:
  ...
- uid: leena
  cn: Leena Courtney Makhoul
  first_name: Leena
  last_name: Makhoul
  mail: leena@official.com
  access_report:
    periods: [ 'week', 'month', 'year' ]
    format: 'text'

The format option can be ‘text’, ‘html’ or ‘text,html’ or nothing for both.

Then, run the appropriate playbook:

cd install
ansible-playbook -i ../config/hosts.yml playbooks/access-report.yml

Note

If you remove the option, and runs the playbook again, the cron jobs will be removed.

Report example in text

Report By ISP
================================================================================
| ISP                     | Country          | From       | Until      | Count |
|-------------------------+------------------+------------+------------+-------|
|        UK Broadband LTE |   United Kingdom | 05 (14:03) | 27 (16:10) |  3131 |
|                  H3G UK |   United Kingdom | 01 (08:23) | 29 (16:21) |  2402 |
|                   LDCOM |           France | 01 (06:23) | 01 (10:28) |   148 |
|         Free Mobile SAS |           France | 09 (11:59) | 10 (16:54) |   141 |
|             Orange S.A. |           France | 01 (12:24) | 01 (12:26) |    48 |
|             EXPONENTIAL |   United Kingdom | 04 (12:51) | 23 (12:08) |    19 |
|             Free Mobile |           France | 26 (07:06) | 26 (07:06) |     1 |
================================================================================


Report by Country
================================================================================
| Country                                    | From       | Until      | Count |
|--------------------------------------------+------------+------------+-------|
|                             United Kingdom | 01 (08:23) | 30 (16:51) |  5654 |
|                                     France | 01 (06:23) | 26 (07:06) |   338 |
================================================================================


Report by Source
================================================================================
| Source                                     | From       | Until      | Count |
|--------------------------------------------+------------+------------+-------|
|                                       imap | 01 (06:23) | 30 (18:38) | 23278 |
|                                  Roundcube | 03 (18:04) | 30 (05:12) |    75 |
|                                       SOGo | 08 (10:06) | 13 (11:48) |     4 |
================================================================================


Report by Hour
================================================================================
|                                 ::                                           |
|                           ::    ::                                           |
|                           ::    ::          ::    ::                         |
|                           ::    ::    ::    ::    ::                         |
|                           ::    ::    ::    ::    ::                         |
|                           ::    ::    ::    ::    ::                         |
|                           ::    ::    ::    ::    ::                         |
|                           ::    ::    ::    ::    ::                         |
|                     ::    ::    ::    ::    ::    ::          ::             |
|                     ::    ::    ::    ::    ::    ::       :: ::             |
|                     ::    ::    ::    ::    ::    ::       :: ::             |
|                     ::    ::    ::    ::    ::    ::    :: :: ::             |
|                  :: ::    ::    ::    ::    ::    ::    :: :: ::             |
|                  :: ::    ::    ::    ::    :: :: :: :: :: :: ::             |
|                  :: ::    ::    :: :: :: :: :: :: :: :: :: :: ::             |
|                  :: :: :: ::    :: :: :: :: :: :: :: :: :: :: ::             |
|                  :: :: :: ::    :: :: :: :: :: :: :: :: :: :: ::             |
|                  :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::             |
|                  :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::          |
|                  :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::          |
|------------------------------------------------------------------------------|
|   00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23    |
================================================================================

Report example in HTML

Report By ISP
ISP Country From Until Count
UK Broadband LTE United Kingdom 05 (14:03) 27 (16:10) 3131
H3G UK United Kingdom 01 (08:23) 29 (16:21) 2402
LDCOM France 01 (06:23) 01 (10:28) 148
Free Mobile SAS France 09 (11:59) 10 (16:54) 141
Orange S.A. France 01 (12:24) 01 (12:26) 48
EXPONENTIAL United Kingdom 04 (12:51) 23 (12:08) 19
Free Mobile France 26 (07:06) 26 (07:06) 1
Report By Country
Country From Until Count
United Kingdom 01 (08:23) 30 (16:51) 5654
France 01 (06:23) 26 (07:06) 338
Report By Source
Source From Until Count
imap 01 (06:23) 30 (18:38) 23278
Roundcube 03 (18:04) 30 (05:12) 75
SOGo 08 (10:06) 13 (11:48) 4
Report By Hour
000102030405060708091011121314151617181920212223