# Accessing gmail account via POP3

**URL:** <https://rubytalk.org/t/accessing-gmail-account-via-pop3/17439>\
**Category:** ruby-talk\
**Created:** [5 April 2005 15:59 UTC](https://rubytalk.org/t/accessing-gmail-account-via-pop3/17439 "2005-04-05T15:59:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ptkwt](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Ptkwt](https://rubytalk.org/u/Ptkwt)\
**Post date:** [5 April 2005 15:59 UTC](https://rubytalk.org/t/accessing-gmail-account-via-pop3/17439/1 "2005-04-05T15:59:45Z")

</div>

Has anyone written any Ruby code for accessing their gmail account that  
they would be willing to share?

Here are the requirements according to google:

[pop.gmail.com](http://pop.gmail.com)  
Use SSL: Yes  
Port: 995

Phil

---

<div class="post-metadata">

**Author:** ![Douglas\_Livingstone](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@Douglas\_Livingstone](https://rubytalk.org/u/Douglas_Livingstone)\
**Post date:** [5 April 2005 17:51 UTC](https://rubytalk.org/t/accessing-gmail-account-via-pop3/17439/2 "2005-04-05T17:51:02Z")

</div>

Would this help?

[http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/classes/Net/POP3.html](http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/classes/Net/POP3.html)

Douglas

> **···**
>
> On Apr 5, 2005 4:59 PM, Phil Tomson \<ptkwt@aracnet.com\> wrote:
> 
> > Has anyone written any Ruby code for accessing their gmail account that  
> > they would be willing to share?
> > 
> > Here are the requirements according to google:
> > 
> > pop.gmail.com  
> > Use SSL: Yes  
> > Port: 995
> > 
> > Phil

---

<div class="post-metadata">

**Author:** ![Doug\_Beaver](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@Doug\_Beaver](https://rubytalk.org/u/Doug_Beaver)\
**Post date:** [5 April 2005 21:14 UTC](https://rubytalk.org/t/accessing-gmail-account-via-pop3/17439/3 "2005-04-05T21:14:52Z")

</div>

> Has anyone written any Ruby code for accessing their gmail account  
> that they would be willing to share?
> 
> Here are the requirements according to google:

ruby-core#2703 and ruby-core#2745 include patches to add ssl support to  
Net::POP3. from the thread, it looks like it was checked in, but maybe  
into 1.9 only?

i imagine you could use the patches as a guide and write a small wrapper  
class that sets up the SSLSocket to gmail...

doug

> **···**
>
> On Wed, Apr 06, 2005 at 12:59:45AM +0900, Phil Tomson wrote:
> 
> > pop.gmail.com  
> > Use SSL: Yes  
> > Port: 995
> > 
> > Phil
> 
> --  
> "Contrary to what most people say, the most dangerous animal in the  
> world is not the lion or the tiger or even the elephant. It's a shark  
> riding on an elephant's back, just trampling and eating everything they  
> see." -- Jack Handey

---

<div class="post-metadata">

**Author:** ![Eric\_Anderson1](https://avatars.discourse-cdn.com/v4/letter/e/57b2e6/32.png) [@Eric\_Anderson1](https://rubytalk.org/u/Eric_Anderson1)\
**Post date:** [11 April 2005 14:59 UTC](https://rubytalk.org/t/accessing-gmail-account-via-pop3/17439/4 "2005-04-11T14:59:50Z")

</div>

Phil Tomson wrote:

> Has anyone written any Ruby code for accessing their gmail account that they would be willing to share?
> 
> Here are the requirements according to google:
> 
> pop.gmail.com  
> Use SSL: Yes  
> Port: 995

I have a bit of code that might help. I briefly tried Kapsules since it had Ruby support but I found it to be unstable, slow and resource intensive. But while I was using it I needed to get the Mail Kapsule using SSL and since it was written in Ruby I added the necessary support. Of course ruby-1.8 doesn't support SSL but the CVS version does so I sort of backported it (my version is a bit simpler, therefore the interface is different). The great thing is with Ruby this backport only took about 1 hour! Anyway I have attached my modified mail kapsule file. You don't need all the kapsule stuff. Just the stuff at the end where I add added the SSL POP3 support. I included the entire script so you can see how the code should be used (plus I'm too lazy to cut out just the parts you need).

Eric

[kapmail.kap](https://rubytalk.org/uploads/short-url/cQGr1dE1feWvgBDvPDbV4SDcWcN.kap) (9.53 KB)

---

<div class="post-metadata">

**Author:** ![Pete\_Elmore](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@Pete\_Elmore](https://rubytalk.org/u/Pete_Elmore)\
**Post date:** [5 April 2005 19:24 UTC](https://rubytalk.org/t/accessing-gmail-account-via-pop3/17439/5 "2005-04-05T19:24:23Z")

</div>

Douglas Livingstone wrote:

> Would this help?
> 
> [http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/classes/Net/POP3.html](http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/classes/Net/POP3.html)

It doesn't support SSL, does it? I couldn't find anything about it in the docs. I tried this about a week or two ago, and was unable to get it to authenticate me without SSL.
