• Resolved muskratt

    (@muskratt)


    WP 3.9.2, Plugin version 4.0.26
    Host: DigitalOcean/VPS

    I am seeing the IP address in the footer of the emails sent using the form but for some reason, the IP address shown on all form submission is the IP of the server, not the email sender.

    Is there a configuration issue causing this?

    Thanks

    https://wordpress.org/plugins/si-contact-form/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi muskratt as far as I know the plugin does not add the IP address to the e-mail sent.

    Do you have any security plugin setup?

    Regards

    Thread Starter muskratt

    (@muskratt)

    Straight from the front page of the plugin’s page on WordPress.org

    Email message footer shows blog username(if logged on), Date/Time timestamp, IP address, and user agent (browser version) of user who contacted you.

    Thank you now I know what you mean. I was not sure when I read your question above.

    In regards to your message below….

    the IP address shown on all form submission is the IP of the server, not the email sender.

    So you are saying that all e-mails that you receive and all e-mails people who submit a comment receive have your server IP address added?

    Regards

    This plugin uses the PHP variable $_SERVER[‘REMOTE_ADDR’] to get the user’s IP address.
    If your sever reports it’s own IP instead, that must be caused by a server problem. Make a support ticket with your web host to see if they can determine the cause and fix the server.

    See a related discussion on the same type of problem:
    http://stackoverflow.com/questions/4262081/serverremote-addr-gives-server-ip-rather-than-visitor-ip

    Also look at this wordpress bug ticket that was closed as “wont fix” because this is an issue at the server level. It was suggested you could even fix it your self by adding two lines of code to your own wp-config.php, something you can try in minutes,

    If you find a solution that works, please share what it was.

    Mike

    Thread Starter muskratt

    (@muskratt)

    Mike,

    With that information, my best guess is that it reports its own IP because Apache is setting behind Nginx. That makes it pretty obvious to me now as why the server’s own IP is being shown as the remote since Nginx as a client is being the remote host according to Apache.

    I’ll keep you advised if I find an unobtrusive work-around.

    Thanks!

    Thread Starter muskratt

    (@muskratt)

    Here’s my fix class-fscf-process.php line 937, change it to

    $_SERVER['HTTP_X_FORWARDED_FOR']

    It seems a simple if/else logic test to see if $_SERVER[‘SERVER_ADDR’] = $_SERVER[‘REMOTE_ADDR’] then to use $_SERVER[‘HTTP_X_FORWARDED_FOR’] instead on the email output.

    Of course, $_SERVER[‘HTTP_X_FORWARDED_FOR’] can be spoofed easily but for a normal submission form just to weed out questionable submissions, this should work just fine.

    You could try this plugin instead. I have not tested, that is why I said try it. If you try it and it works, let me know. Then you would not have to edit my plugin each update.

    Mike

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘IP address in footer’ is closed to new replies.