On Tue, Jun 01, 2010 at 08:48:27PM -0400, cur...@maurand.com wrote: > I have several domains that I have non-unix mailboxes (they are > stored by sql using an alternative lmtp daemon after running them > through amavisd-new. This works under the current configuration, > but I'm not bouncing anything until after it goes through > amavisd-new and I'd like to reject incoming mail for unknown > recipients before being sent to amavisd-new. amavisd-new is a > massive resource hog and the less that I have to send to it for > processing, the better. > > I have a couple of domains that I need to forward all mail since > they are sent to an exchange server.
No, don't do that. This will cause you to be a backscatter spammer. There's no valid business model for that. They're surely not paying you enough to cover the costs of being treated like a spammer! > There's a proxy thing that I > can do to check those, but that's another topic. It's trivial[1], and it's a FAQ on this list. The answer is to use reject_unverified_recipient for those domains. > For now suffice it to say that for these few domains, I need to > filter and forward all mail destined for them. Spam is wrong, however valid you might think your reasons are. > I've been using the transport maps to accomplish the handoff to the > lmtp server. I was using the local_recipient_maps for the mailbox > checking, but the system is not recognizing those users as local. > > At Victor's urging, this afternoon, I enabled the > relay_recipient_maps and that solved the rejecting unknown before > the handoff to the amavisd-new, but broke the domains that I need > to forward all mail for. You'll want a wildcard, catchall entry for those domains. You will find an example of this at postconf.5.html#relay_recipient_maps . > From all the reading that I've done, it looks to me like I need > some sort of hybrid system. > > The virtual How-To is confusing and I don't see any clear examples > of what I'm looking to do. Perhaps because what you're wanting is partly beyond the scope of VIRTUAL_README. > It looks like I need to do the relay_domains and the transports > thing for the domains that need to be forwarded. Right, typically transport_maps are needed for relay_domains. See http://www.postfix.org/ADDRESS_CLASS_README.html#relay_domain_class for the explanation. You do NOT need to tinker with the default relay_transport, but you probably DO need to use transport_maps to override the nexthop that DNS would tell you[2]. > It also looks like I need to use the virtual_mailbox_domains, > virtual_mailbox_maps, but I don't see how to get from there, to the > alternat lmtp. Everything I've read says that it all goes to local > unix accounts and that's not what I need. Typically dbmail-served domains should be in virtual_mailbox_domains and the user query in virtual_mailbox_maps, yes. You can mangle the local address class to do this, just as you can force a square peg into a round hole. It won't fit quite right. I don't know what dbmail documentation shows, but you're better off doing it the right way for Postfix. > Can anyone point me in the right direction in the docs that explain > how to do this or a couple of examples? Read over the aforementioned ADDRESS_CLASS_README. [1] I hate to use the word, "trivial," because nothing in email administration is ever trivial. Misunderstandings of how mail works lead to bad management decisions, too. Suffice to say that if the basic understanding of Postfix and email is good, this solution is pretty easy. [2] Another option, besides transport_maps, would be a special DNS view with a different MX value for the domain in question. If this does not make sense to you, disregard it for now, but it might make sense later. -- Offlist mail to this address is discarded unless "/dev/rob0" or "not-spam" is in Subject: header