Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > General Help
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

General Help
All your general support questions for Ubuntu, Kubuntu, Edubuntu and Xubuntu.

 
Thread Tools Display Modes
Old September 12th, 2008   #1
flabdablet
Just Give Me the Beans!
 
Join Date: Dec 2005
Beans: 78
Lightbulb HowTo: make XSane and Gmail play nice

XSane has a scan-to-email facility that knows how to talk to an SMTP server. Gmail uses an SMTP server that requires a secure (SSL) connection. XSane's SMTP support doesn't do SSL. I didn't want to install and configure a full-blown MTA like Postfix or Exim just to make these things work together. Here's what I did instead.

First thing is to make sure the necessary packages are installed:
Code:
sudo apt-get install openssl xinetd
Next, create a little wrapper to talk to the Gmail SMTP server without injecting extra text we don't want:
Code:
sudo tee /usr/bin/gmail-smtp <<EOF >/dev/null
#!/bin/sh
/usr/bin/openssl s_client -connect smtp.gmail.com:465 -quiet 2>/dev/null
EOF
sudo chmod +x /usr/bin/gmail-smtp
Test the connection:
Code:
gmail-smtp
After a short delay, you should see something like
220 mx.google.com ESMTP f42sm17489123rvb.6
If you then type
helo
you should get something like
250 mx.google.com at your service
and typing
quit
should get you
221 2.0.0 mx.google.com closing connection f42sm17489123rvb.6
and your shell prompt back.

Now we need to make that wrapper available as a local network service, so XSane can use it:
Code:
sudo tee /etc/xinetd.d/gmail-smtp <<EOF >/dev/null
# default: on
# description: Gmail SMTP wrapper for clients without SSL support
service gmail-smtp
{
    disable         = no
    bind            = localhost
    port            = 10025
    socket_type     = stream
    protocol        = tcp
    wait            = no
    user            = root
    server          = /usr/bin/gmail-smtp
    type            = unlisted
}
EOF
sudo /etc/init.d/xinetd reload
The output of
Code:
netstat -ltn
should now include a line that looks like this:
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN
and
Code:
telnet localhost 10025
should get you a conversation with Gmail's SMTP server like the one you had above.

All that remains is to configure XSane. Under the Email tab in the Setup menu, set the SMTP server address to localhost, the port to 10025, fill in your Gmail account details, and select ASMTP Login authorization.

I'm subscribed to this thread in case you have trouble. Enjoy!
flabdablet is offline   Reply With Quote
Old August 26th, 2009   #2
FedeGhigo
First Cup of Ubuntu
 
Join Date: Aug 2007
Beans: 5
Re: HowTo: make XSane and Gmail play nice

A fantastic & easy guide ! Thank you very much.
FedeGhigo is offline   Reply With Quote
Old November 4th, 2009   #3
toasted124
First Cup of Ubuntu
 
Join Date: Nov 2009
Beans: 1
Re: HowTo: make XSane and Gmail play nice

Thank-you so much for publishing this guide and sharing this information!!!!!! I used it to create a connection to yahoo mail as well.

I followed the procedure exactly, replacing gmail-smtp with yahoo-smtp and it works!

Xsane now is able to send scanned images to recipients via SSL on yahoo mail.
toasted124 is offline   Reply With Quote

Bookmarks

Tags
gmail, smtp, ssl, xsane

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:20 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry