Re: Address rewriting v Virtual alias domains

2021-06-15 Thread Viktor Dukhovni
On Tue, Jun 15, 2021 at 04:16:43PM +0200, Mono DHS wrote: > Assuming that I maintain neither local domains nor relay domains, > and only virtual mailbox domains, and that You need an explicit "mydestination =" (empty) for that. Is that the case? > myorigin = $myhostname That should enable

Re: Address rewriting v Virtual alias domains

2021-06-15 Thread Wietse Venema
For practical reaons all Postfix address rewriting table lookups are case-insensitive by default(*), both for the domain and local part, regardless of what the RFCs say. (*) When creating an indexed table, the postmap command folds the input to lowercase before writing to the table, and code that

Re: Address rewriting guidance

2021-02-12 Thread Matt Shields
On Fri, Feb 12, 2021 at 12:54 PM Viktor Dukhovni wrote: > On Fri, Feb 12, 2021 at 12:06:02PM -0500, Matt Shields wrote: > > I'll take a look at all the suggestions. For below, this is just an internal server(behind firewall) with no internet facing ports. We use Office365 for corporate mail,

Re: Address rewriting guidance

2021-02-12 Thread Viktor Dukhovni
On Fri, Feb 12, 2021 at 12:06:02PM -0500, Matt Shields wrote: > 1. Rewrite the FROM address in each message > a. host1.lan has a process that sets the FROM as t...@mycompany.com, this > is okay to let relay > b. host2.lan has a script that sends as r...@host2.lan, rewrite FROM as >

Re: [Partially solved] Re: Address rewriting not working

2019-01-05 Thread Celejar
On Fri, 4 Jan 2019 15:20:08 -0500 Viktor Dukhovni wrote: > > On Jan 4, 2019, at 2:56 PM, Celejar wrote: > > > > And I'm using 3.1.8, where the rewriting isn't acceptable to my mail > > provider, and this feature isn't available ;) So I guess I'm stuck, > > unless I can upgrade Postfix? > >

Re: [Partially solved] Re: Address rewriting not working

2019-01-04 Thread Celejar
On Fri, 4 Jan 2019 15:22:08 -0500 (EST) Wietse Venema wrote: > Celejar: > > On Fri, 4 Jan 2019 13:19:10 -0500 (EST) > > Wietse Venema wrote: > > > > > Celejar: > > > > Okay, by testing with swaks I've confirmed the suspicion that I broached > > > > in my previous mail: on the problematic

Re: [Partially solved] Re: Address rewriting not working

2019-01-04 Thread Wietse Venema
Celejar: > On Fri, 4 Jan 2019 13:19:10 -0500 (EST) > Wietse Venema wrote: > > > Celejar: > > > Okay, by testing with swaks I've confirmed the suspicion that I broached > > > in my previous mail: on the problematic system, the rewrite of the email > > > header 'From: root' is to 'From: (root)',

Re: [Partially solved] Re: Address rewriting not working

2019-01-04 Thread Viktor Dukhovni
> On Jan 4, 2019, at 2:56 PM, Celejar wrote: > > And I'm using 3.1.8, where the rewriting isn't acceptable to my mail > provider, and this feature isn't available ;) So I guess I'm stuck, > unless I can upgrade Postfix? Your other option, if possible, is to inject email into Postfix with the

Re: [Partially solved] Re: Address rewriting not working

2019-01-04 Thread Celejar
On Fri, 4 Jan 2019 13:19:10 -0500 (EST) Wietse Venema wrote: > Celejar: > > Okay, by testing with swaks I've confirmed the suspicion that I broached > > in my previous mail: on the problematic system, the rewrite of the email > > header 'From: root' is to 'From: (root)', which > > causes the

[Partially solved] Re: Address rewriting not working

2019-01-04 Thread Celejar
On Wed, 2 Jan 2019 19:58:18 -0500 Viktor Dukhovni wrote: > > On Jan 2, 2019, at 7:12 PM, Celejar wrote: > > > > I'm configuring Postfix to relay mail via a smarthost, and I need to > > rewrite the sender address in order for the smarthost to accept the > > mail (and not reject it as

Re: Address rewriting not working

2019-01-03 Thread Celejar
On Wed, 2 Jan 2019 19:58:18 -0500 Viktor Dukhovni wrote: > > On Jan 2, 2019, at 7:12 PM, Celejar wrote: > > > > I'm configuring Postfix to relay mail via a smarthost, and I need to > > rewrite the sender address in order for the smarthost to accept the > > mail (and not reject it as

