Weird issue with SMTP
-
I have a weird issue with 23.01 at SG-3100 (at least, I did never had this issue prior 23.01).
Actually I can not find a cause for this, first time this happens was some days ago, without any user interaction.
During afternoon I received an e-mail from the SG-3100 that the DynDNS address was updated, this happens from time to time, so no bad.
But a while later I noticed that the mails continue and continue, every time the same content, DynDNS update.
There was only one DynDNS update, but I received about 500(!) mails in 2 hours for this event, even when disabling SMTP notifications the appliance continues to send mails!???
Only way to resolve and break to endless mails was rebooting the appliance (may be a service restart via CLI would stop this also, but reboot was faster).Today it happens again, I did a change in NUT service to test something. Right after the modification I got a mail from pfsense (I confess, I did not read the body, only the header).
I was convinced that this was the mail for the modification in NUT. Next I reverted this modification to previous setting, during that task more mails arrived.
Now wondering about the numerous mails I read the mail and: it was a notification of DynDNS change!??? But the time and IP was the same as some days ago, there was no current change of IP.
It refers clearly the event some days ago.
And again, stopping SMTP does not stop sending mails. Again I did a reboot of appliance.
There have been about 20+ mails within 2 or 3 minutes for this event.Anyone else who has some weird experiences with SMTP and 23.01?
Any idea, how to troubleshoot this?Regards
-
It has been mentioned before. Rapidly, multiple identical mails from pfSense.
When there is a notification to be send (smtp), it's added to queue file.
Then /usr/local/bin/notify_monitor.php is started, which will call the function notices_sendqueue() (in /etc/inc/notices.php) that will continue to send all the mails until the queue file is empty.
When there is nothing left to be done (queue file empty), it terminates.If, for some reason, it can't wipe the file (file system issue ? file system read-only because it booted not-clean ?) then the same message(s) can get send and resend .....
The next time you have the same issue, do a
ps ax
or better
ps ax | grep 'notice'
and see what is running.
Do a cat /var/db/notifyqueue.messages (repeat multiple time) to see what's in there.
Is stuff getting added ?
Does it get bigger ?
Smaller ?The test messages (a 'forced' message) bypasses this queue system.
-
Multiple mails would be ok (depends, what figure "multiple" is), but several hundred?
Actually I believe, if I did not reboot the appliance, the mails would never stopped.Where was this mentioned, I did not find such an issue.
Regards
-
@fsc830 said in Weird issue with SMTP:
I did not find such an issue
Try with a magic key word (I just took one that seems, to me, significant ;) ) :
https://forum.netgate.com/search?term=notify_monitor&in=titlesposts&matchWords=all&sortBy=relevance&sortDirection=desc&showAs=posts -
There is also a recently closed Redmine Issue on this problem here: https://redmine.pfsense.org/issues/14031.
The problem is fixed in the latest snapshot release, but to get the fix into 23.01 you will need to install the System Patches package and manually apply the fix. This particular post in that Issue Thread shows how to apply the patch: https://redmine.pfsense.org/issues/14031#note-15.
-
@bmeeks said in Weird issue with SMTP:
https://redmine.pfsense.org/issues/14031#note-15.
Aha !
So, a non root instance couldn't overwrite with an empty queue file so it kept on sending the same queue content.
Nice catch !Thanks for the patch code