Virtualmin, Postfix & Google Apps

Hi!

I'm having a problem setting up Postfix. I followed the instructions here:

http://linodeb0x.blogspot.com/2012/11/webminvirtualmin-installation.html

And it worked in the sense that I can send emails from the virtualmin server to a google apps domain and everything checks out properly.

The problem is that the messages are coming from my SASL authenticated address and not the generics that I setup.

I'm sending the email as root on the virtualmin box and authenticating (through postfix) as user@googleappsdomain.com and sending to someuser@anothergoogleappsdomain.com and the email appears to come from user@googleappsdomain.com and not the generic account that I setup in the generics file.

Does this mean that I have to create another google apps account just for sending emails from the virtualmin box?

Is there anything else that I need to do on the virtualmin side to get this to work? I do not intend to use any mail functions (from virtualmin) right now and all of that will be handled through google apps. But I want to make sure the emails from wordpress, php scripts and whatnot are able to be sent and appear to be coming from the correct place.

I guess that opens up the larger question which is if I have

virtualserver.com

and that user sets up wordpress blog and emails their users it seems to me right now that everything will appear to come from the account which is SASL authenticating to smtp.gmail.com and not from wordpress@virtualserver.com.

Ugg I'm confused and not sure how to tie this in properly with Virtualmin. Any pointers will be HUGELY appreciated!

Thanks! Aaron

Status: 
Active

Comments

Update:

I actually took out all of the following:

relayhost = [smtp.gmail.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_password_map

I have a generic setting mapping root --> admin@mydomain.com

and it is working!

Does this make sense to you guys?

Final question: I noticed the return-path is set to virtuaminuser@host.domain I think I'd want to change that to {$EMAILTO} for the virtual server right?

It almost seems like it would be easier to just setup Virtualmin to manage email too! :)

Thanks again!

Howdy -- well, Postfix configuration may be a little outside the scope of what we can help with, but I'll offer a few thoughts --

There shouldn't be anything on the Virtualmin end of things that you need to set.

Regarding the Return-Path, I believe that header is set by the recipient server, based on the "Mail From" that's used.

Also, I wanted to mention that your server can deliver email messages to Google Apps even if the Mail for Domain feature is disabled. You only need the Mail for Domain feature enabled if you want to be able to receive emails on your Virtualmin server.

So if you're sending email from WordPress and other apps on your server, the key would just be to make sure each of those apps is configured with the correct "From" address.

If your server isn't going to be receiving emails, only sending them -- you'd want to make sure the Mail for Domain feature is disabled, so it's not trying to deliver them locally.

What you're using above can help if you're on a dynamic IP though, or if your ISP blocks outgoing traffic to port 25.

Hi,

Thanks for the tips! I was just looking for some general thoughts as you provided! What I'm most worried about is doing things that are not inline with virtualmin methodologies. In other words I want to make sure I'm not doing anything that will bite me later WRT virtualmin.

Doesn't sound like I've done anything like that here or so far :)

Yes I just removed using gapps as a mail relay and everything is working fine. I've configured postfix to not receive any email on the system at all (that's the way I want it). Anyone using Google Apps can just create an equivalent email@gappsdomain and get an receive mail there.

Thanks again! Aaron