Forwarding email as attachment instead of relaying it

classic Classic list List threaded Threaded
4 messages Options
Msd
Reply | Threaded
Open this post in threaded view
|

Forwarding email as attachment instead of relaying it

Msd
Hi everyone,

I have a user on my postfix example.com server that want all emails sent
to [hidden email] to be "relayed" to [hidden email].

In main.cf I have set :
virtual_alias_maps = hash:/etc/postfix/virtual

# cat /etc/postfix/virtual
[hidden email] [hidden email]

The problem doing that is that some emails are rejected by
external.example.net mail servers because of SPF, for example :
"550 SPF Hard Fail: Following sender domain's SPF record v=spf1 [...]
-all does not designate a.b.c.d as permitted sender."

Is there a way to transfer the email as an attachment to avoid that ?
Or just a way to rewrite the envelope sender to [hidden email] ?
What do you advise for this case ?

Thanks,


Guillaume
Reply | Threaded
Open this post in threaded view
|

Re: Forwarding email as attachment instead of relaying it

Matus UHLAR - fantomas
On 31.01.20 10:52, Msd wrote:

>I have a user on my postfix example.com server that want all emails sent
>to [hidden email] to be "relayed" to [hidden email].
>
>In main.cf I have set :
>virtual_alias_maps = hash:/etc/postfix/virtual
>
># cat /etc/postfix/virtual
>[hidden email] [hidden email]
>
>The problem doing that is that some emails are rejected by
>external.example.net mail servers because of SPF, for example :
>"550 SPF Hard Fail: Following sender domain's SPF record v=spf1 [...]
>-all does not designate a.b.c.d as permitted sender."
>
>Is there a way to transfer the email as an attachment to avoid that ?
>Or just a way to rewrite the envelope sender to [hidden email] ?
>What do you advise for this case ?

you need to rewrite envelope from, e.g. by using postsrs.

Note that you can't do that from virtual maps, you must use aliases or
.forward.


--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Support bacteria - they're the only culture some people have.
Reply | Threaded
Open this post in threaded view
|

Re: Forwarding email as attachment instead of relaying it

Jaroslaw Rafa
In reply to this post by Msd
Dnia 31.01.2020 o godz. 10:52:28 Msd pisze:
>
> The problem doing that is that some emails are rejected by
> external.example.net mail servers because of SPF, for example :
> "550 SPF Hard Fail: Following sender domain's SPF record v=spf1 [...]
> -all does not designate a.b.c.d as permitted sender."

BTW, whoever rejects mail based on failed SPF alone is doing an extremely
stupid thing, as SPF is a poor idea in general and is known not to work eg.
with mail forwarding.
Maybe you should explain to your user that he/she can lose legitimate emails
if he/she is using mail account at such an incompetent provider.
--
Regards,
   Jaroslaw Rafa
   [hidden email]
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
Reply | Threaded
Open this post in threaded view
|

Re: Forwarding email as attachment instead of relaying it

Matus UHLAR - fantomas
>Dnia 31.01.2020 o godz. 10:52:28 Msd pisze:
>> The problem doing that is that some emails are rejected by
>> external.example.net mail servers because of SPF, for example :
>> "550 SPF Hard Fail: Following sender domain's SPF record v=spf1 [...]
>> -all does not designate a.b.c.d as permitted sender."

On 31.01.20 11:06, Jaroslaw Rafa wrote:
>BTW, whoever rejects mail based on failed SPF alone is doing an extremely
>stupid thing, as SPF is a poor idea in general and is known not to work eg.
>with mail forwarding.

forwarding without changing sender is broken and was since the beginning,
SPF just made it visible.

If you are forwarding to invalid address, the reports should go to you, not
to someone whose mail you have forwarded. They sent it to you, why should
they care that you decided to pass it further? It's your business now.

>Maybe you should explain to your user that he/she can lose legitimate emails
>if he/she is using mail account at such an incompetent provider.

maybe the OP should configure forwarding properly.

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Support bacteria - they're the only culture some people have.