Author Topic: Gmail Thru Qtmail Using Stunnel  (Read 13028 times)

nilch

  • Hero Member
  • *****
  • Posts: 668
    • View Profile
    • http://
Gmail Thru Qtmail Using Stunnel
« 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.
« Last Edit: August 16, 2005, 02:09:33 pm by nilch »
New no more-C1000 / 5000D (sold my 6000 and 750) | Cacko ROM 1.23 on C1000 | 256 MB CF | 2GB PNY SD card | Socket Networker WiFi CF Card | USB Host cable from StreamlineCPUS | Mini Microphone (for voice recording) |

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Gmail Thru Qtmail Using Stunnel
« Reply #1 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
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

inode0

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Gmail Thru Qtmail Using Stunnel
« Reply #2 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

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Gmail Thru Qtmail Using Stunnel
« Reply #3 on: August 09, 2005, 04:26:07 pm »
thats it trying this for kopimail.....will come back later with results
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Gmail Thru Qtmail Using Stunnel
« Reply #4 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.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

inode0

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Gmail Thru Qtmail Using Stunnel
« Reply #5 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

nilch

  • Hero Member
  • *****
  • Posts: 668
    • View Profile
    • http://
Gmail Thru Qtmail Using Stunnel
« Reply #6 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.
 
New no more-C1000 / 5000D (sold my 6000 and 750) | Cacko ROM 1.23 on C1000 | 256 MB CF | 2GB PNY SD card | Socket Networker WiFi CF Card | USB Host cable from StreamlineCPUS | Mini Microphone (for voice recording) |

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Gmail Thru Qtmail Using Stunnel
« Reply #7 on: August 11, 2005, 04:31:03 pm »
has anyone got this to work with kopi? Followed the above instructions and no-go.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

inode0

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Gmail Thru Qtmail Using Stunnel
« Reply #8 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

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Gmail Thru Qtmail Using Stunnel
« Reply #9 on: August 12, 2005, 12:04:31 am »
how do I do that? I am a n00b, big time.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

inode0

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Gmail Thru Qtmail Using Stunnel
« Reply #10 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

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Gmail Thru Qtmail Using Stunnel
« Reply #11 on: August 12, 2005, 03:29:33 pm »
i dont even think its running, can you point me to some tutorials?
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

inode0

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Gmail Thru Qtmail Using Stunnel
« Reply #12 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 for lots of information and examples.

John

nilch

  • Hero Member
  • *****
  • Posts: 668
    • View Profile
    • http://
Gmail Thru Qtmail Using Stunnel
« Reply #13 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]
« Last Edit: August 12, 2005, 04:42:27 pm by nilch »
New no more-C1000 / 5000D (sold my 6000 and 750) | Cacko ROM 1.23 on C1000 | 256 MB CF | 2GB PNY SD card | Socket Networker WiFi CF Card | USB Host cable from StreamlineCPUS | Mini Microphone (for voice recording) |

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Gmail Thru Qtmail Using Stunnel
« Reply #14 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
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder