Gmail, Drupal 6 contact forms and maybe rules?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
juliavdw's picture

Ok, Drupal group peeps. Here's my problem:

My client has a Drupal 6 install with a vanilla drupal contact form.
They have shared hosting at dreamhost with their domain email being hosted through google apps.
So far so good.

Recently we have noticed that they can receive email from any anonymous user who does not have a gmail.com email.

This means that if an anonymous user wants to contact them and puts email@gmail.com into the email field of the form, the mail will not go through.

In my research of this problem, I have found forum and issue queue posts that have directed me to edit the DNS records, or install the SMTP module. Both have failed to work; the SMTP module simply cannot connect to the SMTP server, and yes, I have double checked the settings that google requires for this.

SO Paul and I did some more experiments and found that if you have gmail.com email address and replace "gmail.com" with "googlemail.com" the form works and my clients would receive that email from the site.

The plan now is to capture the email field of the form and to forcibly replace "gmail.com" with "googlemail.com". I thought "hey, maybe we can do this with rules" and attempted to do so, but of course I found that none of the UI triggers have anything at all like what I am trying to do.

Now I am finally getting to my questions!

Have any of you experienced this issue, and found a solution?
Do you think it is possible to do what we want to do with rules?
Do you have a better suggestion for next course of action?

Comments

You are using the standard

maryedith's picture

You are using the standard contact form? A field value can be easily done with a few lines in a custom module...

i meant to say 'easily

maryedith's picture

i meant to say 'easily changed'

Is there any kind of watchdog

darrylri's picture

Is there any kind of watchdog entry when an email fails? This really does sound like a lower level plumbing problem. Can you change the system contact address to one in a different domain and point SMTP at that?

Changing gmail to googlemail is masking the problem and it will probably come back again.

Hmm, ok, looks like it's

darrylri's picture

Hmm, ok, looks like it's Dreamhost themselves creating this issue:
https://discussion.dreamhost.com/thread-135046-post-153903.html

You could try the module that this guy built to fudge the mail headers, and see if that works.

I would say that's a pretty rotten thing to do to someone's shared hosting. It would make me want to avoid them.

Thanks Darryl for tracking

pferlito's picture

Thanks Darryl for tracking this down. Apparently this is a spam-prevention measure by Dreamhost. Wondering if they are the first of many to do this. This should be a concern for anyone using the core Contact module because of how it puts the email address from the contact form into the email 'From' field. This is technically email spoofing.

Anyway, I was able to deploy a fix for this in a hook_mail_alter(). Thanks again.