Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Aug 16, 2010 7:32 pm 
Offline
Junior Member

Joined: Wed Mar 17, 2010 3:24 pm
Posts: 26
For my e-mail setup I am using Google apps and have msmtp-mta installed on my ubuntu 10.04 server.

On my site there is a php contact form that visitors can use for inquires.

My issue is that when someone sends me a message from the contact form the "From" field of the e-mail shows my default Google apps e-mail address instead of the visitors e-mail address.

Complicating matters is that I would like to host a few different domains on the server all of which would have contact forms on their sites.

Has anyone else run into this issue? I'm in need of some suggestions. :)

_________________
I'm completely new to the LAMP stack.


Top
   
 Post subject:
PostPosted: Mon Aug 16, 2010 7:44 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
Google is going to set the email "From" based on how you authenticate to your Google Apps account combined with which sender addresses are authorized in that account. You should be able to do what you want as long as you do the initial setup in your Apps account to permit it to send email on behalf of the addresses you wish to use. (Or directly use the Apps account you wish to appear to be sending the messages)

If you're doing this on behalf of customers, having them acknowledge your ability to send mail on their behalf (when you set your Apps account up for it) could be part of your standard setup.

See also http://www.linode.com/forums/viewtopic. ... 1325#31325

-- David


Top
   
 Post subject:
PostPosted: Tue Aug 17, 2010 11:17 pm 
Offline
Junior Member

Joined: Wed Mar 17, 2010 3:24 pm
Posts: 26
Thanks for the info! - I understand how to change the default e-mail account address now. But I'm still working on a solution as to how to get the correct From: address in the e-mails I receive when a random visitor uses the websites simple php mail() contact form. So far the only solution I can find is pointing to not using Google apps...

_________________
I'm completely new to the LAMP stack.


Top
   
 Post subject:
PostPosted: Tue Aug 17, 2010 11:34 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
Just put the address you want into the From: header in the message you're formatting. The value has to be one of the authorized email addresses on the Google Apps account you use (or else it will replace it with the Google Apps address), but otherwise should work fine.

You'll need to make your PHP code appropriately decide which address to use based on who is completing the form, which is something that will be specific to your application.

-- David


Top
   
 Post subject:
PostPosted: Wed Aug 18, 2010 12:04 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
It would be pretty difficult to get ramdom users of your contact form to have themselves authorized by Google Apps. Why would anyone go through the hassle just to fill out a contact form? More importantly, why would random users of your contact form want to give you a right to pretend to be them?

If only a few people are going to read those contact-form emails (as is the case of most contact forms), you might as well save the hassle by including the user's e-mail address in the body of the message. Google will probably linkify it, so you can click on it and write your reply. Alternatively, you could set a Reply-To: header. That way, the e-mail will seem to come from a single authorized address, but when you click Reply it'll go to the person who filled out the contact form. Not sure if Google Apps allows custom Reply-To: headers, though.


Top
   
 Post subject:
PostPosted: Wed Aug 18, 2010 12:15 am 
Offline
Junior Member

Joined: Wed Mar 17, 2010 3:24 pm
Posts: 26
As you said if it is not an authorized address Google apps will replace it with an authorized one it has listed in the account. In my case, my address.

So random visitor inputs into the contact form:

Name: John Doe
e-mail: JohnDoe@CrazyRandomDomain.com
Message: I had a question about blah blah...

The e-mail I receive looks like this:

From: John Doe <MyGoogleAppsEmail@MyDomain.com>
Message: I had a question about blah blah...

All I'm looking to do is just keep JohnDoe@CrazyRandomDomain.com in the From: field when I get the e-mail from the contact form and not have it replaced with my authorized email address. Maybe this can be done with Google apps premier, but as far as I can tell it cannot be done with standard.

Oh well. I was trying to avoid this, but I suppose I'll have to install some kind of "real" mail server…

_________________
I'm completely new to the LAMP stack.


Top
   
 Post subject:
PostPosted: Wed Aug 18, 2010 12:23 am 
Offline
Junior Member

