<?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[Solution to trigger email when user authenticates to Captive Portal]]></title><description><![CDATA[<p dir="auto">Use Case: I'm using a Captive Portal at my home for guests. I'd like to be notified via email when a guest authenticates through the Captive Portal. This will help me identify when an unexpected guest is authenticating and needs action/blocking.</p>
<p dir="auto">I don't see this functionality in the product. However, we're a creative bunch :) How would anyone suggest going about achieving this functionality?</p>
]]></description><link>https://forum.netgate.com/topic/187884/solution-to-trigger-email-when-user-authenticates-to-captive-portal</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Mar 2026 10:56:22 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/187884.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 May 2024 05:29:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Solution to trigger email when user authenticates to Captive Portal on Wed, 01 May 2024 17:26:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gertjan">@<bdi>Gertjan</bdi></a> - This is the solution! Thank you very much.</p>
]]></description><link>https://forum.netgate.com/post/1166524</link><guid isPermaLink="true">https://forum.netgate.com/post/1166524</guid><dc:creator><![CDATA[thedanhealy]]></dc:creator><pubDate>Wed, 01 May 2024 17:26:53 GMT</pubDate></item><item><title><![CDATA[Reply to Solution to trigger email when user authenticates to Captive Portal on Wed, 01 May 2024 08:10:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thedanhealy">@<bdi>thedanhealy</bdi></a></p>
<p dir="auto">Unexpected guest ?<br />
He will find the login page where you can indicate : "call me, I give you a login code/password or voucher" ?<br />
Does this unexpected guest really tries out guess an access code ?</p>
<blockquote>
<p dir="auto">This will help me identify when an unexpected guest is authenticating and needs action/blocking.</p>
</blockquote>
<p dir="auto">Some one who hasn't access, doesn't have the code, will hit the wall.<br />
You will see this in the portal log :</p>
<p dir="auto"><img src="/assets/uploads/files/1714549826457-cb162853-5cf2-4911-96c3-b5cfcf88d719-image.png" alt="cb162853-5cf2-4911-96c3-b5cfcf88d719-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">he can try all day long, to the end of time.</p>
<p dir="auto">You are creative ? Then two lines of PHP won't scare you.<br />
Here is a suggestion.<br />
Edit /usr/local/captiveportal/index.php</p>
<p dir="auto">Find this at the end :</p>
<p dir="auto"><img src="/assets/uploads/files/1714550723285-3117d9e8-1f67-42f1-9cb7-300734d80bcc-image.png" alt="3117d9e8-1f67-42f1-9cb7-300734d80bcc-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Add these two lines :</p>
<pre><code>		$msg = "No access : {$cpzone}, {$user}, {$clientmac}, {$clientip}";
		notify_all_remote($msg);
</code></pre>
<p dir="auto">Like this :</p>
<p dir="auto"><img src="/assets/uploads/files/1714550704202-54092853-218c-4b24-a8fa-af8bf9a48a44-image.png" alt="54092853-218c-4b24-a8fa-af8bf9a48a44-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">From now on, when the portal login fails, you get a notification.</p>
<p dir="auto">Why isn't this implemented by default ? For reasons that can become obvious to you : you'll get bombarded with notifications if you have a "unexpected guest" who refuses to use his brain, and starts a dictionary attack on your portal.</p>
]]></description><link>https://forum.netgate.com/post/1166426</link><guid isPermaLink="true">https://forum.netgate.com/post/1166426</guid><dc:creator><![CDATA[Gertjan]]></dc:creator><pubDate>Wed, 01 May 2024 08:10:34 GMT</pubDate></item></channel></rss>