Every message has a 32-bit unique identifier (UID) value, which is strictly ascending in the mailbox (on other words, message n must have a higher UID than message n-1). This is needed for IMAP, but since ipop3d uses the same library UIDs are enforced there too.

Consider one of these messages: "Message 124 UID 32 less than 146". This is mathematically impossible. Message 123 has a UID of 146 (possible), but message 124 has a UID of 32; not only is this wrong (since 146 > 32) but it is impossible for message 124 to ever have a UID of 32 no matter what message 123's UID is!

One way that this can happen is if some tool other than c-client manipulated the mailboxes, e.g. copied messages from one mailbox to another.

However, given that all these "UID 32" messages appeared, there is another, darker, probable cause.

In traditional UNIX mailbox format, message metadata is kept in headers in the message. The original metadata header was Status:. Now there are several others, one of these being X-UID.

Spammers and virus writers have taken to forging metadata headers, either out of stupidity or with malicious intent. If your mail delivery delivers a message with one of these forged headers intact, it will be perceived as message metadata with the resulting confusion.

In other words, I believe that a spam/virus came in with
X-UID: 32
in the header. There is no legitimate reason for any incoming message to do this; the only reason is stupidity or evil.


The tmail and dmail programs in modern versions of UW imapd will recognize this and automatically convert these forged headers into something harmless. In the above case, it would be:
X-Original-X-UID: 32


If you decide to try tmail or dmail, be sure to get a modern version. This is a relatively recently added facility. The latest UW IMAP toolkit sources (which include tmail and dmail as well as imapd and ipop3d) are always on:
ftp://ftp.cac.washington.edu/mail/imap.tar.Z


For what it's worth, most other mailbox formats store message metadata out-of-band from the message, where spammers and virus writers can't attack it. mbx format, for example, does not have this problem.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

Reply via email to