packetfence
packetfence copied to clipboard
Using a wrong SMTP server will fail silently on captive portal
Describe the bug If you use default settings for alerting section (localhost/25) and there is no SMTP server running on this port, sending mails through captive portal will fail silently.
For example, if you use a sponsor or an email source, you will not receive any error. However, you can see following error in packetfence.log
:
Oct 10 12:40:47 172-105-93-187 pfqueue[999239]: pfqueue(999239) ERROR: [mac:unknown] Can't send email to '[email protected]' :'SMTP Failed to connect to mail server: Connection refused at /usr/local/pf/lib_perl/lib/perl5/MIME/Lite.pm line 3044.' (pf::config::util::send_mime_lite)
To Reproduce Steps to reproduce the behavior:
- Configure a source which rely on emails (email/sponsor)
- Leave default settings in alerting section and be sure there is no SMTP server running on
localhost/25
- Try to register
=> You registration will continue but you will never receive any emails.
Expected behavior Display an error on captive portal if mails have not been sent