Question on how to deal with bad recipient address

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

Question on how to deal with bad recipient address

Ski Kacoroski
Hi,

I have a blackbox UPS that send this email when I look at it with postcat

*** MESSAGE CONTENTS deferred/B/BFE60169 ***
regular_text: Received: from loki.nsd.org (ups-tms.nsd.org [10.145.1.25])
regular_text: by sys.nsd.org (Postfix) with ESMTP id BFE60169
regular_text: for <[hidden email]>; Wed, 16 Jan 2019
15:24:32 -0800 (PST)
regular_text: Subject: TMS MDF ALARM USHA Test Message
regular_text: From: <[hidden email]>
regular_text: To:
[hidden email]<[hidden email]>

Notice that there is no space between nsd,org and <g.emergen...>  When I
try to forward this email to O365, O365 scrambles the email into:

[hidden email]

and refuses to deliver it as that address doesn't exist.  I tried a
regexp:/etc/postfix/virtual map:

main.cf:
virtual_alias_maps = regexp:/etc/postfix/virtual

postmap -q
"[hidden email]<[hidden email]>"
regexp:/etc/postfix/virtual
[hidden email] <[hidden email]>


that adds in the space, but it does not seem to be working on the
regular_text part of the email.

Any ideas on how I can get postfix to rewrite that part of the email so
I can forward it on to O365.

Thanks very much for your help.

cheers,

ski

--
"When we try to pick out anything by itself, we find it
  connected to the entire universe"            John Muir

Chris "Ski" Kacoroski, [hidden email], 206-501-9803
Reply | Threaded
Open this post in threaded view
|

Re: Question on how to deal with bad recipient address

Wietse Venema
Ski Kacoroski:

> Hi,
>
> I have a blackbox UPS that send this email when I look at it with postcat
>
> *** MESSAGE CONTENTS deferred/B/BFE60169 ***
> regular_text: Received: from loki.nsd.org (ups-tms.nsd.org [10.145.1.25])
> regular_text: by sys.nsd.org (Postfix) with ESMTP id BFE60169
> regular_text: for <[hidden email]>; Wed, 16 Jan 2019
> 15:24:32 -0800 (PST)
> regular_text: Subject: TMS MDF ALARM USHA Test Message
> regular_text: From: <[hidden email]>
> regular_text: To:
> [hidden email]<[hidden email]>
>
> Notice that there is no space between nsd,org and <g.emergen...>  When I
> try to forward this email to O365, O365 scrambles the email into:
>
> [hidden email]

Now, that is not a robust parser...

> and refuses to deliver it as that address doesn't exist.  I tried a

Office 365 uses the header to route the message?

> regexp:/etc/postfix/virtual map:
>
> main.cf:
> virtual_alias_maps = regexp:/etc/postfix/virtual
>
> postmap -q
> "[hidden email]<[hidden email]>"
> regexp:/etc/postfix/virtual
> [hidden email] <[hidden email]>
>
> that adds in the space, but it does not seem to be working on the
> regular_text part of the email.

Of course not. virtual_alias_maps rewrites the <address>, not the
free text before <address>.

To fix non-address info in a header, use header_checks.

        Wietse

> Any ideas on how I can get postfix to rewrite that part of the email so
> I can forward it on to O365.
>
> Thanks very much for your help.
>
> cheers,
>
> ski
>
> --
> "When we try to pick out anything by itself, we find it
>   connected to the entire universe"            John Muir
>
> Chris "Ski" Kacoroski, [hidden email], 206-501-9803
>
Reply | Threaded
Open this post in threaded view
|

Re: Question on how to deal with bad recipient address

Ski Kacoroski
Wietse,

Thanks very much.  That worked like a charm.

cheers,

ski

On 1/16/19 4:09 PM, Wietse Venema wrote:

> Ski Kacoroski:
>> Hi,
>>
>> I have a blackbox UPS that send this email when I look at it with postcat
>>
>> *** MESSAGE CONTENTS deferred/B/BFE60169 ***
>> regular_text: Received: from loki.nsd.org (ups-tms.nsd.org [10.145.1.25])
>> regular_text: by sys.nsd.org (Postfix) with ESMTP id BFE60169
>> regular_text: for <[hidden email]>; Wed, 16 Jan 2019
>> 15:24:32 -0800 (PST)
>> regular_text: Subject: TMS MDF ALARM USHA Test Message
>> regular_text: From: <[hidden email]>
>> regular_text: To:
>> [hidden email]<[hidden email]>
>>
>> Notice that there is no space between nsd,org and <g.emergen...>  When I
>> try to forward this email to O365, O365 scrambles the email into:
>>
>> [hidden email]
>
> Now, that is not a robust parser...
>
>> and refuses to deliver it as that address doesn't exist.  I tried a
>
> Office 365 uses the header to route the message?
>
>> regexp:/etc/postfix/virtual map:
>>
>> main.cf:
>> virtual_alias_maps = regexp:/etc/postfix/virtual
>>
>> postmap -q
>> "[hidden email]<[hidden email]>"
>> regexp:/etc/postfix/virtual
>> [hidden email] <[hidden email]>
>>
>> that adds in the space, but it does not seem to be working on the
>> regular_text part of the email.
>
> Of course not. virtual_alias_maps rewrites the <address>, not the
> free text before <address>.
>
> To fix non-address info in a header, use header_checks.
>
> Wietse
>
>> Any ideas on how I can get postfix to rewrite that part of the email so
>> I can forward it on to O365.
>>
>> Thanks very much for your help.
>>
>> cheers,
>>
>> ski
>>
>> --
>> "When we try to pick out anything by itself, we find it
>>   connected to the entire universe"            John Muir
>>
>> Chris "Ski" Kacoroski, [hidden email], 206-501-9803
>>

--
"When we try to pick out anything by itself, we find it
  connected to the entire universe"            John Muir

Chris "Ski" Kacoroski, [hidden email], 206-501-9803