Re: Address rewriting not working

2019-01-02 Thread Viktor Dukhovni
> On Jan 2, 2019, at 7:12 PM, Celejar wrote: > > I'm configuring Postfix to relay mail via a smarthost, and I need to > rewrite the sender address in order for the smarthost to accept the > mail (and not reject it as 'relaying'). I'm using generic mapping to do > this, and it works correctly on

Re: Address rewriting help?

2016-09-01 Thread Noel Jones
On 8/31/2016 5:32 PM, Tom Horsley wrote: > On Wed, 31 Aug 2016 17:19:54 -0500 > Noel Jones wrote: > >> Sounds as if smtp_generic_maps may be a better fit for this than >> canonical maps. >> http://www.postfix.org/ADDRESS_REWRITING_README.html#generic > > I tried generic maps first, but that not

Re: Address rewriting help?

2016-08-31 Thread John Stoffel
> "Tom" == Tom Horsley writes: Tom> On Wed, 31 Aug 2016 18:32:03 -0400 Tom> Tom Horsley wrote: >> I'm just reading about the pickup program and the >> receive_override_options to turn off mapping. >> I think that might work, only the mail from >> fetchmail is being

Re: Address rewriting help?

2016-08-31 Thread Tom Horsley
On Wed, 31 Aug 2016 18:32:03 -0400 Tom Horsley wrote: > I'm just reading about the pickup program and the > receive_override_options to turn off mapping. > I think that might work, only the mail from > fetchmail is being locally delivered via pickup. Nah, that didn't work either, but I think I

Re: Address rewriting help?

2016-08-31 Thread Tom Horsley
On Wed, 31 Aug 2016 17:19:54 -0500 Noel Jones wrote: > Sounds as if smtp_generic_maps may be a better fit for this than > canonical maps. > http://www.postfix.org/ADDRESS_REWRITING_README.html#generic I tried generic maps first, but that not only changed the sender address, but the To: address

Re: Address rewriting help?

2016-08-31 Thread Noel Jones
On 8/31/2016 5:03 PM, Tom Horsley wrote: > I'm trying to setup a relayhost to send all my mail > through smtp.office365.com so postfix can queue it and > I don't have to stare at a "Authenticating..." dialog > box for 10 or 20 seconds. > > I actually have things mostly working. I use > this: > >

Re: Address rewriting

2016-07-06 Thread Wietse Venema
Robert Fitzpatrick: > Jul 6 13:44:39 mx1 postfix/smtpd[74447]: NOQUEUE: reject: RCPT from > mail-dm3nam03on0135.outbound.protection.outlook.com[104.47.41.135]: 450 > 4.1.8 : Sender address rejected: Domain not > found; from= to=

Re: Address rewriting

2016-07-06 Thread Viktor Dukhovni
On Wed, Jul 06, 2016 at 02:10:29PM -0400, Robert Fitzpatrick wrote: > local_header_rewrite_clients = static:all > But from the logs > > Jul 6 13:44:39 mx1 postfix/smtpd[74447]: NOQUEUE: reject: RCPT from > mail-dm3nam03on0135.outbound.protection.outlook.com[104.47.41.135]: 450 > 4.1.8

Re: Address rewriting

2016-07-06 Thread Robert Fitzpatrick
Wietse Venema wrote: Robert Fitzpatrick: local_header_rewrite_clients = static:all I'm looking for a way to rewrite by name from any client. My canonical maps work great for mynetworks, would like to apply the same type rewrite to any message... The above setting should enable canonical

Re: Address rewriting

2016-07-06 Thread Wietse Venema
Robert Fitzpatrick: > local_header_rewrite_clients = static:all > > I'm looking for a way to rewrite by name from any client. My canonical > maps work great for mynetworks, would like to apply the same type > rewrite to any message... The above setting should enable canonical mapping for all

Re: Address rewriting

2016-07-06 Thread Robert Fitzpatrick
Wietse Venema wrote: Robert Fitzpatrick: I have been using canonical_maps for some time to map local addresses, but that doesn't seem to work for incoming mail. The message is coming from another Postfix server with the sender specified with the hostname of the machine See

Re: Address rewriting

2016-07-06 Thread Robert Fitzpatrick
Wietse Venema wrote: Robert Fitzpatrick: I have been using canonical_maps for some time to map local addresses, but that doesn't seem to work for incoming mail. The message is coming from another Postfix server with the sender specified with the hostname of the machine See

