delivery: Message contains invalid header

2007-02-28 Thread Sergey Matveychuk
Hello.

I've got a problem with delivery(1). When I try to use it with exim to
place messages to mail boxes I get 'Message contains invalid header'
error almost for every message. When I use LMTP transport, cyrus works
just fine and deliveries any message.
I don't understand what's wrong with headers. Here is one of messages
that cyrus-imapd rejected, started with a delivery error message (I've
masked emails and IPs):

  [EMAIL PROTECTED]
local delivery failed

The following text was generated during the delivery attempt:

-- [EMAIL PROTECTED] --

sem.INBOX: Message contains invalid header

-- This is a copy of the message, including all the headers. --

Return-path: [EMAIL PROTECTED]
Received: from [192.168.1.1] (helo=mail.xxx.ru)
by mail.xxx.ru with esmtp (Exim 4.x)
id 1HMSPR-000Ihn-Ot
for [EMAIL PROTECTED]; Wed, 28 Feb 2007 20:16:09 +0300
Received: from [XXX.XXX.16.199] (helo=[192.168.0.4])
by relay.xxx.ru with esmtpa (Exim 4.x)
id 1HMSPS-0006cW-PV
for [EMAIL PROTECTED]; Wed, 28 Feb 2007 20:16:10 +0300
Message-ID: [EMAIL PROTECTED]
Date: Wed, 28 Feb 2007 20:15:36 +0300
From: Sergey Matveychuk [EMAIL PROTECTED]
User-Agent: Thunderbird 1.5.0.9 (X11/20070124)
MIME-Version: 1.0
To: [EMAIL PROTECTED]
Subject: test
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: 8bit

The problem I got with both 2.3.8 and 2.2.13 versions.
I can't find any wrong (non-ASCII) character here. Any hint please?

--
Sem.

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: delivery: Message contains invalid header

2007-02-28 Thread Sergey Matveychuk
Sergey Matveychuk wrote:
 Hello.
 
 I've got a problem with delivery(1). When I try to use it with exim to

Not delyvery(1), but deliver(8). Sorry, I was hurry.

And now I've discovered the behaviour was introduced in 2.3.8. 2.3.7
works fine.

--
Sem.

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-30 Thread Andrew Morgan

On Sat, 28 Oct 2006, Marten Lehmann wrote:


Hi,


case IMAP_MESSAGE_BADHEADER:
prot_printf(pout, 554 5.6.0 Message contains invalid header\r\n);
break;


what can I do to fix these headers? I have one message (which appears to be 
spam, but that is not the point), where I cannot find any problem. No 8bit 
characters, no empty message-id header, what else could be wrong with it?


It looks like that particular error message can also be generated if a 
header contains ascii characters outside the decimal range 33-57, 59-126:


if (!((c = 33  c = 57) || (c = 59  c = 126))) {
r = IMAP_MESSAGE_BADHEADER;
goto ph_error;
}

Have a look at the message headers themselves (not the values stored in 
the headers).


Andy

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-27 Thread Daniel Eckl
On 26.10.2006 23:57, Marten Lehmann wrote:
 exim. It can handle even emails with NUL characters and 8bit headers,
 but I guess all up2date MTAs (like postfix or sendmail) are capable of
 this.
Well, that's a bad comparison between MTA and your mail storage! A MTA
normally doesn't care about the body. It just has SMTP envelopes to work
with. MAIL FROM, RCPT TO and DATA is all it really needs (I know that
very simplified, it adds Received: lines and so on). If the message
header or body in the DATA part is seriously broken it doesn't make much
problems (in 99,9% of all cases).

But your Cyrus IMAPd has to work with these headers! It has to be able
to sort by date, search for message ID, index the body, search for any
header field! So you cannot just ignore errors in Cyrus. But perhaps you
could use a program in between your MTA and cyrus which corrects these
problems automagically. But I don't really know of any scalable solution
for that. procmail piping to a script or similar sounds very overhead
for me, but I'm not sure here...

Best,
Daniel

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-27 Thread Marten Lehmann

Hello,


But your Cyrus IMAPd has to work with these headers! It has to be able
to sort by date, search for message ID, index the body, search for any
header field! So you cannot just ignore errors in Cyrus.


