Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fetching mail from Gmail using fetchmail
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
lynz_addict
n00b
n00b


Joined: 31 Jan 2004
Posts: 54
Location: Singapore

PostPosted: Fri Dec 03, 2004 5:11 pm    Post subject: Fetching mail from Gmail using fetchmail Reply with quote

As per the documentation and general instructions on how to configure fetchmail to get mails from mail servers, I installed fetchmail

Code:
root# emerge fetchmail


and, in my home directory (which is /root) I put this file: .fetchmailrc with the following code in it:

Code:
poll pop.gmail.com port 995 plugin "openssl s_client -connect %h:%p" protocol pop3 user "username@gmail.com" password "mypasswd"



But when I used the command to fetch the mail

Code:
root# fetchmail -akv -m "/usr/bin/procmail -d %T"


it gave me errors regarding my certificate :

Quote:
fetchmail: 6.2.5 querying pop.gmail.com (protocol POP3) at Sat Dec 4 00:15:38 2 004: poll started
fetchmail: running openssl s_client -connect %h:%p (host pop.gmail.com service 9 95)
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=pop.gmail.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=pop.gmail.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=pop.gmail.com
verify error:num=21:unable to verify the first certificate
verify return:1
fetchmail: POP3< CONNECTED(00000003)
fetchmail: POP3> QUIT
fetchmail: POP3< ---
fetchmail: client/server protocol error while fetching from pop.gmail.com
fetchmail: 6.2.5 querying pop.gmail.com (protocol POP3) at Sat Dec 4 00:15:40 2 004: poll completed
fetchmail: Query status=4 (PROTOCOL)
fetchmail: normal termination, status 4



Finally, after exhausting gentoo forums, I found out this file configuration. In your .fetchmailrc file(which is in ur home dir) put the following code:

Code:
poll gmail
        proto pop3
        via pop.gmail.com
        user "username@gmail.com"
        pass "$$$$$$"
        is tuxmann
        nokeep
        fetchall
        ssl


Mod Edit: obscured password - tomk

Now, with the same fetchmail command, it is able to access the mail server and get the mail :)

Code:
root# fetchmail -akv -m "/usr/bin/procmail -d %T"

Quote:
fetchmail: 6.2.5 querying gmail (protocol POP3) at Sat Dec 4 00:41:48 2004: poll started
fetchmail: Issuer Organization: Thawte Consulting cc
fetchmail: Issuer CommonName: Thawte Server CA
fetchmail: Server CommonName: pop.gmail.com
fetchmail: Warning: server certificate verification: unable to get local issuer certificate
fetchmail: Issuer Organization: Thawte Consulting cc
fetchmail: Issuer CommonName: Thawte Server CA
fetchmail: Server CommonName: pop.gmail.com
fetchmail: Warning: server certificate verification: certificate not trusted
fetchmail: Issuer Organization: Thawte Consulting cc
fetchmail: Issuer CommonName: Thawte Server CA
fetchmail: Server CommonName: pop.gmail.com
fetchmail: Warning: server certificate verification: unable to verify the first certificate
fetchmail: POP3< +OK Gpop ready.
fetchmail: POP3> CAPA
fetchmail: POP3< +OK Capability list follows
fetchmail: POP3< USER
fetchmail: POP3< RESP-CODES
fetchmail: POP3< EXPIRE 0
fetchmail: POP3< LOGIN-DELAY 300
fetchmail: POP3< .
fetchmail: POP3> USER username@gmail.com
fetchmail: POP3< +OK send PASS
fetchmail: POP3> PASS *
fetchmail: POP3< +OK Welcome.
fetchmail: POP3> STAT
fetchmail: POP3< +OK 0 0
fetchmail: No mail for username@gmail.com at gmail
fetchmail: POP3> QUIT
fetchmail: POP3< +OK Farewell.
fetchmail: 6.2.5 querying gmail (protocol POP3) at Sat Dec 4 00:41:54 2004: poll completed
fetchmail: normal termination, status 1


So, finally I was able to configure my fetchmail to fetch my mails :D . However, I am still wondering what is the significant difference between the two codes that, it allows me to access the mail server w/o validating my certificate :-?
_________________
ADDictED to PoweR!
ADDictED to LiNuX !!!


Last edited by lynz_addict on Fri Dec 03, 2004 6:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
jkt
Retired Dev
Retired Dev


Joined: 06 Feb 2004
Posts: 1250
Location: Prague, Czech republic, EU

