How do I deliver to a program using a wild card

2009-07-16 Thread Rob Tanner
Hi,

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 �...@send.fax² 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.

Thanks.



Rob Tanner
UNIX Services Manager
Linfield College, McMinnville Oregon
503-883-2558





Re: How do I deliver to a program using a wild card

2009-07-16 Thread Stefan Förster
* Rob Tanner rtan...@linfield.edu 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 �...@send.fax² 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:

/(.*)@fax.send/   local...@my.domain,${1}final.mailserver

This will redirect the message to faxnumber@final.mailserver and to
the alias localfax (given that you substitue my.domain with a
domain which is part of mydestination).

In /etc/aliases, add

localfax:   |/path/to/program

and issue newaliases.


Cheers
Stefan


Re: How do I deliver to a program using a wild card

2009-07-16 Thread Stefan Förster
* Stefan Förster cite+postfix-us...@incertum.net wrote:
 /(.*)@fax.send/   local...@my.domain,${1}final.mailserver

/(.*)@fax.send/   local...@my.domain,$...@final.mailserver

The @ was missing.


Re: How do I deliver to a program using a wild card

2009-07-16 Thread Sahil Tandon
On Fri, 17 Jul 2009, Stefan Förster wrote:

 * Rob Tanner rtan...@linfield.edu 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 �...@send.fax² 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/   local...@my.domain,${1}final.mailserver

Might as well use anchors and only accept digits in the local-part.

/^(\d+)@fax.send$/   localfax,$...@final.mailserver

 In /etc/aliases, add
 
 localfax:   |/path/to/program
 
 and issue newaliases.

-- 
Sahil Tandon sa...@tandon.net