Help - Search - Members - Calendar
Full Version: Gmail Thru Qtmail Using Stunnel
OESF Forums > General Forums > General Support and Discussion > Software
nilch
At last after a lot of googling, OE Forum posts and the help frm there and generally trial-and error methods I have been able to get this seemingly simple thing up and running.

So for those who are trying to figure out the steps in details (that was what was missing from the posts here - no particulars)...

1) Install Stunnel from the ipk available (at Killefiz for example)

2) Since this installation doesn't seem to create a Stunnel directory and the corresponding stunnel.conf file anywhere create it manually
a) create /etc/stunnel directory
cool.gif create stunnel.conf file inisde the /etc/stunnel directory (use VI and QZed)

the stunnel.conf file contents as I have it now...
###################
client = yes
debug=debug

# Configure the secured POP3 services
[pop3s]
accept = 127.0.0.1:110
connect=pop.gmail.com:995
###################


3) Edit the /etc/inietd.conf file and add a line to enable pop thru stunnel

pop3 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/stunnel /etc/stunnel/stunnel.conf -r pop.gmail.com:995 -c

This is to make the tcpd service accept and connect thru stunnel (located in /usr/sbin) and make stunnel use the stunnel.conf file in /etc/stunnel with switches -r -c (maybe this is redundandant since the connect IP and port is already defined in stunnel.conf. I havent yet tried it without the -r switch.

After making the change to inetd.conf file restart the inetd service from the terminal
> su
> killall -hup inetd

4) Setup the gmail account in QtMail
The Incoming details are as
-----------------------------------
Choose account type : POP3
Username : whatever@gmail.com
Password : ******** (use your password here)
Server : 127.0.0.1
Port : 110


Now after connecting , and starting QtMail, I am able to receive all my Gmail emails on my Zaurus as pop mail.
Note : Gmail must already be configued to have POP mail service enabled (go to settings in Gmail)

I still haven't tried the outgoing mail using the smtp.gmail.com server at port 465, but at least I have incoming working.

Thanks to all who helped in the forums and at least gave helpful pointers.
Hope this helps and please correct me anyone if I am using redundant switches or settings anywhere...

EDIT : I need to add that on the default Sharp ROM, you also need to install openssl for stunnel to work. Thanks to a much later post by inode0, I remembered that openssl is also a requirement. Since I had it installed already from previously, I missed that. Thanks to inode0 for the helpful pointer.
bam
cool, wonder if it'll work with KopieMail. BTW I have sylpheed working on both outgoing and incoming(outgoing will give an error, just ignore it) the mail does go thru. Unless of course you can figure out the error and correct it smile.gif
inode0
QUOTE(nilch @ Aug 8 2005, 04:44 PM)
3) Edit the /etc/inietd.conf file and add a line to enable pop thru stunnel

pop3      stream      tcp      nowait    root    /usr/sbin/tcpd    /usr/sbin/stunnel /etc/stunnel/stunnel.conf -r pop.gmail.com:995 -c

I'm running stunnel-4.11 as a daemon and it works fine for both incoming and outgoing gmail using qtmail.

Thanks for the post reminding me to set this up.

John
bam
thats it trying this for kopimail.....will come back later with results
bam
QUOTE(inode0 @ Aug 9 2005, 08:27 AM)
QUOTE(nilch @ Aug 8 2005, 04:44 PM)
3) Edit the /etc/inietd.conf file and add a line to enable pop thru stunnel

pop3       stream      tcp      nowait     root    /usr/sbin/tcpd    /usr/sbin/stunnel /etc/stunnel/stunnel.conf -r pop.gmail.com:995 -c

I'm running stunnel-4.11 as a daemon and it works fine for both incoming and outgoing gmail using qtmail.

Thanks for the post reminding me to set this up.

John
*




so how about putting up a how-to on this, I'm curious if I can get this to work with ko/pi then I can quit using sylpheed.
inode0
QUOTE(bam @ Aug 11 2005, 08:16 AM)
so how about putting up a how-to on this, I'm curious if I can get this to work with ko/pi then I can quit using sylpheed.

Ok, I'll try to fill in the gaps assuming you have stunnel configured for normal use.

In stunnel.conf (or whatever configuration file you want to use for this) I have

[gmail-pop3s]
accept = localhost:10110
connect = pop.gmail.com:995

[gmail-smtps]
accept = localhost:10025
connect = smtp.gmail.com:587
protocol = smtp

Then configure the email client to talk to the local ports 10110 and 10025 for incoming and ougoing mail. For qtmail I use the following setting for outgoing

SMTP server: 127.0.0.1
SMTP port: 10025
with authentication set to match incoming settings.

For incoming I use

Account type: POP3
Server: 127.0.0.1
Port: 10110

