Would it be possible to add the IP address & hostname if available of the sender of a message?

Comments

behindthepage’s picture

Project: Contact Forms » Drupal core
Version: 6.x-1.1 » 6.2
Component: User interface » contact.module

I have moved this to the core contact module issues

catch’s picture

Version: 6.2 » 7.x-dev

Feature requests go against HEAD. We track IP addresses for comments, makes sense to be consistent (in either direction) for the contact form.

dave reid’s picture

Status: Active » Fixed

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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jswap’s picture

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:

http://email.about.com/od/emailprogrammingtips/qt/How_to_Send_Emails_wit...

Bob123’s picture

Version: 7.x-dev » 7.22
Status: Closed (fixed) » Active

Would 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

cweagans’s picture

Version: 7.22 » 7.x-dev
Status: Active » Closed (fixed)

I'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.

justocomment14’s picture

Issue summary: View changes

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.