# Playing with

**URL:** <https://www.ruby-forum.com/t/playing-with/171216>\
**Category:** Ruby\
**Created:** [June 29, 2009, 1:57am UTC](https://www.ruby-forum.com/t/playing-with/171216 "2009-06-29T01:57:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fearx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/82dd89/32.png) [@fearx](https://www.ruby-forum.com/u/fearx)\
**Post date:** [June 29, 2009, 1:57am UTC](https://www.ruby-forum.com/t/playing-with/171216/1 "2009-06-29T01:57:07Z")

</div>

Hi I am playing with the Net::POP3 library and some questions have  
jumped up on my head:

This is my code:

```
Net::POP3.start( 'pop.gmail.com', 995, account_user, account_pass ) do
|pop|
  pop.each_mail do |m|
    puts m.header
    m.delete
  end
end
```

1. what does m.delete mean?

* * *

Because as you see I am using it, It suppose to be that I am deleting  
the emails on the server, but the emails are still there when try to  
access with my client.

Maybe this is because I am testing with a gmail account and it does  
weird things… I don’t know.

1. how does Net::POP3 detect when an email is already readed and when  
not?

* * *

Because I had a lot unread emails on my testing.gmail.account and the  
script does not download them.

And on other test I sent a few emails to my testing.gmail.account and  
then I read the half of them and then I run my script and it downloaded  
all of them, the readed and the unread.

And once the script has downloaded all of the emails, I go to my  
gmail.web.email.client and all of them appear as unread.

1. how can I download an email I have already downloaded

* * *

How I said on the question 2) does not matter if I mark the email as  
unread or not on my gmail.web.email.client.

Once my script has downloaded an email it does not download it again.

I don’t think this behavior is not correct, I am a few confused… that’s  
all.

Maybe this is not a Ruby question and goes closer to pop protocol… I  
don’t know

Any suggestion is welcome.

f.

---

<div class="post-metadata">

**Author:** ![fearx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/82dd89/32.png) [@fearx](https://www.ruby-forum.com/u/fearx)\
**Post date:** [June 29, 2009, 4:22am UTC](https://www.ruby-forum.com/t/playing-with/171216/2 "2009-06-29T04:22:26Z")

</div>

Hi Fernando,

Though I am not knowledgeable on the specifics, I would recommend you  
start by using a different POP service to test against - my  
understanding is that Gmail implements the POP3 interface but its  
behavior is quite nonstandard (e.g., a “Delete” I believe just  
archives the message, etc.)

Mat

---

<div class="post-metadata">

**Author:** ![fearx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/82dd89/32.png) [@fearx](https://www.ruby-forum.com/u/fearx)\
**Post date:** [June 29, 2009, 1:58am UTC](https://www.ruby-forum.com/t/playing-with/171216/3 "2009-06-29T01:58:04Z")

</div>

Sorry the subject of the previews message was wrong.
