Loading ...
Sorry, an error occurred while loading the content.

Re: Restrictive Email Format forwarding to Script

Expand Messages
  • Noel Jones
    ... (plain text only please) Wildcard domain transports are probably a mistake, quite likely to come back and bite you later. Anyway, your regexp is wrong. ...
    Message 1 of 3 , Feb 28, 2012
    View Source
    • 0 Attachment
      On 2/28/2012 11:51 AM, Tugdual de Lassat (ML) wrote:
      > Hello the list..
      >
      >
      >
      > I’m asking your support for a problem we are facing using Postfix
      > server configuration…
      >
      >
      >
      > We are trying to setup an internal CRM Solution, that has to manage
      > mail returns depending type of message…
      >
      > We have actually 2 sorts of email types :
      >
      > Bounce.xxxxx-xxxx-xxxx@...
      > <mailto:Bounce.xxxxx-xxxx-xxxx@...> that can be also
      > @... (we have several communication methods and domains)
      >
      > Return.xxxxx-xxxx-xxxx@...
      > <mailto:Return.xxxxx-xxxx-xxxx@...> (same as above).
      >
      >
      >
      > Both addresses must pipe to a script in order to
      >
      > - cope bounces and remove know clients from our CRM database
      >
      > - Send mail returns to the right person linked to the CRM
      > Database (and moreover undertake CRM actions)
      >
      >
      >
      > I have a transport regex : transportregex
      >
      >
      >
      > /bounce.*@*/ <mailto:/bounce.*@*/> bounceh:
      >
      > /return.*@*/ <mailto:/return.*@*/> bouncer:

      (plain text only please)

      Wildcard domain transports are probably a mistake, quite likely to
      come back and bite you later.

      Anyway, your regexp is wrong.


      >
      >
      >
      > Called in main.cf :
      >
      > transport_maps = regexp:/etc/postfix/transportregex
      >
      >
      >
      > And corresponding pipes in master.cf
      >
      > bounceh unix - n n - - pipe
      >
      > flags=DRhu user=www-data argv=/usr/bin/php
      > /home/samba/test/get_bounces.php
      >
      > bouncer unix - n n - - pipe
      >
      > flags=DRhu user=www-data argv=/usr/bin/php
      > /home/samba/test/get_return.php
      >
      >
      >
      > Yet when I send a mail to the transport (SMTP mails outside the
      > server, not locally which weirdly seems to work), I always get the
      > following return :
      >
      > 550 5.1.1 <bounce.xxxxx-xxxx-xxxx@...
      > <mailto:bounce.xxxxx-xxxx-xxxx@...>>: Recipient address
      > rejected: User unknown in local recipient table

      So the user is unknown for a domain listed in $mydestination.
      http://www.postfix.org/ADDRESS_CLASS_README.html
      http://www.postfix.org/LOCAL_RECIPIENT_README.html

      You can use a regexp alias_maps something like
      /^bounce\./ bounce@localhost
      /^return\./ return@localhost

      in which case your transport map becomes simpler non-regexp

      bounce@localhost bounceh:
      return@localhost bouncer:




      -- Noel Jones
    Your message has been successfully submitted and would be delivered to recipients shortly.