Skip to content

Commit

Permalink
vpn: add OpenVPN mail notification (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Mar 11, 2022
1 parent 6ef7c1f commit 9cf8f1b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions administrator-manual/en/base_system2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ If the server can't directly deliver those mails, the administrator can configur
a SMTP relay.
When the smarthost is enabled, all mail messages will be delivered to the configured server.

.. _email-notification-section:

Email notifications
--------------------

Expand Down
34 changes: 34 additions & 0 deletions administrator-manual/en/vpn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,40 @@ Access statistics are available from the new Server Manager. For each user, stat
- time of disconnection
- transferred bytes

Mail notification
~~~~~~~~~~~~~~~~~

The server can send a mail notification each time a user connects to, or disconnects from, OpenVPN roadwarrior server.

Notification mails are English-only.
Sender address can be configured from :ref:`email-notification-section`.
This feature is disabled by default and can be enabled by command line.

To enable the feature use: ::

config setprop openvpn@host-to-net NotifyStatus enabled
config setprop openvpn@host-to-net NotifyAddresses user1@nethserver.org,user2@nethserver.org

The ``NotifyAddresses`` property can contain a comma-separated list of mail addresses.
Notifications are sent through local Postfix installation, so mail delivery can be inspected inside :file:`/var/log/maillog`.

Example of mail on user connect: ::

The user test1 established a VPN connection on Fri Mar 4 18:31:49 2022.

Public IP address: 1.2.3.4
Private IP address: 10.2.3.2

Example of mail on user disconnect: ::

The user test1 was disconnected from VPN server.

Duration: 17 seconds
Sent: 2410 bytes
Received: 4099 bytes



.. _ovpn_tunnel-section:

Tunnel (net2net)
Expand Down

0 comments on commit 9cf8f1b

Please sign in to comment.