yes, I understand. But I don't know which characters are problematic for 
Cyrus. I just see the message Message containes invalid headers. So 
what? Is it an empty Message-ID? Is it a NUL-character? Is it 8bit in 
header where usually only 7bit is allowed (munge8bit is false in our 
setup)? There is now documentation on this. Do I have to be a programmer 
in watch through thousand lines of source code to find it out? Actually, 
I just want to use Cyrus, not change it.


Regards
Marten

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-27 Thread Andrew Morgan

On Fri, 27 Oct 2006, Marten Lehmann wrote:


Hello,


But your Cyrus IMAPd has to work with these headers! It has to be able
to sort by date, search for message ID, index the body, search for any
header field! So you cannot just ignore errors in Cyrus.


yes, I understand. But I don't know which characters are problematic for 
Cyrus. I just see the message Message containes invalid headers. So what? 
Is it an empty Message-ID? Is it a NUL-character? Is it 8bit in header where 
usually only 7bit is allowed (munge8bit is false in our setup)? There is now 
documentation on this. Do I have to be a programmer in watch through thousand 
lines of source code to find it out? Actually, I just want to use Cyrus, not 
change it.


Looking at the source code, it appears that error message is only 
generated when there is an empty Message-ID: header.  As other people have 
said, there are ways to have your MTA fix-up the Message-ID: header 
before the message is handed to Cyrus.


There are separate error messages for other conditions:

case IMAP_MESSAGE_CONTAINSNULL:
prot_printf(pout, 554 5.6.0 Message contains NUL characters\r\n);
break;

case IMAP_MESSAGE_CONTAINSNL:
prot_printf(pout, 554 5.6.0 Message contains bare newlines\r\n);
break;

case IMAP_MESSAGE_CONTAINS8BIT:
prot_printf(pout, 554 5.6.0 Message contains non-ASCII characters in 
headers\r\n);
break;

case IMAP_MESSAGE_BADHEADER:
prot_printf(pout, 554 5.6.0 Message contains invalid header\r\n);
break;



Andy

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-27 Thread Marten Lehmann

Hello,


case IMAP_MESSAGE_CONTAINSNULL:
prot_printf(pout, 554 5.6.0 Message contains NUL characters\r\n);
break;


especially this appears very often. Does Cyrus actually mean the whole 
message, or message body or header? What can I do with existing messages?


Regards
Marten

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-27 Thread Henrique de Moraes Holschuh
On Fri, 27 Oct 2006, Marten Lehmann wrote:
 especially this appears very often. Does Cyrus actually mean the whole 
 message, or message body or header? What can I do with existing messages?

Last time I had a problem like this, I piped them all through tr -d '\000'.
Nowadays, postfix is set to reject this crap before it comes near Cyrus in
some places, and in others (where we need the messages), we strip the NULs
away shamelessly.

After all, common courtesy of not modifying data in-transit extends only to
email, and whatever something with embedded NULs is, it certainly ain't
email.  They just resemble email enough that they can (often) be converted
into email with some NUL-stripping ;-)

The same goes to messages with empty message-id headers. We strip them away
so that they become email ;p

-- 
  One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie. -- The Silicon Valley Tarot
  Henrique Holschuh

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-27 Thread Marten Lehmann

Hi,


case IMAP_MESSAGE_BADHEADER:
prot_printf(pout, 554 5.6.0 Message contains invalid header\r\n);
break;


what can I do to fix these headers? I have one message (which appears to 
be spam, but that is not the point), where I cannot find any problem. No 
8bit characters, no empty message-id header, what else could be wrong 
with it?


Regards
Marten

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-26 Thread Marten Lehmann

Hello,

