# fetchmail skipping all messages on yahoo pop server

## vert

Recently a user on the system changed his university mail account to a yahoo mail account. Since then, fetchmail refuses to download any messages. Weird thing is, the same setup stilll works for me (university microsoft pop server) and local mail (using qmail) is still being delivered to his account just fine. It seems fetchmail thinks it has already seen all messages on the yahoo server (even new and unread ones) and therefor does not read any of them. What's wrong here? I've included a transcript of a fetchmail session (edited the mail addresses and shortened it a little)

```

root@Einstein / # fetchmail -v -f /etc/fetchmailrc

fetchmail: 6.1.0 querying student.tbm.tudelft.nl (protocol POP3) at Tue Oct 15 12:21:53 2002: poll started

fetchmail: POP3< +OK Microsoft Exchange POP3 server version 5.5.2654.50 ready

fetchmail: POP3> CAPA

fetchmail: POP3< -ERR Protocol Error

fetchmail: Protocol Error

fetchmail: Repoll immediately on xxx@student.tbm.tudelft.nl

fetchmail: POP3< +OK Microsoft Exchange POP3 server version 5.5.2654.50 ready

fetchmail: POP3> USER xxx

fetchmail: POP3< +OK

fetchmail: POP3> PASS

fetchmail: POP3< +OK User successfully logged on

fetchmail: POP3> STAT

fetchmail: POP3< +OK 1 464

fetchmail: POP3> LAST

fetchmail: POP3< +OK 0

1 message for xxx at student.tbm.tudelft.nl (464 octets).

fetchmail: POP3> LIST

fetchmail: POP3< +OK

fetchmail: POP3< 1 464

fetchmail: POP3< .

fetchmail: POP3> TOP 1 99999999

fetchmail: POP3< +OK

reading message xxx@student.tbm.tudelft.nl:1 of 1 (464 octets)

fetchmail: SMTP< 220 local.mailserver ESMTP

fetchmail: SMTP> EHLO localhost

fetchmail: SMTP< 250-local.mailserver

fetchmail: SMTP< 250-PIPELINING

fetchmail: SMTP< 250 8BITMIME

fetchmail: SMTP> MAIL FROM:<xxx@yahoo.com>

fetchmail: SMTP< 250 ok

fetchmail: SMTP> RCPT TO:<localmail@xxx.org>

fetchmail: SMTP< 250 ok

fetchmail: SMTP> DATA

fetchmail: SMTP< 354 go ahead

#******fetchmail: SMTP>. (EOM)

fetchmail: SMTP< 250 ok 1034677317 qp 22600

 flushed

fetchmail: POP3> DELE 1

fetchmail: POP3< +OK

fetchmail: POP3> QUIT

fetchmail: POP3< +OK Microsoft Exchange POP3 server version 5.5.2654.50 signing off

fetchmail: 6.1.0 querying student.tbm.tudelft.nl (protocol POP3) at Tue Oct 15 12:21:57 2002: poll completed

fetchmail: 6.1.0 querying pop.mail.yahoo.com (protocol POP3) at Tue Oct 15 12:21:57 2002: poll started

fetchmail: POP3< +OK hello from popgate(2.23.8)

fetchmail: POP3> CAPA

fetchmail: POP3< -ERR popgate unknown command

fetchmail: popgate unknown command

fetchmail: Repoll immediately on xxxx@pop.vip.sc5.yahoo.com

fetchmail: POP3< +OK hello from popgate(2.23.8)

fetchmail: POP3> USER xxxx

fetchmail: POP3< +OK password required.

fetchmail: POP3> PASS

fetchmail: POP3< +OK maildrop ready, 33 messages (9919219 octets) (13037204 26214400)

fetchmail: POP3> STAT

fetchmail: POP3< +OK 33 9919219

fetchmail: POP3> LAST

fetchmail: POP3< +OK 33

33 messages (33 seen) for xxxx at pop.vip.sc5.yahoo.com (9919219 octets).

fetchmail: POP3> LIST

fetchmail: POP3< +OK 33 messages (9919219 octets)

fetchmail: POP3< 1 532180

fetchmail: POP3< 2 21660

### edited out message 3-31, you get the idea :)

fetchmail: POP3< 32 13165

fetchmail: POP3< 33 2326

fetchmail: POP3< .

skipping message xxxx@pop.vip.sc5.yahoo.com:1 (532180 octets) not flushed

skipping message xxxx@pop.vip.sc5.yahoo.com:2 (21660 octets) not flushed

### edited out message 3-31, you get the idea :)

skipping message xxxx@pop.vip.sc5.yahoo.com:32 (13165 octets) not flushed

skipping message xxxx@pop.vip.sc5.yahoo.com:33 (2326 octets) not flushed

fetchmail: POP3> QUIT

fetchmail: POP3< +OK server signing off.

fetchmail: 6.1.0 querying pop.mail.yahoo.com (protocol POP3) at Tue Oct 15 12:22:02 2002: poll completed

fetchmail: SMTP> QUIT

fetchmail: SMTP< 221 local.mailserver

fetchmail: normal termination, status 0

```

