Re: Sender-Dependent Aliases
Dnia 2012-05-31, czw o godzinie 10:01 +0100, t t pisze: an email from pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com, an email from pers...@gmail.com to another_l...@example.com should go to another_li...@lists.example.com, an email from pers...@gmail.com to mail...@example.com should go tomailm...@lists.example.com 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
Re: Sender-Dependent Aliases
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.wyso...@contium.plwrote: Dnia 2012-05-31, czw o godzinie 10:01 +0100, t t pisze: an email from pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com, an email from pers...@gmail.com to another_l...@example.com should go to another_li...@lists.example.com, an email from pers...@gmail.com to mail...@example.com should go tomailm...@lists.example.com 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
Re: Sender-Dependent Aliases
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 pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com, but a mail from pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com. (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
Re: Sender-Dependent Aliases
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, pers...@gmail.com 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 pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com, an email from pers...@gmail.com to another_l...@example.com should go to another_li...@lists.example.com mailm...@lists.example.com, an email from pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com 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.wyso...@contium.plwrote: 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 pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com, but a mail from pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com. (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
Re: Sender-Dependent Aliases
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, pers...@gmail.com 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
Re: Sender-Dependent Aliases
Hi, On Thu, 31 May 2012 10:01:07 +0100 t t tt640...@gmail.com 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
Sender-Dependent Aliases
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 pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com, but a mail from pers...@gmail.com to mail...@example.com should go to mailm...@lists.example.com. (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. Thanks!