If it's mails from the broken Lotus Notes client that's the problem (and 
they're the only ones we saw here), it's caused by a null Message-ID 
header; just have your SMTP server remove those.


no, it is not just at mails from Notes clients. I also get this error on 
messages with correct Message-ID. We cannot simply refuse mails because 
some clients don't implement the standards 100% correctly. Our users 
still need the mails and every mailclient can handle it even with errors.


And even Cyrus does handle it if I'm putting such a message in the 
mailbox and do a reconstruct!


So why is it refused at lmtp time? How can I disable this? It is really 
important for me!


Regards
Marten

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-26 Thread Andrew Morgan

On Thu, 26 Oct 2006, Marten Lehmann wrote:


Hello,

If it's mails from the broken Lotus Notes client that's the problem (and 
they're the only ones we saw here), it's caused by a null Message-ID 
header; just have your SMTP server remove those.


no, it is not just at mails from Notes clients. I also get this error on 
messages with correct Message-ID. We cannot simply refuse mails because some 
clients don't implement the standards 100% correctly. Our users still need 
the mails and every mailclient can handle it even with errors.


And even Cyrus does handle it if I'm putting such a message in the mailbox 
and do a reconstruct!


So why is it refused at lmtp time? How can I disable this? It is really 
important for me!


Find the code in the source of Cyrus and modify it.  There is no runtime 
option to disable this.


Andy

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-26 Thread Marten Lehmann

Hello,


What MTA do you use?


exim. It can handle even emails with NUL characters and 8bit headers, 
but I guess all up2date MTAs (like postfix or sendmail) are capable of this.


Regards
Marten

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Message contains invalid header

2006-10-25 Thread Marten Lehmann

Hello,

from time to time we are getting this message in our exim logs:

LMTP error after end of data: 554 5.6.0 Message contains invalid header

I have also experienced this error while I'm syncing emails from an old 
server to our new cyrus mailserver. I have


munge8bit: false

in my imapd.conf and reject8bit is set to false by default. Which 
headers is cyrus complaining about? I cannot change this world where 
clients like Notus Notes are sending invalid emails, but simply refusing 
these mails is a bad choice. And we also have a lot of emails we 
received in the old setup and I wouldn't know how to explain to our 
users, that they cannot access these messages any more.


How can I make cyrus less strict?

Regards
Marten

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-25 Thread Adam Stephens

Marten Lehmann wrote:

Hello,

from time to time we are getting this message in our exim logs:

LMTP error after end of data: 554 5.6.0 Message contains invalid header

I have also experienced this error while I'm syncing emails from an 
old server to our new cyrus mailserver. I have


munge8bit: false

in my imapd.conf and reject8bit is set to false by default. Which 
headers is cyrus complaining about? I cannot change this world where 
clients like Notus Notes are sending invalid emails, but simply 
refusing these mails is a bad choice. And we also have a lot of emails 
we received in the old setup and I wouldn't know how to explain to our 
users, that they cannot access these messages any more.


How can I make cyrus less strict?

If it's mails from the broken Lotus Notes client that's the problem (and 
they're the only ones we saw here), it's caused by a null Message-ID 
header; just have your SMTP server remove those. LMTP will generate a 
new, valid message-id when the message is delivered.


in Exim:
headers_remove = ${if match{$h_Message-ID:}{\N^\s*$\N} {Message-ID} {} }

cheers,
Adam.

--

Adam Stephens
Network Specialist - Email  DNS
[EMAIL PROTECTED]


Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-25 Thread Simon Matter
 Marten Lehmann wrote:
 Hello,

 from time to time we are getting this message in our exim logs:

 LMTP error after end of data: 554 5.6.0 Message contains invalid header

 I have also experienced this error while I'm syncing emails from an
 old server to our new cyrus mailserver. I have

 munge8bit: false

 in my imapd.conf and reject8bit is set to false by default. Which
 headers is cyrus complaining about? I cannot change this world where
 clients like Notus Notes are sending invalid emails, but simply
 refusing these mails is a bad choice. And we also have a lot of emails
 we received in the old setup and I wouldn't know how to explain to our
 users, that they cannot access these messages any more.

 How can I make cyrus less strict?

 If it's mails from the broken Lotus Notes client that's the problem (and
 they're the only ones we saw here), it's caused by a null Message-ID
 header; just have your SMTP server remove those. LMTP will generate a
 new, valid message-id when the message is delivered.

 in Exim:
 headers_remove = ${if match{$h_Message-ID:}{\N^\s*$\N} {Message-ID} {} }

and with postfix you can try this in header_checks:

# Remove empty Message-ID headers from broken Notes implementation
/^Message-ID:[[:space:]]*$/ IGNORE

Simon

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2006-10-25 Thread Marten Lehmann

Hello,

sorry, but I'm not looking for a way to change anything in an email, I 
am looking for a way so that Cyrus doesn't check for such errors and 
simply ignores them.


Even if I would remove the according message ids in new messages, I 
still have to migrate the old mailboxes and IMAP is giving me the same 
error on APPEND. So what should I do with all those existing messages? 
Why does cyrus have a problem with an empty message-id header? Or there 
other cases in which cyrus throws this error (like 8bit in headers)?


Regards
Marten

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


lmtp over tcp sockets, access denied and lmtp error: Message contains invalid header

2006-07-21 Thread Rudy Gevaert

Hi,

I'm trying to configure postfix to deliver to my cyrus lmtpd.  I read 
the LMTP readme and configured my cyrus like this:


  lmtp  cmd=lmtpd -a -C /mail/mail2/etc/imapd.conf 
listen=host.name.tld:lmtp prefork=10


hosts.deny says to deny all lmtp access, and hosts.allow accepts all 
lmtp access from one host (that is running the postfix mail server).


Now postfix complains:
Jul 21 15:25:42 oliebol postfix/qmgr[7484]: 2A9BA7458: 
from=[EMAIL PROTECTED], size=348, nrcpt=1 (queue active)
Jul 21 15:25:42 oliebol postfix/lmtp[7490]: 2A9BA7458: 
to=[EMAIL PROTECTED], relay=none, delay=4236, status=deferred (connect 
to mail2.ugent.be[157.193.71.18]: Connection refused)


I want to test my lmtp setup, but this fails too:

oliebol:/etc/postfix# telnet mail2.ugent.be 2003
Trying 157.193.71.18...
Connected to mail2.ugent.be.
Escape character is '^]'.
220 mail2.ugent.be LMTP Cyrus v2.3.7 ready
LHLO foo.edu
250-mail2.ugent.be
250-8BITMIME
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-SIZE
250-AUTH EXTERNAL
250 IGNOREQUOTA
mail from:[EMAIL PROTECTED]
250 2.1.0 ok
rcpt to:[EMAIL PROTECTED]
250 2.1.5 ok
DATA
354 go ahead
daf
da


af
.
554 5.6.0 Message contains invalid header

How do I further test if my lmtp is working?  (So I can gave a look at 
the postfix problem)


Thanks in advance,

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: lmtp over tcp sockets, access denied and lmtp error: Message contains invalid header

2006-07-21 Thread Rodrigo Ventura
On Friday 21 July 2006 14:32, Rudy Gevaert wrote:
 mail from:[EMAIL PROTECTED]
 250 2.1.0 ok
 rcpt to:[EMAIL PROTECTED]
 250 2.1.5 ok
 DATA
 354 go ahead
 daf
 da


 af
 .
 554 5.6.0 Message contains invalid header

 How do I further test if my lmtp is working?  (So I can gave a look at
 the postfix problem)

After the DATA command you should enter the header fields in RCF??? format, 
followed by a empty line, followed by the actual data. For instance:

mail from: [EMAIL PROTECTED]
250 2.1.0 [EMAIL PROTECTED] Sender ok
rcpt to: [EMAIL PROTECTED]
250 2.1.5 [EMAIL PROTECTED] Recipient ok
data
354 Enter mail, end with . on a line by itself
Subject: test

hi there
.
250 2.0.0 k6LE4oXP028311 Message accepted for delivery

Cheers,

Rodrigo

-- 

*** Rodrigo Martins de Matos Ventura [EMAIL PROTECTED]
***  Web page: http://www.isr.ist.utl.pt/~yoda
***   Teaching Assistant and PhD Student at ISR:
***Instituto de Sistemas e Robotica, Polo de Lisboa
*** Instituto Superior Tecnico, Lisboa, PORTUGAL
*** PGP fingerprint = 0119 AD13 9EEE 264A 3F10  31D3 89B3 C6C4 60C6 4585

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: lmtp over tcp sockets, access denied and lmtp error: Message contains invalid header

2006-07-21 Thread Pascal Gienger

Rudy Gevaert [EMAIL PROTECTED] wrote:



Now postfix complains:
Jul 21 15:25:42 oliebol postfix/qmgr[7484]: 2A9BA7458:
from=[EMAIL PROTECTED], size=348, nrcpt=1 (queue active)
Jul 21 15:25:42 oliebol postfix/lmtp[7490]: 2A9BA7458:
to=[EMAIL PROTECTED], relay=none, delay=4236, status=deferred (connect
to mail2.ugent.be[157.193.71.18]: Connection refused)


Postfix seems to connect to a wrong port number. What's in your master.cf 
and main.cf regarding that lmtp transport?



I want to test my lmtp setup, but this fails too:


No it did not :)


oliebol:/etc/postfix# telnet mail2.ugent.be 2003
Trying 157.193.71.18...
Connected to mail2.ugent.be.
Escape character is '^]'.
220 mail2.ugent.be LMTP Cyrus v2.3.7 ready
LHLO foo.edu


[...]


mail from:[EMAIL PROTECTED]
250 2.1.0 ok
rcpt to:[EMAIL PROTECTED]
250 2.1.5 ok
DATA
354 go ahead
daf

[...]

.
554 5.6.0 Message contains invalid header



That is normal. daf is not an allowed mail header.

You seem to have configured 2003 as your lmtpd port in your /etc/services 
of your cyrus host. Does lmtp use the same port?


Pascal
Pascal

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: lmtp over tcp sockets, access denied and lmtp error: Message contains invalid header

2006-07-21 Thread Rudy Gevaert

Pascal Gienger wrote:

You seem to have configured 2003 as your lmtpd port in your 
/etc/services of your cyrus host. Does lmtp use the same port?


Stupid me.  I did not have the lmtp line in my /etc/services on the 
mailrelay host.


Thanks for the help!

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: lmtp over tcp sockets, access denied and lmtp error: Message contains invalid header

2006-07-21 Thread Rudy Gevaert

Rodrigo Ventura wrote:



After the DATA command you should enter the header fields in RCF??? format, 
followed by a empty line, followed by the actual data. For instance:


thanks for pointing this out.  I read in the rfc that lmtp use the same 
protocol als smtp (with a couple of exceptions) but I assumed that 
providing the bare minimum would work with lmtp as with smtp.




mail from: [EMAIL PROTECTED]
250 2.1.0 [EMAIL PROTECTED] Sender ok
rcpt to: [EMAIL PROTECTED]
250 2.1.5 [EMAIL PROTECTED] Recipient ok
data
354 Enter mail, end with . on a line by itself
Subject: test

hi there
.
250 2.0.0 k6LE4oXP028311 Message accepted for delivery

Cheers,

Rodrigo




Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Message contains invalid header

2005-08-24 Thread Etienne Goyer

Hi,

I have a problem with thunderbird and Cyrus 2.2.12.  One of my user is 
trying to transfer messages that have been downloaded from a POP 
account.  When he try to drag the message from his POP account folder in 
Thunderbird to a Cyrus IMAP account folder, he receive an error Message 
contains invalid header.


Looking at the message source, I can see that this message have an SMTP 
envelope header From blabla... at the top.  I guess that this is the 
problematic header.  Is this the case ?  If yes, is there a workaround ?


What is really mystifying me is that some other message that also have 
the From blabla header import correctly.  This make me doubt it's this 
particuliar header that is problematic.


Thanks !

Etienne Goyer

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2005-08-24 Thread Andrew Morgan


On Wed, 24 Aug 2005, Etienne Goyer wrote:


Hi,

I have a problem with thunderbird and Cyrus 2.2.12.  One of my user is trying 
to transfer messages that have been downloaded from a POP account.  When he 
try to drag the message from his POP account folder in Thunderbird to a Cyrus 
IMAP account folder, he receive an error Message contains invalid header.


Looking at the message source, I can see that this message have an SMTP 
envelope header From blabla... at the top.  I guess that this is the 
problematic header.  Is this the case ?  If yes, is there a workaround ?


What is really mystifying me is that some other message that also have the 
From blabla header import correctly.  This make me doubt it's this 
particuliar header that is problematic.


I ran into this problem when I migrated from uw-imap to cyrus-imap.  The 
scripts that I used/wrote stripped out the From foo.. header.  Those 
headers were only supposed to be used as message separaters in the unix 
mbox format, not displayed to clients.  Go figure.


I can't explain why some work and some don't.

Andy

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Message contains invalid header

2005-06-09 Thread User Siggi
I'm having the following problem.  If someone could tell me why this 
error occurs I would be most thankful.  Platform is Mac OSX Server 10.4.1.


relay=cyrus, delay=1, status=bounced (data format error. Command output: 
john: Message contains invalid header )


This being the message's header.  I changed some of the addresses:

Received: from sendmail.company.com (sendmail.company.com [130.208.xxx.xxx])
   by mx1.company2.com (Postfix) with ESMTP id B75CB19B52F
   for [EMAIL PROTECTED]; Thu,  9 Jun 2005 14:19:13 + (GMT)
Received: from localhost (localhost.localdomain [127.0.0.1])
   by sendmail.company.com (Postfix) with ESMTP id 91AA4C076
   for [EMAIL PROTECTED]; Thu,  9 Jun 2005 14:19:03 + (GMT)
Received: from sendmail.company.com ([127.0.0.1])
by localhost (sendmail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
id 24790-07 for [EMAIL PROTECTED]; Thu,  9 Jun 2005 14:19:01 + (GMT)
Received: from sendmail2.company.com (sendmail2.company.com 
[160.210.104.10])

   by sendmail.company.com (Postfix) with ESMTP id B2CCDC070
   for [EMAIL PROTECTED]; Thu,  9 Jun 2005 14:19:01 + (GMT)

with regards
siggi
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: Message contains invalid header

2005-06-09 Thread Peter A. Friend


On Jun 9, 2005, at 8:56 AM, User Siggi wrote:

My response inline...

I'm having the following problem.  If someone could tell me why  
this error occurs I would be most thankful.  Platform is Mac OSX  
Server 10.4.1.


relay=cyrus, delay=1, status=bounced (data format error. Command  
output: john: Message contains invalid header )


This being the message's header.  I changed some of the addresses:

Received: from sendmail.company.com (sendmail.company.com  
[130.208.xxx.xxx])

   by mx1.company2.com (Postfix) with ESMTP id B75CB19B52F
   for [EMAIL PROTECTED]; Thu,  9 Jun 2005 14:19:13 + (GMT)
Received: from localhost (localhost.localdomain [127.0.0.1])
   by sendmail.company.com (Postfix) with ESMTP id 91AA4C076
   for [EMAIL PROTECTED]; Thu,  9 Jun 2005 14:19:03 + (GMT)
Received: from sendmail.company.com ([127.0.0.1])
by localhost (sendmail [127.0.0.1]) (amavisd-new, port 10024) with  
ESMTP
id 24790-07 for [EMAIL PROTECTED]; Thu,  9 Jun 2005 14:19:01  
+ (GMT)


If the header above indeed came through that way, that would be it.  
The header is not properly wrapped. What apps do in this situation  
varies. Some barf and refuse the message, some skip the header, and  
others insert a header separator at that point (during SMTP).  
Received headers are in general not easily parsed by machine, and not  
stored in the indexes, so I would think that skipping in this case  
would be liberal in what you accept behavior. Risk is of course a  
mail client that is less forgiving than the server.


Peter

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


error message message contains invalid header

2005-02-03 Thread Stefan Palme

hi,

since no one replyed to the bugtracker entry, i will post the
question here too 
(see https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=2613):



I am migrating my mailboxes to an account on:
name   : Cyrus IMAPD
version: v2.2.10 2004/11/23 17:52:52
vendor : Project Cyrus
support-url: http://asg.web.cmu.edu/cyrus
os : Linux
os-version : 2.6.9
environment: Built w/Cyrus SASL 2.1.20
 Running w/Cyrus SASL 2.1.20
 Built w/Sleepycat Software: Berkeley DB 4.2.52: (December  3, 2003)
 Running w/Sleepycat Software: Berkeley DB 4.2.52: (December  3, 
2003)
 Built w/OpenSSL 0.9.7d 17 Mar 2004
 Running w/OpenSSL 0.9.7d 17 Mar 2004
 CMU Sieve 2.2
 TCP Wrappers
 mmap = shared
 lock = fcntl
 nonblock = fcntl
 auth = unix
 idle = idled

When moving some messages, the mail-client responds with a error. We have
enabled per account log files from the imap-server. But in there is the same
non-sense error:
  [Message contains invalid header]

If you belive a header is invalid, then why don't you include the name in the
error message?

Here are the headers:
11062337522 append INBOX/Development (\Seen) {2235+}
From [EMAIL PROTECTED] Fri Apr 26 00:50:52 2002
Return-Path: [EMAIL PROTECTED]
Received: from host55.syd.nuix.com.au (250.d.005.syd.iprimus.net.au
[210.50.55.250] (may be forged)) by mail.stock-world.de (8.10.1/8.10.1)
with ESMTP id g3PMop009523 for [EMAIL PROTECTED]; Fri, 26 Apr 2002
00:50:52 +0200
Received: from host55.syd.nuix.com.au (localhost.localdomain [127.0.0.1])
by host55.syd.nuix.com.au (Postfix) with SMTP id 42ECF145EA2 for
[EMAIL PROTECTED]; Fri, 26 Apr 2002 08:53:23 +1000 (EST)
Content-Type: text/plain; charset=iso-8859-1
From: David Sitsky [EMAIL PROTECTED]
To: Stefan Kost [EMAIL PROTECTED]
Subject: Re: cvsplot
Date: Fri, 26 Apr 2002 08:43:27 +1000
X-Mailer: KMail [version 1.2]
References: [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
In-Reply-To: [EMAIL PROTECTED]
MIME-Version: 1.0
Message-Id: [EMAIL PROTECTED]
Content-Transfer-Encoding: 8bit
X-Evolution-Source: pop://[EMAIL PROTECTED]/inbox
X-Evolution: 004c-0010

 mail message text 


thank for you help
-stefan-


-- 
---
Dipl. Inf. (FH) Stefan Palme
 
email: [EMAIL PROTECTED]
icq:   36376278
phon:  +49 341 3910484
fax:   +49 1212 517956219
mobil: +49 178 3227887
 
key fingerprint: 1BA7 D217 36A1 534C A5AD  F18A E2D1 488A E904 F9EC
---

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


long lines in body causes Message contains invalid header

2004-05-27 Thread Maarten de Boer
Hello,

This is my first message to the list. Let me start by saying that I am
a sysadmin who is very pleased with cyrus in general, as are the users.
Never had any real problems in years. Until now...:

I encountered the following problem with cyrdeliver. A user sent a mail
to another user on the same server. This mail never reached its
destination, neither did the sender receive a bounce.

(Note that I use cyrus 2.1.15, so I am not sure whether what I describe
below occurs with 2.1.16 as well, but it is really easy to test for
anyone running 2.1.16, with the perl script given)

Investigating the logs, I found that cyrdeliver caused a error: 

  Message contains invalid header 

Exim (I call cyrdeliver from exim) bounced the message to inform the
sender that the message could not be delivered, but when the bounced
message arrived at cyrdeliver, the same error occured.

The message contains an attachment with a very long line (an XML file
without linebreaks). It seems this triggered the cyrdeliver error. I
did some experiments on the command line, piping a message with a body
containing 1 very long line into cyrdeliver, and effectively, when this
line contains 8188 characters, cyrdeliver gives the error.

file test.pl

print From: [EMAIL PROTECTED];
for ($i=0;$i8188;$i++) { print .; }
print \n;

$ perl test.pl | cyrdeliver mdeboer
mdeboer: Message contains invalid header

(if I replace 8188 with 8187, the mail is delivered correctly)

A quick glance at the code, reveales several buffers of size 8192, so
I suppose it is related with this. My questions are:

- Does this happen as well with 2.1.16? If it doesn't, we can happily
discard this mail, and I upgrade. This can be easily tested with the
script above.

- Should cyrdeliver be able to deliver messages with lines that long? It
is not something likely to happen in normal mail, but in this case, the
long line was in a Content-type: text/xml attachment, that looks totally
legal to me. (Is it? Or should the mail-client prevent this?)

- How come the error message talks about an invalid header, when the
problem occurs in the body?

- What makes this problem a nasty one, is that the bounce was not
delivered, so effectively, we are dealing with a lost mail here. Exim
allows to limit the message size of bounced messages, which maybe I
could use to avoid the bounce not triggering the same cyrdeliver error,
but that seems like a kludge to me. Any other solution? Maybe I could
write a script that checks my exim log, and warns me when this (rare)
condition occurs...

Thank you for your time.

Maarten
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: long lines in body causes Message contains invalid header

2004-05-27 Thread Henrique de Moraes Holschuh
On Thu, 27 May 2004, Maarten de Boer wrote:
 Exim (I call cyrdeliver from exim) bounced the message to inform the

Fix it so that it does not include bogus messages in a DSN directly, but
rather as an encoded attachment.

 The message contains an attachment with a very long line (an XML file
 without linebreaks). It seems this triggered the cyrdeliver error. I

This is not a well-formed message, unless the very long line is in an
8bit-clean octet-string MIME attachment, AFAIK.  But others can give you
much better (and authoritative) answers than this :)

-- 
  One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie. -- The Silicon Valley Tarot
  Henrique Holschuh
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: long lines in body causes Message contains invalid header

2004-05-27 Thread Maarten de Boer

Hello Henrique, 

Thanks for your reply.

  Exim (I call cyrdeliver from exim) bounced the message to inform the
 
 Fix it so that it does not include bogus messages in a DSN directly, but
 rather as an encoded attachment.

That is a good idea. I will try to figure out how to do that with exim.

  The message contains an attachment with a very long line (an XML file
  without linebreaks). It seems this triggered the cyrdeliver error. I
 
 This is not a well-formed message, unless the very long line is in an
 8bit-clean octet-string MIME attachment, AFAIK.  But others can give you
 much better (and authoritative) answers than this :)

The attachment was:

  Content-Type: text/xml; name=FFT.xml
  Content-Transfer-Encoding: 8bit
  Content-Disposition: attachment; filename=FFT.xml

Anyway, I see that RFC2821 (Simple Mail Transfer Protocol) states:

  4.5.3.1 Size limits and minimums
  [...]
  text line
The maximum total length of a text line including the CRLF is 1000
characters (not counting the leading dot duplicated for
transparency).  This number may be increased by the use of SMTP
Service Extensions.

So indeed, it seems the mail is not well formatted. The question that 
remains is how cyrus should deal with it... An invalid header error
seems a bit strange.

Maarten
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: cyrdeliver error: Message contains invalid header

2003-09-13 Thread Tom

On Fri, 12 Sep 2003, Miham KEREKES wrote:

 Hi,

 I'm trying to set up cyrus-imap with exim4. Exim4 does smtp-time virus
 and spamscan, and then calls cyrdeliver with arg username.
 The only error is, that cyrdeliver always complaining about:
 Message contains invalid header, and the message doesn't get delivered.
...

  By default Exim will send a From_ header when using a pipe transport.
You should read the documentation, and switch that off.

  If you using a resonably recent version of Exim, just us lmtp instead.

Tom


Re: cyrdeliver error: Message contains invalid header

2003-09-12 Thread Pat Lashley
--On Friday, September 12, 2003 23:11:19 +0200 Miham KEREKES 
[EMAIL PROTECTED] wrote:

I'm trying to set up cyrus-imap with exim4. Exim4 does smtp-time virus
and spamscan, and then calls cyrdeliver with arg username.
The only error is, that cyrdeliver always complaining about:
Message contains invalid header, and the message doesn't get delivered.
This probably isn't really relevant to the problem you are seeing;
but why are you using cyrdeliver instead of directly talking to lmtpd?
Here are the router and transport that I use:
cyrus:
   driver   = accept
   retry_use_local_part
   transport= tcp_lmtp
tcp_lmtp
   driver   = smtp
   protocol = lmtp
   hosts= 127.0.0.1
   allow_localhost
   delivery_date_add
   envelope_to_add
   return_path_add
(I use the TCP/IP connection to lmtpd because I'm doing /callout
recipient checking and that isn't supported by the lmtp driver.
If you aren't doing that, you can use the lmtp driver and a unix-
domain socket.)


-Pat