If like me, you host your own mail server on your broadband then you may of come accross this problem. Some ISP’s refuse to accept mail from dynamic IP ranges, and so they should! E-mail aware worms and viruses are used all over the world to send us spam, and the majority of them are on consumer PC’s hosted on dynamic IP ranges.
Now, if you don’t have a static IP, and you want to send mail to a Gmail address your mail will be rejected. Using postfix as your MTA, you can work around this.
Most ISP’s offer an SMTP relay server, now you may not want to use this all the time, so transport maps can send only mail for gmail addresses to your smtp relay, and the rest can go direct.
Find out what your ISP’s SMTP server address is, usually smtp.yourisp.com. Create a file named
transport in /etc/postfix and add the following text,
Remember to swap “smtp.yourisp.com” for the address of your ISP’s smtp relay server.
Now we need to compile this file using the postmap command,
Edit /etc/postfix/main.cf and add this line at the bottom,
transport_maps = hash:/etc/postfix/transport
Restart postfix and you should find all mail addressed to @gmail.com or @googlemail.com will be redirected to your smtp relay.