Re: Address rewriting

2016-07-06 Thread Wietse Venema
Robert Fitzpatrick: > I have been using canonical_maps for some time to map local addresses, > but that doesn't seem to work for incoming mail. The message is coming > from another Postfix server with the sender specified with the hostname > of the machine See

Re: Address Rewriting vs Aliasing - I need all recipients to see each other

2014-02-02 Thread Dominik George
Hi Charles, Currently, if I set up the alias, each recipient only sees themselves as the recipient, but I need all recipients to see each other, so each knows the other received it. I do not quite understand that. Normally, when you use a simple alias, no adresses are rewritten, so the

Re: Address Rewriting vs Aliasing - I need all recipients to see each other

2014-02-02 Thread Charles Marcus
Thanks for the reply Dominik, but... On 2014-02-02 9:17 AM, Dominik George n...@naturalnet.de wrote: Currently, if I set up the alias, each recipient only sees themselves as the recipient, but I need all recipients to see each other, so each knows the other received it. I do not quite

Re: Address Rewriting vs Aliasing - I need all recipients to see each other

2014-02-02 Thread Viktor Dukhovni
On Sun, Feb 02, 2014 at 09:06:03AM -0500, Charles Marcus wrote: I want to set up an email alias for my domain, ie: facilit...@example.com That sends the email to two (or more) external addresses: us...@example2.com us...@example2.com Currently, if I set up the alias, each recipient

Re: Address rewriting

2012-07-19 Thread Noel Jones
On 7/19/2012 4:11 PM, lutz.niede...@gmx.net wrote: Hi! We do have several domains listed with mydomains. The users are the same for all domains and exist locally, means mail gets delivered locally. Aliases file is used to expand to lists of recipients. This works ok and we only have

Re: address rewriting

2012-03-04 Thread dino muzic
From: Wietse Venema wie...@porcupine.org To: Postfix users postfix-users@postfix.org Sent: Saturday, March 3, 2012 3:55 PM Subject: Re: address rewriting dino muzic: how can I do this? 1) inside server = postfix = outside: from:user1@mydomain.local? to:us...@yahoo.com??= POSTFIX

Re: address rewriting

2012-03-04 Thread /dev/rob0
Please do not top-post your replies. Thank you. On Sun, Mar 04, 2012 at 05:17:30AM -0800, dino muzic wrote: 1) inside server = postfix = outside works fine! 2) outside = postfix = inside server What is this inside server? What is the role of Postfix supposed to be? Perhaps you don't

Re: address rewriting

2012-03-04 Thread Wietse Venema
dino muzic: 2) outside = postfix = inside server doesn't, because generic is rewriting user1@mydomain.local back to us...@mydomain.com before relaying it to inside server Postfix uses different SMTP mail delivery agents for inbound mail and outbound. If the destination is in relay_domains,

Re: address rewriting

2012-03-04 Thread dino muzic
Thanks Wietse! it works! dm From: Wietse Venema wie...@porcupine.org To: Postfix users postfix-users@postfix.org Sent: Sunday, March 4, 2012 3:14 PM Subject: Re: address rewriting dino muzic: 2) outside = postfix = inside server doesn't, because generic

Re: address rewriting

2012-03-03 Thread Wietse Venema
dino muzic: how can I do this? 1) inside server = postfix = outside: from:user1@mydomain.local? to:us...@yahoo.com??= POSTFIX = from:us...@mydomain.com to:us...@yahoo.com ? http://www.postfix.org/SOHO_README.html 2) outside = postfix = inside server from:us...@yahoo.com to:us...@mydomain.com =

Re: Re: Address Rewriting for relayed emails

2010-12-02 Thread Michael . H . Grimm
Thanks for the config hint. It works fine if I add an email address like this to generic laserjetscan...@domain.local notificati...@domain.com It does not work if I want to do the following: @domain.com notificati...@domain.com It then appears to rewrite the recipients address as well and

Re: Address Rewriting for relayed emails

2010-12-02 Thread Jeroen Geilman
On 12/02/2010 10:10 AM, michael.h.gr...@googlemail.com wrote: Thanks for the config hint. It works fine if I add an email address like this to generic laserjetscan...@domain.local notificati...@domain.com It does not work if I want to do the following: @domain.com notificati...@domain.com

Re: Address Rewriting for relayed emails

