they fix imapd yet?

vandal

Verified User
Joined
Oct 22, 2003
Messages
526
Location
Calgary, AB
just wondering if john or anyone ever found out why imapd resets messages that were "left on server" by an email client. (ie you login to squirrelmail after you have checked your messages with a mail client, then it resets them and the client downloads them all)

it's been a very long time and just wondering if anyone found a fix.

thanks,

van
 
I already answered this question (or similar) on another thread.

My guess is it's unfixable; that the problem is that the headers are being changed, and that then the client doesn't know it's already been downloaded.

Jeff
 
it is fixeable.

no other CP does this with imapd/squirrelmail combo (cpanel, plex etc).

oh yeah i have verfied this with cpanel on a friends box. it does not act the same. I think they have a custom imapd binary as does DA.
 
Last edited:
vandal said:
it is fixeable.

no other CP does this with imapd/squirrelmail combo (cpanel, plex etc).

oh yeah i have verfied this with cpanel on a friends box. it does not act the same. I think they have a custom imapd binary as does DA.

I have the same problem, if you have a solution, please let me know :)
 
vandal,

Ok, I accept that you believe it's fixable and I have no proof to refute that. I'd think that the only way it could be fixed would be to find out why the imap daemon is making whatever changes it's making, and then patch it so it won't.

Jeff
 
tar xvzf imapback-2004c1.tar.gz
cd imap-2004c1
./buildit
mv /usr/sbin/imapd /usr/sbin/imapd.orig
cp src/imapd/imapd /usr/sbin/imapd
chmod 755 /usr/sbin/imapd
 
any luck?

i wonder if the cpanel imapd source is available anywhere we can see what its doing. or maybe it's just a simple squirrelmail config?

it could be ya know.

if you find anything post it, I will do the same.
 
Cpanel may or may not be using the UW imap server. They might be using Courier or some other imap server. If they are using UW then it should at least act the same.
 
not too sure. if you connect to a cpanel box you get something like this:
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] server2.blah.net IMA
P4rev1 2003.339-cpanel at Thu, 25 Aug 2005 10:27:38 -0600 (CST)
 
vandal said:
not too sure. if you connect to a cpanel box you get something like this:
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] server2.blah.net IMA
P4rev1 2003.339-cpanel at Thu, 25 Aug 2005 10:27:38 -0600 (CST)
That does look like UW of the 2003 type, the current da one looks like this
* OK [CAPABILITY IMAP4REV1 LITERAL+ SASL-IR LOGIN-REFERRALS STARTTLS AUTH=LOGIN] host.domain.com IMAP4rev1 2004.357 at Thu, 25 Aug 2005 18:26:31 -0700 (MST)

The other thing that might be really different between cpanel and DA is the use of the POP3 server. I think the basic IMAP and Squirrelmail aren't that different, but the POP3 server on DA might be treating the changes that Squirrelmail makes to the header differently than the Cpanel POP3 server. Do you know what POP3 server they use for Cpanel?
 
+OK POP3 server1 [cppop 20.0] at [70.85.48.68]

it looks custom to me. (cppop = cpanel pop?)

I will ask my buddy for more info tonight and get on his server see if i can get more info.

i really wanna solve this. my clients complain all the time (specially ones that switched from servers where this didn't happen).
 
Titam said:
Same problem here, i changed imapd but problem is not solved :\
I really don't think it is the imap server. I personally use 3-4 different Imap clients, depending on where I am at the time, and have never seen this. If you are referring to the POP3 client downloading files after Imap has read them, that is something different.

The vm_pop3d does not look at the Status: tag in the header, that Imap looks at. It uses the UIDL to check the status of read/unread. If you read the TODO for da_vmpop3d, you will there was a request for using that tag.
 
I see something else that would cause this problem. vmpop3d that DA uses computes the uidl by doing an md5 hash using the first 25 lines of a message. Imapd when reading a message adds a few headers, including the Status: header. These headers are used in computing the uidl, so once the message is read via IMAP the uidl changes because there are extra lines that are used in the computation. If vmpop3d were modified similar to:
Code:
diff of extra.c in vmpop3d source
325,326c325,332
<           if (line_count++ < 26 && len > 0)
<               md5_process_bytes(buf, len, &md5context);
---
>             if(strncmp(buf,"Status:",7) && 
>                strncmp(buf,"X-Status:",9) &&
>                strncmp(buf,"X-Keywords:",11) &&
>                strncmp(buf,"X-UID:",6)) {
> 
>              if (line_count++ < 26 && len > 0)
>                  md5_process_bytes(buf, len, &md5context);
>             }
it might just work like expected. It still won't honor the Status tag as read, but the uidl shouldn't change once read with IMAP.
 
Ok I got it compiled now.

To compile on FreeBSD edit buildit
nano buildit

change contents to

#!/bin/sh
make bsf


save and exit

then edit the makefile
nano Makefile

line 241 comment out "EXTRADFLAGS"

run buildit as normal

and when copying the bin I used.

cp imapd/imapd /usr/sbin/imapd

before upgrade

* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS AUTH=LOGIN] xxx.xxx.xxx IMAP4rev1 2003.339 at Sun, 28 Aug 2005 20:59:51 +0100 (BST)

after

* OK [CAPABILITY IMAP4REV1 LITERAL+ SASL-IR LOGIN-REFERRALS STARTTLS AUTH=LOGIN] xxx.xxx.xxx IMAP4rev1 2004.357 at Sun, 28 Aug 2005 21:01:37 +0100 (BST)
 
After doing a bit more testing, it looks like a few more headers should be ignored as well. Here is what the final should look like, search for the comment in da_vmpop3d's extra.c file and make the code following look like this. It seems to fix that problem.
Code:
/* creating md5 hash for the UIDL using just first 25 lines */
/* FiXMe: Should be only for header! -TEMHOTA */
         if(strncmp(buf,"Status:",7) &&
               strncmp(buf,"X-Status:",9) &&
               strncmp(buf,"X-Keywords:",11) &&
               strncmp(buf,"X-IMAP:",7) &&
               strncmp(buf,"X-IMAPbase:",11) &&
               strncmp(buf,"X-UID:",6)) {
               if (line_count++ < 26 && len > 0)
                   md5_process_bytes(buf, len, &md5context);
        }
 
Back
Top