From: Noel Jones on
On 5/19/2010 10:42 AM, Phil Howard wrote:
> I want to translate a domain (foo.myohiovalley.net
> <http://foo.myohiovalley.net>) to another domain (myohiovalley.net
> <http://myohiovalley.net>) such that for all users
> (xyzzy(a)foo.myohiovalley.net <mailto:xyzzy(a)foo.myohiovalley.net>) they
> will be delivered (I'm using virtual_mailbox_domains, etc) as in the
> target domain (xyzzy(a)myohiovalley.net <mailto:xyzzy(a)myohiovalley.net>).
> I thought this would be accomplished by putting "foo.myohiovalley.net
> <http://foo.myohiovalley.net>" in virtual_alias_domains and mapping
> "foo.myohiovalley.net <http://foo.myohiovalley.net>" to
> "myohiovalley.net <http://myohiovalley.net>" in virtual_alias_maps. But
> that isn't happening as expected. I tried mapping an actual user
> "xyzzy(a)foo.myohiovalley.net <mailto:xyzzy(a)foo.myohiovalley.net>" to
> "xyzzy(a)myohiovalley.net <mailto:xyzzy(a)myohiovalley.net>" and that
> actually did work. But I want to do this by domain name only so I don't
> end up with <number_of_domains> times <number_of_users> mapping entries.


The correct way to do this is a 1-1
user(a)foo.example.com user(a)example.com
mapping. Use a script to generate the required tables and
don't worry about the number of entries.

While postfix does support wildcard domain > domain rewriting,
it is highly discouraged because it disables recipient
validation -- that tends to fill your queue with undeliverable
mail and will get you blacklisted as a backscatter source.

As an alternative, you may be able to use smtp_generic_maps to
rewrite the destination domain on the fly during delivery. See:
http://www.postfix.org/ADDRESS_REWRITING_README.html#generic

-- Noel Jones

From: Phil Howard on
On Wed, May 19, 2010 at 12:10, Noel Jones <njones(a)megan.vbhcs.org> wrote:

> While postfix does support wildcard domain > domain rewriting, it is highly
> discouraged because it disables recipient validation -- that tends to fill
> your queue with undeliverable mail and will get you blacklisted as a
> backscatter source.
>

So it doesn't perform any form of domain-only mapping at RCPT TO time?

What about a regexp form like:

/^(.*)@example\.com$/ ${1}@example.net <1%7D(a)example.net>

?



> As an alternative, you may be able to use smtp_generic_maps to rewrite the
> destination domain on the fly during delivery. See:
> http://www.postfix.org/ADDRESS_REWRITING_README.html#generic
>

I do want the username checked during SMTP arrival time. Will it do so for
the virtual_alias_maps if I use regexp: format?
From: Reinaldo de Carvalho on
On Wed, May 19, 2010 at 3:45 PM, Phil Howard <ttiphil(a)gmail.com> wrote:
> On Wed, May 19, 2010 at 12:10, Noel Jones <njones(a)megan.vbhcs.org> wrote:
>>
>> While postfix does support wildcard domain > domain rewriting, it is
>> highly discouraged because it disables recipient validation -- that tends to
>> fill your queue with undeliverable mail and will get you blacklisted as a
>> backscatter source.
>
> So it doesn't perform any form of domain-only mapping at RCPT TO time?
>
> What about a regexp form like:
>
> /^(.*)@example\.com$/ ${1}@example.net
>

No substitution supported.

>
> I do want the username checked during SMTP arrival time.  Will it do so for
> the virtual_alias_maps if I use regexp: format?
>
>

You must create a lookup table by user.

--
Reinaldo de Carvalho
http://korreio.sf.net
http://python-cyrus.sf.net

From: Wietse Venema on
Phil Howard:
[ Charset ISO-8859-1 unsupported, converting... ]
> On Wed, May 19, 2010 at 12:10, Noel Jones <njones(a)megan.vbhcs.org> wrote:
>
> > While postfix does support wildcard domain > domain rewriting, it is highly
> > discouraged because it disables recipient validation -- that tends to fill
> > your queue with undeliverable mail and will get you blacklisted as a
> > backscatter source.
> >
>
> So it doesn't perform any form of domain-only mapping at RCPT TO time?
>
> What about a regexp form like:
>
> /^(.*)@example\.com$/ ${1}@example.net <1%7D(a)example.net>
>

Don't do that.

Postfix will accept mail for addresses that don't exist and later
bounce that mail to innocent people.

Wietse
>
>
>
> > As an alternative, you may be able to use smtp_generic_maps to rewrite the
> > destination domain on the fly during delivery. See:
> > http://www.postfix.org/ADDRESS_REWRITING_README.html#generic
> >
>
> I do want the username checked during SMTP arrival time. Will it do so for
> the virtual_alias_maps if I use regexp: format?

From: Noel Jones on
On 5/19/2010 1:45 PM, Phil Howard wrote:
> On Wed, May 19, 2010 at 12:10, Noel Jones <njones(a)megan.vbhcs.org
> <mailto:njones(a)megan.vbhcs.org>> wrote:
>
> While postfix does support wildcard domain > domain rewriting, it is
> highly discouraged because it disables recipient validation -- that
> tends to fill your queue with undeliverable mail and will get you
> blacklisted as a backscatter source.
>
>
> So it doesn't perform any form of domain-only mapping at RCPT TO time?
>
> What about a regexp form like:
>
> /^(.*)@example\.com$/ ${1}@example.net <mailto:1%7D(a)example.net>

That also defeats recipient validation.


> As an alternative, you may be able to use smtp_generic_maps to
> rewrite the destination domain on the fly during delivery. See:
> http://www.postfix.org/ADDRESS_REWRITING_README.html#generic
>
>
> I do want the username checked during SMTP arrival time. Will it do so
> for the virtual_alias_maps if I use regexp: format?

If smtp_generic_maps suit your needs, they will not affect
recipient validation, and may be easier to implement.

-- Noel Jones