<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[OpenVPN Server Notification on Connect]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I'm trying to configure an email on connect to the pfsense openvpn server. I searched and came across a post suggesting to modify the file: /usr/local/sbin/openvpn.attributes.sh in the "client-connect" sections. I put some echos in there for output in a file, but I see nothing once a connection is established. Seems like the script is not running, but could this be only for the OpenVPN client connections and not server connections?</p>
<p dir="auto">Edit: I may have my answer here I guess: https://forum.pfsense.org/index.php?topic=95947.0</p>
]]></description><link>https://forum.netgate.com/topic/118401/openvpn-server-notification-on-connect</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 05:50:17 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/118401.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 23 Jul 2017 21:01:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to OpenVPN Server Notification on Connect on Tue, 25 Jul 2017 06:47:27 GMT]]></title><description><![CDATA[<p dir="auto">You can use up/down scripts:<br />
Add to custom server options:</p>
<pre><code>script-security 3 system;
client-connect /usr/local/sbin/up.sh;
client-disconnect /usr/local/sbin/down.sh;
</code></pre>
<p dir="auto">up.sh:</p>
<pre><code>#!/bin/sh

/full/path/to/your/console/email/app
</code></pre>
<p dir="auto">down.sh:</p>
<pre><code>#!/bin/sh

/full/path/to/your/console/email/app
</code></pre>
<p dir="auto">mailx example:</p>
<pre><code>echo "Client $common_name connected to $HOSTNAME" | mailx -r "your@mail.com" -s "Client $common_name connected to $HOSTNAME from $trusted_ip" -S smtp="your.smtp.com:25" -S smtp-auth=login -S smtp-auth-user="usr@smtp.com" -S smtp-auth-password="password" touser@mail.com &gt; /dev/null
</code></pre>
<p dir="auto">OpenVPN vars that you can use:<br />
$common_name<br />
$HOSTNAME<br />
$ifconfig_local<br />
$ifconfig_pool_remote_ip<br />
$untrusted_ip<br />
$trusted_ip<br />
$dev</p>
]]></description><link>https://forum.netgate.com/post/713097</link><guid isPermaLink="true">https://forum.netgate.com/post/713097</guid><dc:creator><![CDATA[xl]]></dc:creator><pubDate>Tue, 25 Jul 2017 06:47:27 GMT</pubDate></item></channel></rss>