On Fri, 17 Jul 2009, Stefan Förster wrote: > * Rob Tanner <[email protected]> wrote: > > I get email forwarded to me from a FAX server that I need to process and > > then forward to a different server. The ³to² email address is always in the > > form of <FAXnumber>@send.fax. The FAX number could be the phone number for > > any FAX machine in the country and only the �[email protected]² is a constant. > > Right now, I¹ve set up an alias that looks like ³*.send.fax > > ³/opt/local/adm/aliasFilters/FAX.filter faxfilter² which seems like it > > should work. When I point alias_maps to that file, and include the > > send.fax domain in mydestination, the message bounces because it doesn¹t > > recognize the user (which is simply one of an infinite possible phone > > numbers). When I move the send.fax domain to relay_domains and point > > virtual_alias_maps to the alias file, Postfix happily forward the message on > > to the regilar mail server, substituting the file path for the ³to² address. > > In no case does the message ever get delivered to the program. > > > > Can someone please tell me what I need to do to get this to work right? I¹m > > running this in a separate instance of Postfix, so no matter what I do, I > > won¹t screw up the main mail system. > > Set up "fax.send" in virtual_alias_domains. In a PCRE map referenced by > "virtual_alias_maps", add an entry like:
It is unnecessary to move 'fax.send' from $mydestination to $virtual_alias_domains. The virtual(5) alias table also rewrites envelope recipient addresses for *local* destinations. See the manual for more. > /(.*)@fax.send/ [email protected],${1}final.mailserver Might as well use anchors and only accept digits in the local-part. /^(\d+)@fax.send$/ localfax,[email protected] > In /etc/aliases, add > > localfax: |/path/to/program > > and issue "newaliases". -- Sahil Tandon <[email protected]>
