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

catch-all local mail

Expand Messages
  • Charlie Root
    I ve been fighting with it for a long time but still can t get the desirable: - forward all local mail sent to valid unix users (+postmaster and abuse
    Message 1 of 3 , Mar 29, 2010
    • 0 Attachment
      I've been fighting with it for a long time but still can't get the desirable:
      - forward all local mail sent to valid unix users (+postmaster and
      abuse redirects of course) to specific email address.

      I.e. forward all mail sent to:
      [any-valid-unix-name-from-etc-passwd]@[any-ip-address-of-the-host]
      [valid-user]@[any-hostname-of-the-server]
      just [valid-user] without domain part

      In other words any address which local service would accept.

      I've tried luser_relay but it local service still desperately wants to
      deliver to local unix mailbox first.
      I've tried "mailbox_transport = virtual" and "localredir_alias_maps =
      static:redirect-here@..." but then virtual service failed to
      deliver to "redirect-here@..." with "User unknown in virtual
      alias table".

      Is it possible to setup catch-all for local mail without specifing
      each valid local user and/or each valid IP/hostname of the mail
      server?

      Thanks!

      Dimitri.
    • mouss
      ... maybe try real_alias_maps = hash:/etc/aliases local_recipient_maps = proxy:unix:passwd.byname $real_alias_maps alias_maps =
      Message 2 of 3 , Mar 29, 2010
      • 0 Attachment
        Charlie Root a écrit :
        > I've been fighting with it for a long time but still can't get the desirable:
        > - forward all local mail sent to valid unix users (+postmaster and
        > abuse redirects of course) to specific email address.
        >
        > I.e. forward all mail sent to:
        > [any-valid-unix-name-from-etc-passwd]@[any-ip-address-of-the-host]
        > [valid-user]@[any-hostname-of-the-server]
        > just [valid-user] without domain part
        >
        > In other words any address which local service would accept.
        >
        > I've tried luser_relay but it local service still desperately wants to
        > deliver to local unix mailbox first.
        > I've tried "mailbox_transport = virtual" and "localredir_alias_maps =
        > static:redirect-here@..." but then virtual service failed to
        > deliver to "redirect-here@..." with "User unknown in virtual
        > alias table".
        >
        > Is it possible to setup catch-all for local mail without specifing
        > each valid local user and/or each valid IP/hostname of the mail
        > server?
        >


        <Untested>
        maybe try

        real_alias_maps = hash:/etc/aliases
        local_recipient_maps = proxy:unix:passwd.byname $real_alias_maps
        alias_maps = static:redirect-here@...

        (without overriding "local" configuration).
      • Charlie Root
        ... It seems that local lookup for owner-$user in the alias database, and once the alias found (and it will as we have static:) it substitute Envelope From to
        Message 3 of 3 , Apr 1, 2010
        • 0 Attachment
          On Mon, Mar 29, 2010 at 10:12 PM, mouss <mouss@...> wrote:
          > Charlie Root a écrit :
          >> I've been fighting with it for a long time but still can't get the desirable:
          >> - forward all local mail sent to valid unix users (+postmaster and
          >> abuse redirects of course) to specific email address.
          >>
          >> I.e. forward all mail sent to:
          >> [any-valid-unix-name-from-etc-passwd]@[any-ip-address-of-the-host]
          >> [valid-user]@[any-hostname-of-the-server]
          >> just [valid-user] without domain part
          >>
          >> In other words any address which local service would accept.
          >>
          >> I've tried luser_relay but it local service still desperately wants to
          >> deliver to local unix mailbox first.
          >> I've tried "mailbox_transport = virtual" and "localredir_alias_maps =
          >> static:redirect-here@..." but then virtual service failed to
          >> deliver to "redirect-here@..." with "User unknown in virtual
          >> alias table".
          >>
          >> Is it possible to setup catch-all for local mail without specifing
          >> each valid local user and/or each valid IP/hostname of the mail
          >> server?
          >>
          >
          >
          > <Untested>
          > maybe try
          >
          > real_alias_maps = hash:/etc/aliases
          > local_recipient_maps = proxy:unix:passwd.byname $real_alias_maps
          > alias_maps = static:redirect-here@...
          >
          > (without overriding "local" configuration).
          >

          It seems that local lookup for owner-$user in the alias database, and
          once the alias found (and it will as we have static:) it substitute
          Envelope From to owner-$user instead of just $user. And I have not
          found the option to override it.

          However changing static to simple regexp completely solved the issue:

          main.cf:
          real_alias_maps = hash:/etc/aliases
          local_recipient_maps = proxy:unix:passwd.byname $real_alias_maps
          alias_maps = alias_maps = regexp:/etc/postfix/catch-all-local.regexp

          catch-all-local.regexp:
          !/^owner-/ redirect-here@...

          Thanks a lot for insight!

          Dimitri.
        Your message has been successfully submitted and would be delivered to recipients shortly.