postfix local users/domains

Hi all,
I’m new to opensuse and linux in general. I’m trying setup home mailing server. I have real domain xyz.dyndns.org, but for now I just want mail to use inside intranet. I tried to config postfix as a mail sender for system users. So I have:
myhostname = linux.xyz.dyndns.org
mydomain = xyz.dyndns.org
mydestination = localhost.$mydomain, $mydomain, localhost
mynetworks = 192.168.1.0/24, 127.0.0.0/8

I want to be able to send email to user@xyz.dyndns.org and to be treated like local system address, not to go out and back in - so without need forward ports to the server. I’m not running dns.

Note I’m able to send/receive user@localhost but not user@xyz.dyndns.org and I want this email to be treated the same.

What should be the best way to achieve this - is virtual domain needed?

Thanks,
Milan

To be able to do this, you need to resolve those domains to local IPs. This means setting up your own DNS server to resolve xyz.dyndns.org only within your LAN.

Actually I already had similar setup but on win and free mail server so I wanted to keep the same addresses. I’m thinking about editing /etc/hosts to add record to resolve xyz.dyndns.org to my local 192.168.1. address…or maybe there are other suggestions?

You would have to edit it on all the machines then.

Well it doesn’t work even on the same machine where I’m running mail server. I added:
127.0.0.1 xyz.dyndns.org

(Of course it’s not really xyz:))

whan I ping xyz.dyndns.org I get replay from 127.0.0.1 but still when I’m sending mail I get error from log:
linux postfix/error[16939]: D9E8E7AF5E: to=<user@xyz.dyndns.org>, relay=none, delay=0.12, delays=0.06/0.01/0/0.05, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to xyz.dyndns.org[92.60.xx.yy]:25: Connection refused)

(domains and ips altered here).

I’m doing all this on the same machine…seems like postfix ignores somehow /etc/hosts…I’m confused :frowning:

You probably already have a line with 127.0.0.1, so you have to add it as an alias on that line:

127.0.0.1 localhost … xyz.dyndns.org

Yes, I did that as well but it doesn’t work :frowning:
When I ping domain I get answer from local ip, but postfix still tries to send to public ip.

Thanks for the quick answers.

In that case postfix is not using /etc/hosts as a resolution source. All in all I would recommend DNS since you can apply it to all machines on your LAN.

Just to inform you that I solved the problem. Actually it was trivial - there were settings the bottom of the main.cf auto-generated which were overwriting my settings. Actually top of the file has warning about this :frowning:

Thanks