Own postfix smtp server as relay for Google Apps Premier Edition

Posted on 2009-02-11
Last Modified: 2013-11-10
Hi, I have a domain set for use with Google Apps and, apart from my main email address, I also use with gmail another email address with different domain.
Using the "send email as" feature as it is, if the person who receives my email uses Outlook, (s)he can see my original email address which instead I don't want to be shown.
Similarly, my original address is clearly visible in the headers.
Following some research, I have found that by upgrading to Premier Edition (which I have done already), I could tell Google Apps to use my own STMP server.
This should remove the sender header and therefore my original email address should remain hidden.
I have a VPS with Slicehost, with Ubuntu 8.04, and postfix is just installed but not yet configured.
How shall I proceed in order to use this postfix server as relay for my Google Apps accounts?
I don't really have much experience specifically with these things, but I can easily understand and follow instructions, so I would appreciate if somebody could illustrate the process in steps.
Many thanks in advance.
Question by:Sisupoika
    LVL 19

    Assisted Solution

    I would say this is the easier and simplest howto for postfix in ubuntu 8.04:

    If you setup smtp-auth in your google apps, then this setup should be secure enough to be used in production.

    there are other much more complete setups that you can use, but I see them as unnecessary:


    Accepted Solution

    Well... as said I had postfix already installed and the reason I asked a "step-by-step" help is that I couldn't find a clear answer to my question by googling...

    By the way, I have found now after further googling the fewest steps required to use a postfix server as relay for Google Apps, AND strip the "sender" header which causes Outlook to show "address 1 on behalf of address 2".

    Here is what I found and did, and that's working, in case somebody else has the same problem.

    Assumed that you have already
    - upgraded Google Apps to the Premier Edition
    - set the outbound gateway with the ip/hostname of the postfix server
    - opened the port 25

    All you need to do additionally is
    - download dig (
    - type the command "dig txt > google.txt" from the command prompt, to obtain the IP addresses used by google mail
    - create the folder /etc/postfix/maps if it does't exist already
    - edit /etc/postfix/, and add to the setting "mynetworks" Google's IPs
    - still in, add the line "header_checks = regexp:/etc/postfix/maps/header_checks"
    - edit the file /etc/postfix/maps/header_checks, and add the line "/^Sender:/ IGNORE"

    That's it.
    Now emails should be sent by Google Apps through your relay and the "sender" header removed => Outlook should no longer show the " ... on behalf of..." thing.
    For the same reasons about privacy, you might also want to strip/replace other headers such as "received" and "return-path".

    Hope this helps others who might want to achieve the same.

    (for reference:

    Expert Comment

    The only thing I question about the solution is... what do you do when Google adds more IP's?  There's gotta be a way to allow based on DNS rather than IP, I would think...

    Author Comment

    Good question.... I have no idea of those DNS. So far it is still working :D

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Microsoft Outlook is not just an email client but it is full featured Personal Information Manager. But sometimes Outlook gets disconnected and you simply can’t access it. What steps can you perform before calling IT support? In this article we will…
    Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
    In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
    In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now