2010-12-02 Thread Victor Duchovni
On Thu, Dec 02, 2010 at 05:23:33PM +0100, Jeroen Geilman wrote: On 12/02/2010 10:10 AM, michael.h.gr...@googlemail.com wrote: Thanks for the config hint. It works fine if I add an email address like this to generic laserjetscan...@domain.local notificati...@domain.com It does not work if

Re: Address Rewriting for relayed emails

2010-11-29 Thread Noel Jones
On 11/29/2010 9:24 AM, michael.h.gr...@googlemail.com wrote: Dear all, Is it possible to configure postfix for the following scenario? Our ERP-System wants to send emails over a dedicated account to it's users. As it tries to send the email as the current user, using the users address, the

Re: Address Rewriting for relayed emails

2010-11-29 Thread John Adams
Am 29.11.2010 16:24, schrieb michael.h.gr...@googlemail.com: Dear all, Is it possible to configure postfix for the following scenario? Our ERP-System wants to send emails over a dedicated account to it's users. As it tries to send the email as the current user, using the users address, the

Re: address rewriting with regexp

2010-02-10 Thread Noel Jones
On 2/10/2010 1:38 AM, Andy Smith wrote: hello, maybe someone here can help. I am trying to rewrite a certain set of To address with regex when they are sent outbound from my mail server. I am trying to do the following: Can you rewrite this to 123456789@ smscountry.net http://smscountry.net

Re: address rewriting with regexp

2010-02-10 Thread Andy Smith
ok i have put that in canonical and when the rewrite occurs i get a log that looks like this Feb 10 16:52:45 dal1-svc-12 postfix/smtp[13697]: 9E4FA26FB8:

Re: address rewriting with regexp

2010-02-10 Thread Bill Weiss
Andy Smith(flapjack2...@gmail.com)@Wed, Feb 10, 2010 at 11:01:05AM -0600: ok i have put that in canonical and when the rewrite occurs i get a log that looks like this Feb 10 16:52:45 dal1-svc-12 postfix/smtp[13697]: 9E4FA26FB8:

Re: address rewriting with regexp

2010-02-10 Thread Bill Weiss
Bill Weiss(houdini+post...@clanspum.net)@Wed, Feb 10, 2010 at 11:08:08AM -0600: Andy Smith(flapjack2...@gmail.com)@Wed, Feb 10, 2010 at 11:01:05AM -0600: ok i have put that in canonical and when the rewrite occurs i get a log that looks like this Feb 10 16:52:45 dal1-svc-12

Re: address rewriting with regexp

2010-02-10 Thread Noel Jones
Please don't top-post. On 2/10/2010 11:01 AM, Andy Smith wrote: ok i have put that in canonical and when the rewrite occurs i get a log that looks like this Feb 10 16:52:45 dal1-svc-12 postfix/smtp[13697]: 9E4FA26FB8:

Re: address rewriting with regexp

2010-02-10 Thread Andy Smith
On Wed, Feb 10, 2010 at 11:08 AM, Bill Weiss houdini+post...@clanspum.net wrote: Bill Weiss(houdini+post...@clanspum.net)@Wed, Feb 10, 2010 at 11:08:08AM -0600: Andy Smith(flapjack2...@gmail.com)@Wed, Feb 10, 2010 at 11:01:05AM -0600: ok i have put that in canonical and when the rewrite

Re: Address rewriting problem

2010-02-04 Thread Barney Desmond
On 4 February 2010 20:23, Guy wyldf...@gmail.com wrote: The problem I get is that when sending to t...@lists.domain2.net I get this bounce message: lists.domain2.net=t...@domain1.org: mail for domain1.org loops back to myself Can you post the output of `postconf -n`? I suspect domain1.org is

Re: Address rewriting problem

2010-02-04 Thread Guy
On 4 February 2010 10:12, Barney Desmond barneydesm...@gmail.com wrote: Can you post the output of `postconf -n`? I suspect domain1.org is meant to be listed in your $mydestination, but isn't (there's plenty of possible causes for this problem, which is configuration-dependent). postconf -n

Re: Address rewriting problem

2010-02-04 Thread Barney Desmond
On 4 February 2010 21:29, Guy wyldf...@gmail.com wrote: On 4 February 2010 10:12, Barney Desmond barneydesm...@gmail.com wrote: Can you post the output of `postconf -n`? I suspect domain1.org is meant to be listed in your $mydestination, but isn't (there's plenty of possible causes for this

Re: address rewriting