PostPosted: Fri Dec 03, 2004 5:23 pm    Post subject: Reply with quote

:lol: you should better delete the password from the configuration ;-), it works :P
Back to top
View user's profile Send private message
etnoy
Apprentice
Apprentice


Joined: 29 Aug 2003
Posts: 255
Location: Västerås, Sweden

PostPosted: Fri Dec 03, 2004 5:56 pm    Post subject: Reply with quote

Haha, posting username and password onto the web isn't the smartest thing to do :P
_________________
The md5sum of the above post is 06280ccd85ef9deb49c336e7945f4b5c

God is dead! - Nietzsche
Nietzsche is dead! -God
Back to top
View user's profile Send private message
jkt
Retired Dev
Retired Dev


Joined: 06 Feb 2004
Posts: 1250
Location: Prague, Czech republic, EU

PostPosted: Fri Dec 03, 2004 5:58 pm    Post subject: Reply with quote

yep, poor man... seems he's likely to loose his account :-(
Back to top
View user's profile Send private message
lynz_addict
n00b
n00b


Joined: 31 Jan 2004
Posts: 54
Location: Singapore

PostPosted: Fri Dec 03, 2004 6:38 pm    Post subject: Reply with quote

Well... thanks man! Changed the password. Didn't notice that while posting.
_________________
ADDictED to PoweR!
ADDictED to LiNuX !!!
Back to top
View user's profile Send private message
jkt
Retired Dev
Retired Dev


Joined: 06 Feb 2004
Posts: 1250
Location: Prague, Czech republic, EU

PostPosted: Fri Dec 03, 2004 6:41 pm    Post subject: Reply with quote

if you have/had some mails with passwords in you mailbox, you should change them, too. and be more carefull next time :-)
Back to top
View user's profile Send private message
cubchai
n00b
n00b


Joined: 11 Sep 2004
Posts: 70

PostPosted: Sat Dec 04, 2004 8:34 am    Post subject: Reply with quote

is it preferable to setup using root or user? i was trying to setup following the gentoo doc , email using CLI. after emerging i can't find the .fetchmailrc file...
Back to top
View user's profile Send private message
jkt
Retired Dev
Retired Dev


Joined: 06 Feb 2004
Posts: 1250
Location: Prague, Czech republic, EU

PostPosted: Sat Dec 04, 2004 12:21 pm    Post subject: Reply with quote

As fetchmail uses standard unix methods of delivering mail, it needs root access to be able to deliver mail for multiple users, AFAIK. But it shloudn't be so hard to set it up to use SMTP delivery.
Default location for config file is $HOME/.procmailrc and /etc/procmailrc (without the leading dot in the second case).

And of course running as much things as possible with non-root privileges is always preferred.
Back to top
View user's profile Send private message
prolific
Apprentice
Apprentice


Joined: 19 Apr 2002
Posts: 237

PostPosted: Sat Dec 04, 2004 11:02 pm    Post subject: Reply with quote

this is no longer necessary as now google provides pop access :D
Back to top
View user's profile Send private message
lynz_addict
n00b
n00b


Joined: 31 Jan 2004
Posts: 54
Location: Singapore

PostPosted: Sun Dec 05, 2004 6:03 pm    Post subject: Reply with quote

Ya. U dun need a root access for fetching mail. I am using my standard user account to fetch mails. The .fetchmailrc is in my $HOME. And ya! the file .fetchmailrc is NOT there by default. You have to create one and put ur settings over there.
_________________
ADDictED to PoweR!
ADDictED to LiNuX !!!
Back to top
View user's profile Send private message
Chaosite
Guru
Guru


Joined: 13 Dec 2003
Posts: 540
Location: Right over here.

PostPosted: Sun Dec 05, 2004 6:55 pm    Post subject: Reply with quote

prolific wrote:
this is no longer necessary as now google provides pop access :D

Actually, it is...
fetchmails works over POP3 (And IMAP, too, actually), and puts it in UNIX style mail boxen (Maildir, .mbox, whatever...).
Back to top
View user's profile Send private message
Highlands
Guru
Guru


Joined: 22 Apr 2003
Posts: 366
Location: Sundsvall, Sweden

PostPosted: Tue Dec 07, 2004 1:56 pm    Post subject: Reply with quote

hm, anyone got a clue about the SSL part of gmail..

I want to use my own certifcate... How do I do this?
_________________
If Windows is the answer, you don't understand the question!
http://counter.li.org/cgi-bin/certificate.cgi/339446
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum