Postfix redirect

2019-09-03 07:08发布

问题:

I have tried so much and don't get things working.

I have a domain and no hosting/webmail so I wanted to redirect everything to my gmail account. As I have a linux (Lubuntu 13.06) machine running I thought I could configure a mail server. That seemed not to be so easy.

I have redirected my mail.domain.com to my ip and the port is open (I know this because while playing about, I once did receive an error message back by email from Postfix)

I am working with Postfix, however any other application is fine by me, if easier and just as safe.

I followed this instructions, however without success http://www.java-tutorial.ch/ubuntu/forward-all-incoming-email-to-single-address

All other instructions I read on the internet were alike.

When sending a test email (not from receiver address as this is a loopback issue with gmail) I do not receive a bounce and my log files are also empty so no clue what happens.

回答1:

I've got it working now. For everyone who also wants a mail server just for forwarding mail:


    nano /etc/postfix/main.cf
    inet_protocols = ipv4
    myhostname = mydomain.nl
    virtual_alias_domains = mydomain.nl
    virtual_alias_maps = hash:/etc/postfix/virtual
    transport_maps = hash:/etc/postfix/transport

    # catch all on your domain and send to gmail
    nano /etc/postfix/virtual
    @mydomain.nl mygmail@gmail.com

    # transport all traffic to gmail through your isp smtp server
    nano /etc/postfix/transport
    gmail.com smtp:smtp.myisp.nl:25

    postmap /etc/postfix/virtual
    postmap /etc/postfix/transport
    /etc/init.d/postfix restart