2009-12-30 Thread Victor Duchovni
On Wed, Dec 30, 2009 at 01:58:32AM +0100, Christoph Anton Mitterer wrote: - When validating the recipients, normalisation and all other rewritings (canonical and virtual aliases) are taken into account? Is it here where the probe messages are sent? No probe messages. Don't confuse passive

Re: address rewriting

2009-12-29 Thread Christoph Anton Mitterer
On Tue, 2009-12-29 at 01:11 -0500, Victor Duchovni wrote: No, it means that address *normalization* to standard form is done at least three times: - smtpd resolve envelope addresses to (transport, nexthop, standard form) for access

Re: address rewriting

2009-12-29 Thread Christoph Anton Mitterer
On Tue, 2009-12-29 at 17:29 -0500, Victor Duchovni wrote: Adding example.com (or remote.domain) to mydestination above should mean that ONLY existing local user@example.com (or @remote.domain or @address literal is accepted, right? No. It means that example.com becomes a local domain. Ok,..

Re: address rewriting

2009-12-28 Thread Victor Duchovni
On Mon, Dec 28, 2009 at 12:00:34AM +0100, Christoph Anton Mitterer wrote: Hi. I'm still trying to understand some things, so perhaps some of you could help me. 1) As far as I understood the address rewriting manual, rewriting (including the app...@origin and append.domain) happens in

Re: address rewriting

2009-12-28 Thread Christoph Anton Mitterer
On Mon, 2009-12-28 at 14:27 -0500, Victor Duchovni wrote: The trivial-rewrite service does the rewriting, and the cleanup service updates the queue-file updating addresses in headers, ... No, but smtpd(8) uses normalized (via trivial-rewrite) recipient and sender addresses to make access

Re: address rewriting

2009-12-28 Thread Victor Duchovni
On Tue, Dec 29, 2009 at 12:59:13AM +0100, Christoph Anton Mitterer wrote: On Mon, 2009-12-28 at 14:27 -0500, Victor Duchovni wrote: The trivial-rewrite service does the rewriting, and the cleanup service updates the queue-file updating addresses in headers, ... No, but smtpd(8) uses

Re: address rewriting

2009-12-27 Thread Christoph Anton Mitterer
Hi. I'm still trying to understand some things, so perhaps some of you could help me. 1) As far as I understood the address rewriting manual, rewriting (including the app...@origin and append.domain) happens in cleanup/trivial-rewrite, right? But I have the impression that at least some

Re: address rewriting for remote clients

2009-12-24 Thread Christoph Anton Mitterer
Hi Noel! Quoting Noel Jones njo...@megan.vbhcs.org: Of course I understand that mail does not guarantee sender authenticity but this is still a security problem, isn't it? I mean it's easily possible to reject reject_non_fqdn_sender and I think even envelope sender addresses that match any of

Re: address rewriting for remote clients

2009-12-24 Thread Christoph Anton Mitterer
Quoting Noel Jones njo...@megan.vbhcs.org: To insure that local users aren't confused by a HEADER that looks as if it came from the local domain, I use remote_header_rewrite_domain = domain.invalid Ah and by the way: This does not help if the remote user specifies a fully qualified address

Re: address rewriting for remote clients

2009-12-23 Thread Wietse Venema
Christoph Anton Mitterer: Hi. As far as I understood the documentation, if those two are at their default: local_header_rewrite_clients = permit_inet_interfaces remote_header_rewrite_domain = local clients are subject to address rewriting, but remote ones are not. Please pay attention. The

Re: address rewriting for remote clients

2009-12-23 Thread Christoph Anton Mitterer
Hi list. Sorry for asking questions again ;) Quoting Wietse Venema wie...@porcupine.org: As far as I understood the documentation, if those two are at their default: local_header_rewrite_clients = permit_inet_interfaces remote_header_rewrite_domain = local clients are subject to address

Re: address rewriting for remote clients

2009-12-23 Thread Wietse Venema
Christoph Anton Mitterer: - Header sender and recipient addresses are always rewritten for local clients (depending on local_header_rewrite_clients) and for remote clients only if remote_header_rewrite_domain is not empty. Indeed. The feature is called HEADER rewriting. This is called

Re: address rewriting for remote clients

2009-12-23 Thread Christoph Anton Mitterer
Hi. btw: Thanks for your efforts in answering my questions, and sorry for posting to -devel before (did not notice in the beginning, that this is not meant for bug/feature reports). Quoting Wietse Venema wie...@porcupine.org: clients (depending on local_header_rewrite_clients) and for

