Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sendmail & Cyrus-IMAP: 554 5.6.0 Message contains NUL characters

677 views
Skip to first unread message

Sergey

unread,
May 30, 2013, 6:55:54 AM5/30/13
to
Hello.

I use Sendmail with Cyrus-IMAP. Some messages (typically spam) are not
received by Cyrus-IMAP but received by Sendmail. A bounces are generated
by my server as result. Can I configure Sendmail for reject this messages
in incoming SMTP session stage ?

--
Regards, Sergey


Sergey

unread,
May 30, 2013, 7:23:41 AM5/30/13
to
MODIFY_MAILER_FLAGS(`CYRUSV2',`+1') is solve problem with delivery to Cyrus,
but I think what reject is more usable. ;-)

--
Regards,
Sergey

Claus Aßmann

unread,
May 30, 2013, 10:19:17 AM5/30/13
to
8.14.7 has an FFR for this:
/* reject NUL bytes in body */
"_FFR_REJECT_NUL_BYTE",

untested, unsupported, .... but it may work for you.

Sergey

unread,
May 31, 2013, 4:44:57 AM5/31/13
to
Claus A?mann wrote:

> 8.14.7 has an FFR for this:
> /* reject NUL bytes in body */
> "_FFR_REJECT_NUL_BYTE",
>
> untested, unsupported, .... but it may work for you.

Thanks, I will try it.

--
Regards,
Sergey

Sergey

unread,
Sep 9, 2013, 2:57:23 AM9/9/13
to
Claus Aßmann wrote:

> 8.14.7 has an FFR for this:
> /* reject NUL bytes in body */
> "_FFR_REJECT_N

