#1808 - Include source IP in error mails
0 guests and 0 members have recently viewed this.
The top 3 point earners from 14th Dec 2025 to 21st Dec 2025.
| PDStig |
|
|
|---|---|---|
| Gabri |
|
|
| sholzy |
|
|
There are no events at this time
Depending on my finances, I'll sponsor it, but sadly I can't guarantee it. But I feel this is a big security issue now.
It's unlikely someone is actively trying to hack, more likely it's just a dum bot, which will be going over potentially millions of sites looking for common vulnerabilities.
If the mails themselves are a nuisance, just set up a simple mail filter rule to auto-delete them.
Maybe it's private hosting?
Here's a super-fudge.
sources/failure.php
mail_wrap(do_lang('ERROR_OCCURRED_SUBJECT',get_page_name(),NULL,NULL,get_site_default_lang()).' '.cms_version_pretty(),$mail,array($agency_email_address),'','','',3,NULL,true,NULL,true);
-->
mail_wrap(do_lang('ERROR_OCCURRED_SUBJECT',get_page_name(),NULL,NULL,get_site_default_lang()).' '.cms_version_pretty(),$mail.get_ip_address(),array($agency_email_address),'','','',3,NULL,true,NULL,true);
I just dumped the IP on the end of the mail
Do this in same file:
dispatch_notification($notification_type,NULL,do_lang('ERROR_OCCURRED_SUBJECT',get_page_name(),NULL,NULL,get_site_default_lang()),$mail,NULL,A_FROM_SYSTEM_PRIVILEGED);
-->
dispatch_notification($notification_type,NULL,do_lang('ERROR_OCCURRED_SUBJECT',get_page_name(),NULL,NULL,get_site_default_lang()),$mail.get_ip_address(),NULL,A_FROM_SYSTEM_PRIVILEGED);
This change should work regardless of notification type, as that's just a matter of how they are collected/sent.
Doing it for the error log would be possible but it'd be a different part of the code, and not retroactive. It'd be harder though because with a change in the logging format kicking in retroactively it wouldn't know how to column it, unless we do it with care. Not something I can do in a "super-fudge" ;)