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

Re: "Sender-Dependent Aliases"

Expand Messages
  • t t
    Cool, thanks for the response. I m in the process of setting this up right now, but while I do that, I have a couple quick questions: 1) This seems like it
    Message 1 of 7 , May 31, 2012
    View Source
    • 0 Attachment
      Cool, thanks for the response. I'm in the process of setting this up right now, but while I do that, I have a couple quick questions:

      1) This seems like it might redirect all mail coming from from_address@domain to new_to_address@anotherdomain. That's not quite what I want. In my first example, person1@... might be subscribed to more than one mailing list, so I need to redirect based both on the sender and the mailing list. I can see that this wasn't clear from my first email, so sorry about that. To be absolutely clear,

      an email from person1@... to mailman@... should go to mailman1@...,

      an email from person1@... to another_list@... should go to another_list1@...,

      an email from person2@... to mailman@... should go tomailman2@...

      2) I assume it's possible to enter the redirect mappings into a mysql database directly, rather than write the mapping in a file, right? (e.g.: I enter my aliases in the way described here: http://flurdy.com/docs/postfix/#data)


      Thanks for your help!

      On Thu, May 31, 2012 at 9:36 AM, Robert Wysocki <robert.wysocki@...> wrote:
      Dnia 2012-05-30, śro o godzinie 22:08 +0100, t t pisze:
      > Hi,
      >
      >
      > I'm using postfix aliases for mapping incoming emails to my mailman
      > mailing lists, as described in the "Adding MySQL aliases" of this
      > guide:
      >
      >
      > http://freemars.org/howto/mailman.html#conadd
      >
      >
      > What I'd like to do is to make this mapping sender-dependent. For
      > instance, a mail from person1@... to mailman@... should
      > go to mailman1@..., but a mail from person2@... to
      > mailman@... should go to mailman2@.... (Here,
      > mailman1 and mailman2 are two completely separate mailing lists.)
      >
      >
      > Is there a simple way to configure postfix to do this? I've seen the
      > sender dependent functionality like sender dependent transport map,
      > but I'm still a little unclear about how to accomplish what I want.
      >
      >
      > I'm sorry if this turns out to be trivial. I've been searching around
      > for a couple hours for an answer to this question to no avail, so I
      > figured I'd ask here.
      >
      >
      Hi t t,

      You can use sender-dependant aliases like that:

      main.cf:

      smtpd_sender_restrictions = check_sender_access
      hash:/etc/postfix/sender_access

      sender_access:
      from_address@domain redirect new_to_address@anotherdomain


      Regards,
      --
      Robert Wysocki
      administrator systemów linuksowych
      Contium S.A., http://www.contium.pl



    • Noel Jones
      ... Yes, the REDIRECT action affects all recipients of a message. Postfix does not support true sender-based aliasing. Maybe you can find a milter that will do
      Message 2 of 7 , May 31, 2012
      View Source
      • 0 Attachment
        On 5/31/2012 4:01 AM, t t wrote:
        > Cool, thanks for the response. I'm in the process of setting this up
        > right now, but while I do that, I have a couple quick questions:
        >
        > 1) This seems like it might redirect /all/ mail coming
        > from from_address@domain to new_to_address@anotherdomain. That's not
        > quite what I want. In my first example, person1@...

        Yes, the REDIRECT action affects all recipients of a message.
        Postfix does not support true sender-based aliasing.

        Maybe you can find a milter that will do what you need.

        > 2) I assume it's possible to enter the redirect mappings into a
        > mysql database directly, rather than write the mapping in a file,

        Postfix is table-type agnostic; any function that supports table
        lookups can use any table type (although some choices might not make
        much sense).


        -- Noel Jones
      • Christian Meier
        Hi, On Thu, 31 May 2012 10:01:07 +0100 ... address rewriting is possible with qpsmtpd. The disadvantage is that it s a second smtpd, but it works. - Chris
        Message 3 of 7 , May 31, 2012
        View Source
        • 0 Attachment
          Hi,

          On Thu, 31 May 2012 10:01:07 +0100
          t t <tt640014@...> wrote:

          > so I need to redirect based both on the sender and
          > the mailing list

          address rewriting is possible with qpsmtpd. The disadvantage is that it's a second smtpd, but it works.

          - Chris
        • Robert Wysocki
          ... You can use REDIRECT to a local account and then use .procmailrc to do additional forwarding. If I remember correctly, REDIRECT doesn t affect original To:
          Message 4 of 7 , May 31, 2012
          View Source
          • 0 Attachment
            Dnia 2012-05-31, czw o godzinie 10:01 +0100, t t pisze:

            > an email from person1@... to mailman@... should go
            > to mailman1@...,
            >
            >
            > an email from person1@... to another_list@... should go
            > to another_list1@...,
            >
            >
            > an email from person2@... to mailman@... should go
            > tomailman2@...
            >

            You can use REDIRECT to a local account and then use .procmailrc to do
            additional forwarding.
            If I remember correctly, REDIRECT doesn't affect original To: header.

            >
            > 2) I assume it's possible to enter the redirect mappings into a mysql
            > database directly, rather than write the mapping in a file, right?
            > (e.g.: I enter my aliases in the way described
            > here: http://flurdy.com/docs/postfix/#data)
            >
            >
            Surely it's possible. Never done it though.

            Regards,

            --
            Robert Wysocki
            administrator systemów linuksowych
            Contium S.A., http://www.contium.pl
          • t t
            Ok, cool, thanks everyone. I checked out qpsmtpd but couldn t really find resources explaining how to do address rewriting; maybe I m supposed to write my own
            Message 5 of 7 , Jun 1, 2012
            View Source
            • 0 Attachment
              Ok, cool, thanks everyone. 

              I checked out qpsmtpd but couldn't really find resources explaining how to do address rewriting; maybe I'm supposed to write my own perl script to do it. (I don't know perl, but if this is actually an easy solution and you can link me to somewhere that explains how to do it or something similar, I'd definitely be interested.)

              Writing a procmail recipe looks pretty simple, so that might be good.

              One concern with the procmail solution is that I'm going to be programmatically adding users to Mailman mailing lists. It would seem, therefore, that I would need to alter the procmailrc file programmatically too. This is easily accomplished, but I wonder if this isn't a very robust solution. I'd rather be adding entries to a database, for instance, than altering a file. I'm worried about how well a solution that relies on writing to a file will scale, as well as whether I'm going to run into concurrency problems if multiple processes try to write the file simultaneously. 

              I'm sure you all have much more experience writing software than I do, so your advice would be appreciated.

              Thanks!

              On Fri, Jun 1, 2012 at 6:59 AM, Robert Wysocki <robert.wysocki@...> wrote:
              Dnia 2012-05-31, czw o godzinie 10:01 +0100, t t pisze:

              > an email from person1@... to mailman@... should go
              > to mailman1@...,
              >
              >
              > an email from person1@... to another_list@... should go
              > to another_list1@...,
              >
              >
              > an email from person2@... to mailman@... should go
              > tomailman2@...
              >

              You can use REDIRECT to a local account and then use .procmailrc to do
              additional forwarding.
              If I remember correctly, REDIRECT doesn't affect original To: header.

              >
              > 2) I assume it's possible to enter the redirect mappings into a mysql
              > database directly, rather than write the mapping in a file, right?
              > (e.g.: I enter my aliases in the way described
              > here: http://flurdy.com/docs/postfix/#data)
              >
              >
              Surely it's possible. Never done it though.

              Regards,

              --
              Robert Wysocki
              administrator systemów linuksowych
              Contium S.A., http://www.contium.pl



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