Subject: Problems with invalid "To:" field

From: "Todd Aiken" <[email-masked]>
Date: Mon, 3 Jun 2002 11:19:25 -0400

Greetings.  I am new to this list, so please excuse me if this issue has 
already been addressed.  I have setup a Horde/IMP webmail server at 
our university, and it uses c-client 2001a compiled into PHP 4.1.2 and 
Apache 1.3.23, talking to our IMAP server (Mercury 3.31).  Everything 
works fine, except when a user receives a message containing nothing 
before the @ sign in the "To:" field.  When this happens, the user is 
unable to login to the webmail system.  Further testing shows problems 
also occur when connecting to our IMAP server using Pine 4.33-as soon 
as the message is selected, Pine exits with the following message:

Problem detected: "Received abort signal".
Pine Exiting.
Aborted

I set up a test account and wrote to the authors of IMP, and they got 
back to me with the following:

--------

OK, I tested a bit and did also experience your problems. I traced it back
and found that the c-client is segfaulting in a call to
rfc822_write_address(). I also found the imap_fetch_overview() call in our
mailbox.php that lead to this crash, but there's no way to work around on
our side. The only thing you can try is to upgrade to a newer c-client
version and see if this is fixed already. If not you may want to report a
bug to the c-client guys.

--------

I don't believe the problem is with our IMAP server, because other IMAP 
clients work fine with these types of messages (they are usually SPAM, 
but sometimes legitimate).

Can somebody verify if this is a problem with c-client, or is it something 
else on my system?

Thanks.

CU L8R...

-------------------------------+---------------------------------------     
Todd A. Aiken                  | This space can be yours, for just four     
Systems Administrator          | easy payments of $39.95.  Plus, buy     
Cole Computer Centre           | one half and get the 2nd half for 50%     
BISHOP'S UNIVERSITY            | off the cost of the two together!     
Lennoxville, Quebec, CANADA    | Call 1-800-4-RIPOFF today!     

-----BEGIN GEEK CODE BLOCK-----
Version 3.12 (http://www.geekcode.com)
GCS$/MU d+(-) s++:++ a27 C++$ UL++++$ P+ L++ E->+ W+>++ N++ o? K-
w O- M V? PS PE- Y PGP- t+ 5 X R- tv+ b DI(+) D+ G e+ h !r>r+++ y-
------END GEEK CODE BLOCK------

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Mon, 3 Jun 2002 09:01:13 -0700 (PDT)

Can you provide me with access to your IMAP server?  An account with a single
message that demonstrates the message is good enough.

It is probably generating an invalid syntax IMAP envelope, but c-client should
not crash even in that case.

---

From: "Todd Aiken" <[email-masked]>
Date: Mon, 3 Jun 2002 12:05:08 -0400

> Can you provide me with access to your IMAP server?  An account with a
> single message that demonstrates the message is good enough.
> 
> It is probably generating an invalid syntax IMAP envelope, but c-client
> should not crash even in that case.

Thanks for your quick reply.  Here it is:

Username: imptest
Password: testing
Server: imap4.ubishops.ca
Folder prefix: <none>

There is a test message with a "To:" field of @ubishops.ca in the INBOX.

CU L8R...

------END GEEK CODE BLOCK------

---

From: Mark Crispin <[email-masked]>
Date: Mon, 3 Jun 2002 09:48:48 -0700 (PDT)

It is indeed the IMAP server sending bogus IMAP:
	(NIL NIL NIL "ubishops.ca")
is not a valid IMAP envelope, since the third element can only be NIL to
indicate the end of a group.

Nevertheless, c-client should not crash.  It turns out that I've already fixed
it in imap-2002.  Get the latest imap-2002 development snapshot:
	ftp://ftp.cac.washington.edu/mail/imap-2002.DEV.tar.Z

That IMAP server also seems to be sending bogus text sizes, so you will
probably have other problems with it.

---

From: "Todd Aiken" <[email-masked]>
Date: Mon, 3 Jun 2002 13:30:58 -0400

Thanks Mark for your help.  The 2002DEV package fixed the problem.  
Now my webmail server displays "INVALIDADDRESS@.SYNTAX 
ERROR." on an invalid "To:" field, which is much better than preventing 
a login from happening.  I am also going to write the maintainer of our 
IMAP server and pass this information along.

> Nevertheless, c-client should not crash.  It turns out that I've already
> fixed it in imap-2002.  Get the latest imap-2002 development snapshot:

CU L8R...

------END GEEK CODE BLOCK------