If you are using tcpwrappers with this you'll need to allow access from 127.0.0.1 to the services defined above. If you get it working and want to start stunnel at boot I add a symlink from /etc/rc.d/rc5.d/S99local to /etc/rc.d/rc.local and add this to rc.local
CODE
# Gmail via stunnel ...
if [ -x /usr/sbin/stunnel ]; then
 /usr/sbin/stunnel /etc/stunnel/stunnel.conf
fi

or you can just start stunnel from the command line when you want to do mail.

Hope this helps. Hope I haven't forgotten anything too important. Let me know how it goes.

John
nilch
Thanks for the SMTP section...

Good news - now that I have Gmail working fine, I just saved myself a bunch of money by switching to geico, uh, sorry Gmail wink.gif

... and I cancelled my previous paid ISP POP email service and a dial-up which I never used.
smile.gif
bam
has anyone got this to work with kopi? Followed the above instructions and no-go.
inode0
QUOTE(bam @ Aug 11 2005, 08:31 PM)
has anyone got this to work with kopi? Followed the above instructions and no-go.

Can you turn on debugging in stunnel and post the errors you are receiving and maybe we can help? Can you telnet to ports 10110 and 10025 and let us know what you get?

John
bam
how do I do that? I am a n00b, big time.
inode0
QUOTE(bam @ Aug 12 2005, 04:04 AM)
how do I do that? I am a n00b, big time.


As root,

# touch /var/log/stunnel

Add

output = /var/log/stunnel
debug = 7

to your stunnel.conf file and restart stunnel. You should see something written to /var/log/stunnel at this point.

# telnet localhost 10110

and

# telnet localhost 10025

and check for output both on the terminal and in /var/log/stunnel. Usually this will at least tell us if stunnel is configured properly.

John
bam
i dont even think its running, can you point me to some tutorials?
inode0
QUOTE(bam @ Aug 12 2005, 07:29 PM)
i dont even think its running, can you point me to some tutorials?

Check the stunnel website for lots of information and examples.

John
nilch
Are you trying to run Stunnel as a daemon or as a Inetd Service ?

Based on that you can understand if its running or not. As a inetd service it won't show up "running" when you do a ps command.

You might , from the command line do
/usr/sbin/tcpd /usr/sbin/stunnel /etc/stunnel/stunnel.conf

and see if the pop server is accepting connection thru stunnel
(provided you have made the /etc/stunnel/stunnel.conf file already)



QUOTE(bam @ Aug 12 2005, 02:29 PM)
i dont even think its running, can you point me to some tutorials?
*
bam
I would like to run it as a daemon
so the command line should be
stunnel /path/to/stunnel.conf -L
right? Or am I wrong?
Is giving me a illeagal option fault
inode0
QUOTE(bam @ Aug 13 2005, 02:04 AM)
I would like to run it as a daemon
so the command line should be
stunnel /path/to/stunnel.conf -L
right? Or am I wrong?
Is giving me a illeagal option fault

Just /path/to/stunnel /path/to/stunnel.conf is enough if everything is configured in stunnel.conf.

John
nilch
The -l switch expects a program name after it... you have to specify which program to run thru stunnel

So the command should be more like
stunnel /path/to/stunnel.conf -L <program like pppd>

See this site for example of stunnel as a daemon
http://www.onsight.com/faq/stunnel/stunnel-faq-6.html

hope this helps

QUOTE(bam @ Aug 12 2005, 09:04 PM)
I would like to run it as a daemon
so the command line should be
stunnel /path/to/stunnel.conf -L
right? Or am I wrong?
Is giving me a illeagal option fault
*
inode0
QUOTE(bam @ Aug 8 2005, 08:22 PM)
cool, wonder if it'll work with KopieMail. BTW I have sylpheed working on both outgoing and incoming(outgoing will give an error, just ignore it) the mail does go thru. Unless of course you can figure out the error and correct it smile.gif

I took a look at kopiemail tonight and it seems to work fine with gmail without stunnel at all assuming you have openssl installed.

For outgoing use these settings:

Account: Gmail SMTP
Server: smtp.gmail.com
Port: 587
Use secure sockets: Always, use TLS
Check Use Login
User: your gmail account name
Password: you gmail password

For incoming use these settings:

Account: Gmail POP3
Server: pop.gmail.com
Port: 995
Use secure sockets: Connect on secure port
User: your gmail account name
Password: your gmail password
Other setting however you like

Maybe you could give this a try? Seems to work fine here.

John
bam
cool i will try it
bam
folder initialization error 5...seems to not work, what openssl version do you have?

fixed: gotta have the @gmail.com...doh!
inode0
QUOTE(bam @ Aug 16 2005, 07:24 PM)
folder initialization error 5...seems to not work, what openssl version do you have?

fixed: gotta have the @gmail.com...doh!

So it is working for you now?

I like kopiemail better than qtmail from my very brief exposure to each.

John
bam
yup working great, a little slow, but I am in no rush.
inode0
QUOTE(bam @ Aug 16 2005, 08:08 PM)
yup working great, a little slow, but I am in no rush.

Good beans!

John
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.