Re: address rewriting for remote clients

2009-12-23 Thread Noel Jones
On 12/23/2009 7:30 PM, Christoph Anton Mitterer wrote: Hi. btw: Thanks for your efforts in answering my questions, and sorry for posting to -devel before (did not notice in the beginning, that this is not meant for bug/feature reports). Quoting Wietse Venema wie...@porcupine.org: clients

Re: Address rewriting to include GECOS

2009-07-28 Thread Wietse Venema
Olivier Nicole: Hi, I read and re-read the address-rewriting readme and coul dnot find any indication on the way to rewrite addresses to include GECOS information: o...@cs.ait.ac.th = Olivier Nicole o...@cs.ait.ac.th Display names are the responsibility of the mail user agent. Is that

Re: address rewriting with pcre?

2009-03-21 Thread mouss
Charles Marcus a écrit : On 3/17/2009, LuKreme (krem...@kreme.com) wrote: On 17-Mar-2009, at 06:09, Erwan David wrote: I would fear it breaks recipient validation, accepting mail for eavery address with a _ as valid. That is a drawback. Oh... well, if it does indeed do what Erwan said,

Re: address rewriting with pcre?

2009-03-21 Thread mouss
Victor Duchovni a écrit : On Sat, Mar 21, 2009 at 03:19:44PM +0100, mouss wrote: Charles Marcus a ?crit : On 3/17/2009, LuKreme (krem...@kreme.com) wrote: On 17-Mar-2009, at 06:09, Erwan David wrote: I would fear it breaks recipient validation, accepting mail for eavery address with a _ as

Re: address rewriting with pcre?

2009-03-21 Thread Victor Duchovni
On Sat, Mar 21, 2009 at 07:31:24PM +0100, mouss wrote: alternatively, you can add an smtpd in the chain using proxy_filter: - smtpd on port 25 does the rewrite. it then uses proxy_filter to pass mail to an smtpd on port 10020. Rewriting is done by cleanup(8). This can't work. I

Re: address rewriting with pcre?

2009-03-21 Thread mouss
Victor Duchovni a écrit : On Sat, Mar 21, 2009 at 07:31:24PM +0100, mouss wrote: alternatively, you can add an smtpd in the chain using proxy_filter: - smtpd on port 25 does the rewrite. it then uses proxy_filter to pass mail to an smtpd on port 10020. Rewriting is done by cleanup(8). This

Re: address rewriting with pcre?

2009-03-19 Thread LuKreme
On 17-Mar-2009, at 08:52, Victor Duchovni wrote: On Tue, Mar 17, 2009 at 10:01:53AM -0400, Charles Marcus wrote: On 3/17/2009 9:43 AM, Erwan David wrote: You may generate the pcre file with a line /recipient_([...@_]+)@localdomain/recipient+$...@localdomain for each valid recipient. This

Re: address rewriting with pcre?

2009-03-19 Thread LuKreme
On 19-Mar-2009, at 04:14, Charles Marcus wrote: On 3/19/2009 5:55 AM, LuKreme wrote: I came up with this one liner: $ ls -1 /usr/local/virtual/ | grep @ | sed 's/^\([...@]*\)@\(.*\)$/\/^\1_\(.*\)@\2$\/ \1+$...@\2/' testu...@example.com = /^testuser_(.*)@example.com$/ testuser+$...@example.com

Re: address rewriting with pcre?

2009-03-19 Thread Wietse Venema
LuKreme: On 17-Mar-2009, at 08:52, Victor Duchovni wrote: On Tue, Mar 17, 2009 at 10:01:53AM -0400, Charles Marcus wrote: On 3/17/2009 9:43 AM, Erwan David wrote: You may generate the pcre file with a line /recipient_([...@_]+)@localdomain/recipient+$...@localdomain for each valid

Re: address rewriting with pcre?

2009-03-19 Thread Charles Marcus
On 3/19/2009 5:55 AM, LuKreme wrote: You may generate the pcre file with a line /recipient_([...@_]+)@localdomain/recipient+$...@localdomain for each valid recipient. This would preserve the validation of recipient at RCPT TO stage. Interesting... and maybe a good candidate for my first

Re: address rewriting with pcre?

2009-03-19 Thread LuKreme
On 19-Mar-2009, at 04:45, Wietse Venema wrote: $ ls -1 /usr/local/virtual/ | grep @ | sed 's/^\([...@]*\)@\(.*\)$/ \/ ^\1_\(.*\)@\2$\/ \1+$...@\2/' testu...@example.com = /^testuser_(.*)@example.com$/ testuser+$...@example.com This is BROKEN. You are not escaping any of the regexp

Re: address rewriting with pcre?

2009-03-19 Thread Wietse Venema
LuKreme: On 19-Mar-2009, at 04:45, Wietse Venema wrote: $ ls -1 /usr/local/virtual/ | grep @ | sed 's/^\([...@]*\)@\(.*\)$/ \/ ^\1_\(.*\)@\2$\/ \1+$...@\2/' testu...@example.com = /^testuser_(.*)@example.com$/ testuser+$...@example.com This is BROKEN. You are not escaping any

Re: address rewriting with pcre?

2009-03-17 Thread LuKreme
On 17-Mar-2009, at 04:24, Robert Brooks wrote: So, what I'd like to do if it's possible, is rewrite f...@bar.example.com to bar+...@example.com. I rewrite foo_...@example.com to foo+...@example.com virtaul.pcre: /^(.*)_(.*)@example.com$/${1}+$...@example.com virtual_alias_maps =

Re: address rewriting with pcre?

2009-03-17 Thread Robert Brooks
LuKreme wrote: I rewrite foo_...@example.com to foo+...@example.com virtaul.pcre: /^(.*)_(.*)@example.com$/${1}+$...@example.com virtual_alias_maps = hash:$config_directory/virtual pcre:$config_directory/virtual.pcre, mysql:$config_directory/mysql_virtual_alias_maps.cf your

Re: address rewriting with pcre?

2009-03-17 Thread Charles Marcus
On 3/17/2009 6:47 AM, LuKreme wrote: I rewrite foo_...@example.com to foo+...@example.com virtaul.pcre: /^(.*)_(.*)@example.com$/${1}+$...@example.com virtual_alias_maps = hash:$config_directory/virtual pcre:$config_directory/virtual.pcre,

Re: address rewriting with pcre?

2009-03-17 Thread Erwan David
On Tue, Mar 17, 2009 at 12:01:13PM CET, Charles Marcus cmar...@media-brokers.com said: On 3/17/2009 6:47 AM, LuKreme wrote: I rewrite foo_...@example.com to foo+...@example.com virtaul.pcre: /^(.*)_(.*)@example.com$/${1}+$...@example.com virtual_alias_maps =

Re: address rewriting with pcre?

2009-03-17 Thread LuKreme
On 17-Mar-2009, at 05:01, Charles Marcus wrote: (not sure if using the 'or' vertical bar will work as expected here) It's a PCRE. As long as the PCRE is valid it should work. -- RTFM replies are great, but please specify exactly which FM to R

Re: address rewriting with pcre?

2009-03-17 Thread LuKreme
On 17-Mar-2009, at 06:09, Erwan David wrote: I would fear it breaks recipient validation, accepting mail for eavery address with a _ as valid. That is a drawback. The other choice is to change the delimiter in postfix to _ and rewrite it to accept all '+' addresses to '_'. The trouble is

Re: address rewriting with pcre?

2009-03-17 Thread Charles Marcus
On 3/17/2009, LuKreme (krem...@kreme.com) wrote: On 17-Mar-2009, at 06:09, Erwan David wrote: I would fear it breaks recipient validation, accepting mail for eavery address with a _ as valid. That is a drawback. Oh... well, if it does indeed do what Erwan said, it isn't just a drawback, it

Re: address rewriting with pcre?

2009-03-17 Thread LuKreme
On 17-Mar-2009, at 07:30, Charles Marcus wrote: So, is there no way to rewrite the recipient and *then* validate it? Sure, but not until after you've accepted the message. It's not like ziggy_test gets delivered to some random user. It's just that it generates a bounce instead of a reject.

Re: address rewriting with pcre?

2009-03-17 Thread Charles Marcus
On 3/17/2009, LuKreme (krem...@kreme.com) wrote: On 17-Mar-2009, at 07:30, Charles Marcus wrote: So, is there no way to rewrite the recipient and *then* validate it? Sure, but not until after you've accepted the message. Ummm... WRONG. Recipient VALIDATION, by DEFINITION, must occur BEFORE a

Re: address rewriting with pcre?

2009-03-17 Thread LuKreme
On 17-Mar-2009, at 07:39, Charles Marcus wrote: On 3/17/2009, LuKreme (krem...@kreme.com) wrote: It's not like ziggy_test gets delivered to some random user. It's just that it generates a bounce instead of a reject. Like I said, this is unacceptable (makes you a backscatter source). Then

