message-id logging broken by utf8?

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

message-id logging broken by utf8?

Tom Sommer
I noticed a mail that broke logging syntax:

Aug 14 15:29:57 X postfix/cleanup[11962]: 41qYP05TZCz5xY9:
message-id==?utf-8?Q?=3CE1F7DC2C-82B5-4927-B0DB-0179227E665C=40aalborgf?=?
=?utf-8?Q?=C3=B8rstehj=C3=A6lp=2Edk=3E?=

I guess the message-id contains non-ascii chars that break logging, or
something, is there any way to fix this or is it a bug?

mail_version = 3.3.1

Thanks
--
Tom
Reply | Threaded
Open this post in threaded view
|

Re: message-id logging broken by utf8?

Dominic Raferd


On Tue, 14 Aug 2018 at 15:22, Tom Sommer <[hidden email]> wrote:
I noticed a mail that broke logging syntax:

Aug 14 15:29:57 X postfix/cleanup[11962]: 41qYP05TZCz5xY9:
message-id==?utf-8?Q?=3CE1F7DC2C-82B5-4927-B0DB-0179227E665C=40aalborgf?=?
=?utf-8?Q?=C3=B8rstehj=C3=A6lp=2Edk=3E?=

I guess the message-id contains non-ascii chars that break logging, or
something, is there any way to fix this or is it a bug?

mail_version = 3.3.1

Is the logging broken? It looks ok to me, just recording the UTF8-encoded message-id.
Reply | Threaded
Open this post in threaded view
|

Re: message-id logging broken by utf8?

Viktor Dukhovni
In reply to this post by Tom Sommer


> On Aug 14, 2018, at 10:21 AM, Tom Sommer <[hidden email]> wrote:
>
> Aug 14 15:29:57 X postfix/cleanup[11962]: 41qYP05TZCz5xY9: message-id==?utf-8?Q?=3CE1F7DC2C-82B5-4927-B0DB-0179227E665C=40aalborgf?=? =?utf-8?Q?=C3=B8rstehj=C3=A6lp=2Edk=3E?=
>
> I guess the message-id contains non-ascii chars that break logging, or something, is there any way to fix this or is it a bug?
>
> mail_version = 3.3.1

That was the actual message-id as received from the remote system.
Postfix does not apply RFC2047 encoding to message-ids, which are
also not a valid context for such encoding per the RFC.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: message-id logging broken by utf8?

Tom Sommer
In reply to this post by Dominic Raferd
The message-id is not contained within <> in the log message but maybe that is correct, it just breaks logstash parsing but perhaps the parser is to blame. 

--
Tom Sommer

On 14 Aug 2018, at 16.34, Dominic Raferd <[hidden email]> wrote:



On Tue, 14 Aug 2018 at 15:22, Tom Sommer <[hidden email]> wrote:
I noticed a mail that broke logging syntax:

Aug 14 15:29:57 X postfix/cleanup[11962]: 41qYP05TZCz5xY9:
message-id==?utf-8?Q?=3CE1F7DC2C-82B5-4927-B0DB-0179227E665C=40aalborgf?=?
=?utf-8?Q?=C3=B8rstehj=C3=A6lp=2Edk=3E?=

I guess the message-id contains non-ascii chars that break logging, or
something, is there any way to fix this or is it a bug?

mail_version = 3.3.1

Is the logging broken? It looks ok to me, just recording the UTF8-encoded message-id.
Reply | Threaded
Open this post in threaded view
|

Re: message-id logging broken by utf8?

Viktor Dukhovni


> On Aug 14, 2018, at 10:50 AM, Tom Sommer <[hidden email]> wrote:
>
> The message-id is not contained within <> in the log message but maybe that is correct, it just breaks logstash parsing but perhaps the parser is to blame.

The "<" and ">" characters are not added by Postfix, they are normally part
of the message-id value.  In this case, the software that erroneously encoded
the message-id, also encoded (quoted-printable) the "<" and ">" characters.

The syntax of the cleanup log entry you're parsing is (typically):

  {syslog-impl-specific} {postfix-instance}/cleanup[{pid}]: {queue-id}: message-id={remote-message-id}

You can't rely on any particular syntax after the "message-id=".

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: message-id logging broken by utf8?

Tom Sommer


> On 14 Aug 2018, at 16.57, Viktor Dukhovni <[hidden email]> wrote:
>
>
>
>> On Aug 14, 2018, at 10:50 AM, Tom Sommer <[hidden email]> wrote:
>>
>> The message-id is not contained within <> in the log message but maybe that is correct, it just breaks logstash parsing but perhaps the parser is to blame.
>
> The "<" and ">" characters are not added by Postfix, they are normally part
> of the message-id value.  In this case, the software that erroneously encoded
> the message-id, also encoded (quoted-printable) the "<" and ">" characters.
>
> The syntax of the cleanup log entry you're parsing is (typically):
>
>  {syslog-impl-specific} {postfix-instance}/cleanup[{pid}]: {queue-id}: message-id={remote-message-id}
>
> You can't rely on any particular syntax after the "message-id=".

Thank you for clarifying, I will adjust the parser.

.. And sorry for top-posting before, I blame the phone.