Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
The ip address is available in the watchdog messages whenever a contact e-mail is sent. The problem is that we don't store any information about messages anywhere once they're sent like we do with comments, nodes, etc. We should probably change that and make contact e-mails nodes in another issue like #412688: Integrate the contact form with fields.
Since this functionality is already provided, I'm marking this issue as fixed.
Instead of saving information about emails in the database, perhaps a custom header could be added to the email that includes the sender's IP and domain. I haven't tried this yet, but here's an article the purports to show how to add a custom header to an email in php:
cweagans, a very good reason to want this is for blocking the IP of contact page spammers. I cannot find a way to do this since I'm not a 'coder' and I don't now anyone free who can do it for me. It would be amazing to have this ability so that when I see the same IP spamming my contact page I can grab that info and ban them.
Comments
Comment #1
behindthepage commentedI have moved this to the core contact module issues
Comment #2
catchFeature requests go against HEAD. We track IP addresses for comments, makes sense to be consistent (in either direction) for the contact form.
Comment #3
dave reidThe ip address is available in the watchdog messages whenever a contact e-mail is sent. The problem is that we don't store any information about messages anywhere once they're sent like we do with comments, nodes, etc. We should probably change that and make contact e-mails nodes in another issue like #412688: Integrate the contact form with fields.
Since this functionality is already provided, I'm marking this issue as fixed.
Comment #5
jswap commentedInstead of saving information about emails in the database, perhaps a custom header could be added to the email that includes the sender's IP and domain. I haven't tried this yet, but here's an article the purports to show how to add a custom header to an email in php:
http://email.about.com/od/emailprogrammingtips/qt/How_to_Send_Emails_wit...
Comment #6
Bob123 commentedWould be nice to have the sender's IP address in the e-mail sent by the Contact module.
Subscribing.
Drupal 7.22 / Contact 7.22
Comment #7
cweagansI'm not sure why you'd want this, honestly, but if it's important to you, it should be pretty easy to write this yourself with hook_mail_alter.
Also, you don't need to comment to subscribe anymore. Just click the gigantic green "Follow" button at the top of the issue.
Comment #8
justocomment14 commentedcweagans, a very good reason to want this is for blocking the IP of contact page spammers. I cannot find a way to do this since I'm not a 'coder' and I don't now anyone free who can do it for me. It would be amazing to have this ability so that when I see the same IP spamming my contact page I can grab that info and ban them.