Postfix -- selective forwards for external domains
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
... but I want every other email to be delivered as normal, through the mail gateway: justin@company.com --> justin@company.com
...
@company.com --> @company.com
I don't think I can do this using virtual domains -- I could do the first part, but I can't see how I could then say, "for everything else, deliver as normal", as I don't need a normal catch-all.
Thank you very much, Berhanie -- this allowed me to piece together the jigsaw, without thinking that I was looking in the wrong place! For reference for anyone in a similar boat, I've done the following:
Created the file /etc/postfix/canonical, and put the following lines in it:
ok, if that works for you. canonical has specific semantics, which is to make locally significant addresses, such as bob@localhost.localdomain, into something meaningful to the rest of the world.
correction: i described the generic map, not canonical. generic is used to transform localhost.localdomain into a valid domain. canonical is used to transform valid email addresses, e.g. bsmith@example.com, into a domain-specific standard form,
e.g. bob.smith@example.com.
That's handy to know -- thanks for that! The method I described does seem to work for me -- do you happen to know which table I should have used though, to align with standard use?
i would first try virtual alias. i'd have to look at the man pages again to make sure.
as you see, there are several ways of doing it, but if i were working on an unfamiliar postfix system, looking for the place where you put these aliases, that's the map i'd check first.
Mmmm, having now read around this some more, I think you're right that the mapping I was using should ideally have sat in the virtual alias file, which is handy to know for the future. Many thanks again for your help, Berhanie!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.