Joined: Wed Mar 17, 2010 3:24 pm
Posts: 26
hybinet wrote:
Alternatively, you could set a Reply-To: header. That way, the e-mail will seem to come from a single authorized address, but when you click Reply it'll go to the person who filled out the contact form. Not sure if Google Apps allows custom Reply-To: headers, though.


Google does allow for custom Reply-To: headers and I did try it out. I guess it is just a personal preference, but I just wasn't a fan.

_________________
I'm completely new to the LAMP stack.


Top
   
 Post subject:
PostPosted: Wed Aug 18, 2010 3:33 am 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
eekeek wrote:
All I'm looking to do is just keep JohnDoe@CrazyRandomDomain.com in the From: field when I get the e-mail from the contact form and not have it replaced with my authorized email address. Maybe this can be done with Google apps premier, but as far as I can tell it cannot be done with standard.

Sorry, I misunderstood. I thought you were looking to have a specific per-domain email account (like a standard "info" or whatever) that would send messages on behalf of the form.

It's practical (IMO) to do this for a single address per client/customer/business domain, but clearly not to arbitrarily generate messages with any From address. No, I don't think trying to route through a Google Apps login (any level) is suitable for that.

-- David


Top
   
 Post subject:
PostPosted: Wed Aug 18, 2010 12:14 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
eekeek wrote:
Oh well. I was trying to avoid this, but I suppose I'll have to install some kind of "real" mail server…


Use exim and set it to only allow mail from localhost. It's very simple to setup for exactly this scenario.


Top
   
 Post subject:
PostPosted: Wed Aug 18, 2010 9:51 pm 
Offline
Junior Member

Joined: Wed Mar 17, 2010 3:24 pm
Posts: 26
glg wrote:
Use exim and set it to only allow mail from localhost. It's very simple to setup for exactly this scenario.


Awesome. I'll give it a look over in the library. Can exim be setup to deal with multiple domains?

Would this cause any issues with msmpt?

_________________
I'm completely new to the LAMP stack.


Top
   
 Post subject:
PostPosted: Tue Aug 24, 2010 2:21 pm 
Offline
Senior Newbie

Joined: Sun Aug 22, 2010 7:41 pm
Posts: 13
I know I'm going to run into this same problem, but can't you set the following headers:

Code:
From: "customer@hotmail.com" <noreply@yourdomain.com>
Reply-To: customer@hotmail.com


This way shows better what is actually going on but will make for a confusing inbox:
Code:
From: "Company Contact Form" <noreply@yourdomain.com>
Reply-To: customer@hotmail.com


Will this work with Google Apps (assuming the noreply account is setup at GA)? The first example probably smells like spam, so you might need to create a filter at GA to prevent it from being flagged as such.

EDIT: I guess a mixture of them both and something like the following would be best?

Code:
From: "Customer Enquiry: customer@hotmail.com" <noreply@yourdomain.com>
Reply-To: customer@hotmail.com


EDIT2:
Just tested and all the above methods work fine. I can't say how they compare when it comes to spam detection since I have everything set from the address I used to not be marked as spam.


Top
   
 Post subject:
PostPosted: Thu Aug 26, 2010 12:00 am 
Offline
Junior Member

Joined: Wed Mar 17, 2010 3:24 pm
Posts: 26
KyleMac wrote:
This way shows better what is actually going on but will make for a confusing inbox:
Code:
From: "Company Contact Form" <noreply@yourdomain.com>
Reply-To: customer@hotmail.com



Like you said it does make for a confusing inbox. That’s why I wasn’t a big fan of that solution. I haven’t had much time to work on the problem or figure out exim. I’m still not sure if running exim and msmpt at the same time will cause any problems. Also, everything I have looked at for exim dealing with multiple virtual hosts has caused my head to spin so I’m still trying to find a good tutorial on that. Let me know if you come up with anything!

_________________
I'm completely new to the LAMP stack.


Top
   
 Post subject:
PostPosted: Thu Aug 26, 2010 1:34 am 
Offline
Senior Newbie

Joined: Sun Aug 22, 2010 7:41 pm
Posts: 13
The first set of headers I posted are the solution you want.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group