Re: address rewriting with pcre?

2009-03-17 Thread Erwan David
On Tue, Mar 17, 2009 at 02:39:08PM CET, Charles Marcus cmar...@media-brokers.com said: On 3/17/2009, LuKreme (krem...@kreme.com) wrote: On 17-Mar-2009, at 07:30, Charles Marcus wrote: So, is there no way to rewrite the recipient and *then* validate it? Sure, but not until after you've

Re: address rewriting with pcre?

2009-03-17 Thread Charles Marcus
On 3/17/2009 9:43 AM, Erwan David wrote: You may generate the pcre file with a line /recipient_([...@_]+)@localdomain/recipient+$...@localdomain for each valid recipient. This would preserve the validation of recipient at RCPT TO stage. Interesting... and maybe a good candidate for my

Re: address rewriting with pcre?

2009-03-17 Thread LuKreme
On 17-Mar-2009, at 08:01, Charles Marcus wrote: On 3/17/2009 9:43 AM, Erwan David wrote: You may generate the pcre file with a line /recipient_([...@_]+)@localdomain/recipient+$...@localdomain for each valid recipient. This would preserve the validation of recipient at RCPT TO stage.

Re: address rewriting with pcre?

2009-03-17 Thread Victor Duchovni
On Tue, Mar 17, 2009 at 10:01:53AM -0400, Charles Marcus wrote: On 3/17/2009 9:43 AM, Erwan David wrote: You may generate the pcre file with a line /recipient_([...@_]+)@localdomain/recipient+$...@localdomain for each valid recipient. This would preserve the validation of

Re: address rewriting with pcre?

2009-03-17 Thread Erwan David
On Tue, Mar 17, 2009 at 03:52:27PM CET, Victor Duchovni victor.ducho...@morganstanley.com said: On Tue, Mar 17, 2009 at 10:01:53AM -0400, Charles Marcus wrote: On 3/17/2009 9:43 AM, Erwan David wrote: You may generate the pcre file with a line /recipient_([...@_]+)@localdomain/

Re: Address rewriting

2008-09-16 Thread mouss
Henrik Friedrichsen wrote: Hey, a .ws sender? oh welcome!! I have set up a postfix server on FreeBSD 7.0. Almost everything works fine, but there are a few issues I need to sort out: 1) I want postfix to enforce the sender domain to one of ~3 domains. If the sender address domain set

Re: Address rewriting

2008-09-16 Thread Victor Duchovni
On Tue, Sep 16, 2008 at 07:17:40PM +0200, Henrik Friedrichsen wrote: Hey, I have set up a postfix server on FreeBSD 7.0. Almost everything works fine, but there are a few issues I need to sort out: 1) I want postfix to enforce the sender domain to one of ~3 domains. If the sender

Re: Address rewriting

2008-09-16 Thread Henrik Friedrichsen
On Tue, Sep 16, 2008 at 01:53:08PM -0400, Victor Duchovni wrote: Would it not be better to reject the mail? How do you that: [EMAIL PROTECTED] should be [EMAIL PROTECTED] instead? Or are you looking to masquerade sub-domains, or something else more sensible? Something like

Re: Address rewriting

2008-09-16 Thread Henrik Friedrichsen
On Tue, Sep 16, 2008 at 03:12:16PM -0400, Victor Duchovni wrote: On Tue, Sep 16, 2008 at 09:04:00PM +0200, Henrik Friedrichsen wrote: On Tue, Sep 16, 2008 at 01:53:08PM -0400, Victor Duchovni wrote: Would it not be better to reject the mail? How do you that: [EMAIL PROTECTED]

Re: Address rewriting

2008-09-16 Thread Victor Duchovni
On Tue, Sep 16, 2008 at 09:18:42PM +0200, Henrik Friedrichsen wrote: masquerading *all* sender domains is unwise, there is no reason to expect equivalent name-spaces in domains you do not own. A regexp canonical table can do this, with canonical_classes restricted to envelope_sender.

Re: Address rewriting

2008-09-16 Thread Henrik Friedrichsen
On Tue, Sep 16, 2008 at 03:45:52PM -0400, Victor Duchovni wrote: On Tue, Sep 16, 2008 at 09:18:42PM +0200, Henrik Friedrichsen wrote: masquerading *all* sender domains is unwise, there is no reason to expect equivalent name-spaces in domains you do not own. A regexp canonical table can