----------

## kerframil

These switches should help:

```
-a, --all         retrieve old and new messages

 -K, --nokeep      delete new messages after retrieval

-F, --flush       delete old messages from server
```

If you check the documentation, then you should see that there are equivalent options that you can put into a .fetchmailrc configuration file if you want any of these options as defaults.

----------

## vert

hey thnx

didn't think it would work, but still manually (with -a ) downloaded all messages and that worked. And now it is downloading new messages...

Beats me, but I'm happy   :Wink: 

----------

## vert

Nop, not happy yet...

It still doesn't work. It only downloaded my test message (and deleted that from the server while I did not specify that).

So still stuck with the same problem   :Sad: 

----------

## kerframil

 *Quote:*   

> So still stuck with the same problem

 

 :Shocked:   That's not good. I'm assuming most of those messages just refuse to budge. I would be inclined to clean them out by other means, perhaps a regular mail client ... or by logging in with telnet and using the DELE command to purge the messages. There are plenty of tutorials around on POP3 and TELNET if you're not sure about the sequence of commands. The notion is to clean the box out, then test again from scratch in the hope that that the problem will not re-occur.

As for the fact that it deleted your test message, AFAIK that is the default behaviour of fetchmail. Adding -k or --keep will prevent that from happening. Afterwards, fetchmail should know that it needn't download the same message again. I guess a more pertinent question is emerging here: how does fetchmail do that? The answer to that may be the answer to the problem ...

----------

## vert

Well, I did do some more digging around while the forums were down   :Smile: 

I found out that the culprit is probably the "LAST" command. As far as I can find, it is not part of the official POP3 protocol. What it probably is supposed to do (or at least what fetchmail expects it to do) is give the number of the last read message in the box. This is then interpreted as the number of seen messages and all the remaining will be downloaded. However, yahoo just returns the last message number and so fetchmail thinks all messages have been seen. The reason I'm thinking along these lines is because other pop servers (like a microsoft one fetchmail is polling) do respond in the way fetchmail expects it to do. However, I'm not sure I'm on the right track  :Confused: 

The weirdest thing is, that very rarely a message 'slips through', as in that is being downloaded by fetchmail.   :Question:   :Question:  Totally no idea why though.

I will try cleaning out the box next, but its not mine, so I will need discuss that with the owner   :Wink: 

----------

## vert

OK, now i'm really stupified! It suddenly works! I didn't touch anything, did not even stop the fetchmail daemon or so much as even look at the config file. First I thought the issue was(is??) related to the webmail, i.e. if you're logged via the web, messages for pop polling are automatically set to 'seen'. But it didn't stop working when I logged in via the web... WHATEVER !

Oh well, we will see how long this lasts.... thnx for the suggestions

----------