I tried this, but It does not works. :-(

I added -D_FFR_REJECT_NUL_BYTE to define of confENVDEF in site.config.m4,
the message "554 NUL byte not allowed" contains in binary file "sendmail".
Sendmail receive a message but Cyrus-IMAP does not accept:

--- 220 xxxxx.xxxxxxx.xx ESMTP Sendmail 8.14.7/8.14.7; Mon, 9 Sep 2013 00:49:02 +0400
<-- ehlo gxq81.internetdsl.tpnet.pl
--- 250-xxxxx.xxxxxxx.xx Hello gxq81.internetdsl.tpnet.pl [80.52.222.81], pleased to meet you
--- 250-ENHANCEDSTATUSCODES
--- 250-PIPELINING
--- 250-EXPN
--- 250-VERB
--- 250-8BITMIME
--- 250-SIZE
--- 250-DSN
--- 250-ETRN
--- 250-AUTH PLAIN
--- 250-DELIVERBY
--- 250 HELP
<-- mail from:<in...@xxxx.xxx>
--- 250 2.1.0 <in...@xxxx.xxx>... Sender ok
<-- rcpt to:<nat...@xxxxxxx.xx>
--- 250 2.1.5 <nat...@xxxxxxx.xx>... Recipient ok
<-- data
--- 354 Enter mail, end with "." on a line by itself
from=<in...@xxxx.xxx>, size=3588, class=0, nrcpts=1, msgid=<00BEE72529FC4BD28E3DC00D31332848@LocalHost>,
proto=ESMTP, daemon=MTA, relay=gxq81.internetdsl.tpnet.pl [80.52.222.81]
--- 250 2.0.0 r88Kn2u3009627 Message accepted for delivery
to=<nat...@xxxxxxx.xx>, delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2, pri=33861, relay=localhost,
dsn=5.6.0, stat=Service unavailable (Message contains NUL characters)

What part of the message is checked for nul characters ? Not all may be ?

MODIFY_MAILER_FLAGS(`CYRUSV2',`+1') is not works also (in 8.14.6):
(used cyrusv2.m4 by Andrzej Adam Filip)

##### $Id: cyrusv2.m4,v 8.3 2004/03/18 21:38:27 anfi Exp $ #####

Mcyrusv2, P=[IPC], F=lsDFMnqXz1m@/:|,
S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL, E=\r\n,
T=DNS/RFC822/SMTP,
A=TCP xxxx.xxxxxxxx.xx lmtp
Mcyrusv2d, P=[IPC], F=lsDFMnqXz1m,
S=EnvFromSMTP/HdrFromL, R=EnvToSMTP, E=\r\n,
T=DNS/RFC822/SMTP,
A=TCP xxxx.xxxxxxxx.xx lmtp

--- 220 xxx.xxxxxxx.xxx ESMTP Sendmail 8.14.6/8.14.6; Mon, 9 Sep 2013 10:48:29 +0400
<-- ehlo by-experience.com
--- 250-xxx.xxxxxxx.xxx Hello [123.24.237.30], pleased to meet you
--- 250-ENHANCEDSTATUSCODES
--- 250-PIPELINING
--- 250-EXPN
--- 250-VERB
--- 250-8BITMIME
--- 250-SIZE 500050000
--- 250-DSN
--- 250-ETRN
--- 250-DELIVERBY
--- 250 HELP
<-- mail from:<in...@xxxxxx.xxx>
--- 250 2.1.0 <in...@xxxxxx.xxx>... Sender ok
<-- rcpt to:<sup...@xxxxxx.xx>
--- 250 2.1.5 <sup...@xxxxxx.xx>... Recipient ok
<-- data
--- 354 Enter mail, end with "." on a line by itself
from=<in...@xxxxxx.xxx>, size=3589, class=0, nrcpts=1, msgid=<00BEE72529FC4BD28E3DC00D31332848@LocalHost>,
proto=ESMTP, daemon=MTA, relay=[123.24.237.30]
--- 250 2.0.0 r896mTRD413437 Message accepted for delivery
SMTP outgoing connect on xxx.xxxxxxx.xxx
to=<sup...@xxxxxx.xx>, delay=00:00:01, xdelay=00:00:00, mailer=cyrusv2d, pri=123589,
relay=xxxx.xxxxxxx.xx. [xxx.xxx.xxx.xx], dsn=5.6.0, stat=Service unavailable (Message contains NUL
characters)

--
Regards,
Sergey

Sergey

unread,
Sep 9, 2013, 12:22:15 PM9/9/13
to
Sergey wrote:

>> /* reject NUL bytes in body */

> What part of the message is checked for nul characters ? Not all may be ?

I was not paying attention. Comment say about the body ...

--
Regards,
Sergey

Sergey

unread,
Oct 30, 2013, 2:29:23 AM10/30/13
to
9/09/2013 10:57:23 UTC+4 Sergey wrote:

> > 8.14.7 has an FFR for this:
> > /* reject NUL bytes in body */
> > "_FFR_REJECT_N
>
> I tried this, but It does not works. :-(

I came back to this problem. I seen code and found what "O RejectNUL" is needed in cf. It is partially working now. Some messages are rejected, but some messages are received.

Sergey

unread,
Oct 30, 2013, 4:44:55 AM10/30/13
to
I have identified where the problem. NUL characters are not
present in original messages. Original messages contains
string about MIME parts before first MIME section but in UTF-8
on national languge (Russian in my case):

==============
X-Mailer: Microsoft Windows Live Mail 15.4.3555.308
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308
X-EsetId: 3497F03D1091113560D5A8
X-EsetScannerBuild: 15671

Это . сообщение из нескольких частей в формате MIME.

------=_NextPart_000_00A1_01CED47D.1B07A750
Content-Type: text/plain;
charset="windows-1251"
Content-Transfer-Encoding: quoted-printable
==============

Sendmail damages this non 7bit string and nul characters appear.

--
Regards,
Sergey

Claus Aßmann

unread,
Nov 13, 2013, 10:25:38 PM11/13/13
to
Sergey wrote:

[for the archives]

> Это . сообщение из нескольких частей в формате MIME.
>

> Sendmail damages this non 7bit string and nul characters appear.

MIME conversion is evil... in this case it's 0x80 -> 0x00.

Turn it off:

define(`confMAX_MIME_HEADER_LENGTH', `0/0')

so you get in your cf file:
O MaxMimeHeaderLength=0/0

Sergey

unread,
Nov 14, 2013, 1:54:25 AM11/14/13
to
Claus A?mann wrote:

> [for the archives]

>> Sendmail damages this non 7bit string and nul characters appear.
>
> MIME conversion is evil... in this case it's 0x80 -> 0x00.
>
> Turn it off:
>
> define(`confMAX_MIME_HEADER_LENGTH', `0/0')
>
> so you get in your cf file:
> O MaxMimeHeaderLength=0/0

Thanks, it works !

So, for Cyrus integration is needed for prevent generation of spam bounces:

1. Build sendmail.cf from mc with define(`confMAX_MIME_HEADER_LENGTH', `0/0')
for prevent MIME conversion.

2. Build Sendmail (8.14.7 or later) with -D_FFR_REJECT_NUL_BYTE and enable it.
In mc:
LOCAL_CONFIG
O RejectNUL

I understand correctly, that something like this define(`confRejectNUL')
does not exist yet ?

--
Regards,
Sergey

Claus Aßmann

unread,
Nov 14, 2013, 11:59:12 AM11/14/13
to
Sergey wrote:

> I understand correctly, that something like this define(`confRejectNUL')
> does not exist yet ?

Correct. FFRs are usually not supported via m4/mc options.
0 new messages