0

I have postfix on my Ubuntu 12. My server has real domain name (ddd). But I would like to use postfix for web scripts on my server to sending out emails.

My real domain name is connected with GMail. And it works well.

I have username on my server like xxx. And the same username I have on GMail (which is connected with my domain name ddd).

So when scripts from my server sending out email to user xxx@ddd it's sending it to local user xxx on my server ddd. But i would like to receive it on GMail.

is it possible ?

my MX record is Ok.

ddd.        3600    IN  MX  5 alt2.aspmx.l.google.com.
ddd.        3600    IN  MX  10 aspmx2.googlemail.com.
ddd.        3600    IN  MX  10 aspmx3.googlemail.com.
ddd.        3600    IN  MX  10 aspmx4.googlemail.com.
ddd.        3600    IN  MX  10 aspmx5.googlemail.com.
ddd.        3600    IN  MX  1 aspmx.l.google.com.
ddd.        3600    IN  MX  5 alt1.aspmx.l.google.com.

my main dns record is also good. my real domain name is resolved well.

3 Answers 3

1

Don't use postfix; you have no need of its power and versatility.

Use a decent nullmailer such as ssmtp instead.

2
  • would it be enough to install just mailutils ? Apr 18, 2012 at 13:20
  • That depends; a MUA such as mutt or (al)pine can send over SMTP, but mail(1) cannot. If you're going to use this for applications sending mail, just use a nullmailer.
    – adaptr
    Apr 18, 2012 at 15:05
0

What you are doing is invalid. You created MX records for your domain that points to Gmail servers. You should receive the emails locally and then forward them to your Gmail account.

You can setup virtual alias maps in postfix to do so.

1
  • can I have installed just mailutils and not any big MTA ? Apr 18, 2012 at 13:20
0

Firstly, make sure myhostname is set to a hostname within your domain, not your domain itself. Then, edit /etc/mailname (only works for Debian & Ubuntu) to have your domain, so myorigin will be set to this automatically. Finally, edit mydestination sot it doesn't contain $myorigin.

This will stop mail for your domain that should be going to Gmail from being delivered locally.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .