OK, now I'm pretty convinced there is a bug in fetchmail. Hopefull some
maintainers do read this mailing list, and so can take a look at this
and/or discuss with me. I'm cc'ing the debian list because that's what I
use, and cyrus because it affects my forwarding of emails into
cyrus-imap as well.
I'm seeing the same behavoir in both the version with fetchmail in
debian stable (5.9.11) and debian testing (6.2.1), and I am fairly
convinced that this is a bug. At the least, the behavoir doesn't seem
ideal.
The long and short of it is the following. Here is a line from my
.fetchmailrc, altered a bit (passwords removed, for instance):
poll mail.lippman.org protocol pop3 user "testuser" pass "testpass" is
"test" smtphost "/var/imap/socket/lmtp"
This line should retrieve mail from my pop3 server and forward it via
lmtp to a socket which cyrus-imap's lmtp daemon is listing on.
If I send multiple messages to this email account, then then invoke
fetchmail to retrieve them, the first message is lost. This is true no
matter how messages are waiting for retrieval when fetchmail runs; the
first is always lost (if there is only one message waiting, it is of
course lost). The reason is that fetchmail tries to forward the first
message to "test@/var/imap/socket" which fails, because the lmtp daemon
(correctly) notes that this is incorrect syntax for an email address.
Fetchamil seems to pick up on this error (although the log does not
indicate that it is doing so), because all subsequent messages are then
fowarded to "test@localhost" which the lmtpd accepts. This behavoir, as
mentioned, occurs with 5.9.11 AND 6.2.1 versions.