Thank you Wietse for the quick response - works like a charm!
2018-09-02 14:22 GMT+02:00 Wietse Venema <[email protected]>: > vorname nachname: > > Hi all, > > > > I'm running postfix for a domain, e.g, "testdomain.com". Its intended > > purpose is to receive mail for that domain and relay mail for > authenticated > > users (e.g., to gmail), otherwise reject mail. > > > > In main.cf, I have set "mydestination = testdomain.com". When sending > mail > > to a certain user on that domain ([email protected]), the mail gets > > delivered locally (no outbound connection). However, if I'm sending mail > to > > [email protected], postfix tried to relay the mail to an > > outbound server (namely that from my ISP). What I'd like to have is that > > mail for all subdomains being delivered locally, too. Can somebody give > me > > a hint how to approach that problem? > > That's easy enough: use a regular-expression lookup table. > > /etc/postfix/main.cf: > mydestination = > localhost $myhostname example.com pcre:/etc/postfix/ > mydestination.pcre > > /etc/postfix/mydestination.pcre > # This table is used as a 'list', therefore any non-empty RHS > # value will work. > /\.example\.com$/ whatever > > How would Posfix know that a recipient is valid? With mydestination > the valid recipients are looked up in /etc/passwd and $alias_maps. > > If you don't want to give everyone a UNIX shell account, see > http://www.postfix.org/VIRTUAL_README.html for alternatives. > > Wietse >
