OESF Portables Forum

Everything Else => General Support and Discussion => Zaurus General Forums => Archived Forums => Software => Topic started by: nilch on August 08, 2005, 12:44:24 pm

Title: Gmail Thru Qtmail Using Stunnel
Post by: nilch on August 08, 2005, 12:44:24 pm
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
 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.
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 08, 2005, 04:22:58 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
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 09, 2005, 12:27:03 pm
Quote
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
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 09, 2005, 04:26:07 pm
thats it trying this for kopimail.....will come back later with results
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 11, 2005, 04:16:58 am
Quote
Quote
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=91247\"][{POST_SNAPBACK}][/a][/div]


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.
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 11, 2005, 01:41:24 pm
Quote
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: [Select]
# 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
Title: Gmail Thru Qtmail Using Stunnel
Post by: nilch on August 11, 2005, 03:50:00 pm
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    

... and I cancelled my previous paid ISP POP email service and a dial-up which I never used.
 
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 11, 2005, 04:31:03 pm
has anyone got this to work with kopi? Followed the above instructions and no-go.
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 11, 2005, 04:37:24 pm
Quote
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
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 12, 2005, 12:04:31 am
how do I do that? I am a n00b, big time.
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 12, 2005, 11:42:12 am
Quote
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
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 12, 2005, 03:29:33 pm
i dont even think its running, can you point me to some tutorials?
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 12, 2005, 04:01:43 pm
Quote
i dont even think its running, can you point me to some tutorials?
Check the stunnel website (http://www.stunnel.org/) for lots of information and examples.

John
Title: Gmail Thru Qtmail Using Stunnel
Post by: nilch on August 12, 2005, 04:26:52 pm
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
i dont even think its running, can you point me to some tutorials?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=91619\"][{POST_SNAPBACK}][/a][/div]
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 12, 2005, 10:04:03 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
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 13, 2005, 01:32:16 am
Quote
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
Title: Gmail Thru Qtmail Using Stunnel
Post by: nilch on August 13, 2005, 02:11:24 pm
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 (http://www.onsight.com/faq/stunnel/stunnel-faq-6.html)

hope this helps

Quote
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=91646\"][{POST_SNAPBACK}][/a][/div]
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 15, 2005, 11:46:12 pm
Quote
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
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
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 16, 2005, 01:55:04 am
cool i will try it
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 16, 2005, 03:24:00 pm
folder initialization error 5...seems to not work, what openssl version do you have?

fixed: gotta have the @gmail.com...doh!
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 16, 2005, 03:33:41 pm
Quote
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
Title: Gmail Thru Qtmail Using Stunnel
Post by: bam on August 16, 2005, 04:08:23 pm
yup working great, a little slow, but I am in no rush.
Title: Gmail Thru Qtmail Using Stunnel
Post by: inode0 on August 16, 2005, 04:14:08 pm
Quote
yup working great, a little slow, but I am in no rush.
Good beans!

John