How do I make our relay server (postfix) redirect from one domain to another

classic Classic list List threaded Threaded
3 messages Options
K F
Reply | Threaded
Open this post in threaded view
|

How do I make our relay server (postfix) redirect from one domain to another

K F
I can see in our outgoing mailqueue, that some users consistently spells their email addresses wrong.
Ie. gmail.dk instead of gmail.com
I've looked into the 'virtual' setup, but I'm not sure if that can be used, as it sounds like that is only for incoming domains?
So our setup is:
mail generator -> postfix -> public

But is it a question of entering
@gmail.dk    @gmail.com
in the virtual file, and then activate it for the postfix?

I'm a bit wary, as I already have a lot in deferred, so if I implement it, and it goes haywire, it won't be pretty :-)

Reply | Threaded
Open this post in threaded view
|

Re: How do I make our relay server (postfix) redirect from one domain to another

Viktor Dukhovni


> On Nov 7, 2018, at 3:08 AM, K F <[hidden email]> wrote:
>
> I can see in our outgoing mailqueue, that some users consistently spells their email addresses wrong.
> Ie. gmail.dk instead of gmail.com

When you say "their email address", is that the user's own (sender) address,
or the addresses of remote recipients he/she is writing to?

> I've looked into the 'virtual' setup, but I'm not sure if that can be used,
> as it sounds like that is only for incoming domains?

No, virtual_alias_maps rewrites the *envelope* address of all recipients,
local or otherwise.  However it has no effect on the headers, and perhaps
you want to correct the same mistake also in the message headers?

> So our setup is:
> mail generator -> postfix -> public
>
> But is it a question of entering
> @gmail.dk    @gmail.com
> in the virtual file, and then activate it for the postfix?

Such broad scope sounds rather unwise, what happens when there are
legitimate email addresses in gmail.dk?

Surely there are some specific addresses that account for most of the
problem?  I'd be hesitant to implement such a broad "solution"...

If "gmail.dk" gets no real email, best to just let it bounce promptly:

   transport:
        gmail.dk error:5.1.2 Bad destination domain

and then the errant user can fix the problem at the source.  You'll
regret accommodating bad habits through rewrites, just be a good and
timely bearer of bad news.

--
        Viktor.

K F
Reply | Threaded
Open this post in threaded view
|

Re: How do I make our relay server (postfix) redirect from one domain to another

K F
Ahh, yes, much better idea, thanks!

Den onsdag den 7. november 2018 09.18.40 CET skrev Viktor Dukhovni <[hidden email]>:




> On Nov 7, 2018, at 3:08 AM, K F <[hidden email]> wrote:
>
> I can see in our outgoing mailqueue, that some users consistently spells their email addresses wrong.
> Ie. gmail.dk instead of gmail.com

When you say "their email address", is that the user's own (sender) address,
or the addresses of remote recipients he/she is writing to?

> I've looked into the 'virtual' setup, but I'm not sure if that can be used,
> as it sounds like that is only for incoming domains?

No, virtual_alias_maps rewrites the *envelope* address of all recipients,
local or otherwise.  However it has no effect on the headers, and perhaps
you want to correct the same mistake also in the message headers?


> So our setup is:
> mail generator -> postfix -> public
>
> But is it a question of entering
> @gmail.dk    @gmail.com
> in the virtual file, and then activate it for the postfix?


Such broad scope sounds rather unwise, what happens when there are
legitimate email addresses in gmail.dk?

Surely there are some specific addresses that account for most of the
problem?  I'd be hesitant to implement such a broad "solution"...

If "gmail.dk" gets no real email, best to just let it bounce promptly:

  transport:
    gmail.dk    error:5.1.2 Bad destination domain

and then the errant user can fix the problem at the source.  You'll
regret accommodating bad habits through rewrites, just be a good and
timely bearer of bad news.

--
    Viktor.