threads / discuss / 11536

gmail smtp server and git-send-mail. Is this combination working?

Subject: gmail smtp server and git-send-mail. Is this combination working?

## tl;dr

14 messages between Jan 8, 2008 and Feb 24, 2008.

replies: 13people: 6as markdown or json

Paolo Ciarrocchi· Jan 8, 2008, 16:58 UTC · lore

Hi all, as I previously wrote I would like to use git-send-email to send out a series of patches. While I was looking for documentation I saw the following statement in the git wiki:

" Mailing off a set of patches to a mailing list can be quite neatly done by git-send-email. One of the problems you may encounter there is figuring out which machine is going to send your mail. I tried smtp.gmail.com, but that one requires tls and a password, and git-send-email could not handle that "

>From http://git.or.cz/gitwiki/GitTips.

Is this statemant still correct ? Is msmtp the only solution for using git-send-mail with gmail? (tls + autentication).

Thanks.
regards,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/
Jason Sewall· Jan 8, 2008, 18:16 UTC · re: Paolo Ciarrocchi · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

I've had luck with msmtp: http://msmtp.sourceforge.net/; it's basically a drop-in replacement for sendmail that supports the authentication gmail requires.

A quick prayer to the Gods of Google portended this blog entry, which spells out how to configure it for gmail pretty plainly: http://typo.onxen.info/articles/2006/06/27/activemailer-sending-via-gmail

Then you just need to specify --smtp-serve /path/to/msmtp to send-email and you're all set.

Jason
On Jan 8, 2008 11:58 AM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
Show 30 quoted lines
> Hi all,
> as I previously wrote I would like to use git-send-email to send out a series
> of patches.
> While I was looking for documentation I saw the following statement in the
> git wiki:
>
> " Mailing off a set of patches to a mailing list can be quite neatly
> done by git-send-email.
> One of the problems you may encounter there is figuring out which machine
> is going to send your mail.
> I tried smtp.gmail.com, but that one requires tls and a password,
> and git-send-email could not handle that "
>
> From http://git.or.cz/gitwiki/GitTips.
>
> Is this statemant still correct ?
> Is msmtp the only solution for using git-send-mail with gmail? (tls +
> autentication).
>
> Thanks.
>
> regards,
> --
> Paolo
> http://paolo.ciarrocchi.googlepages.com/
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Pascal Obry· Jan 8, 2008, 18:25 UTC · re: Paolo Ciarrocchi · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

Paolo,

I never tried msmtp. I'm using Cygwin ssmtp to send e-mail via Google mail. Works fine. If it can be useful to others:

My /etc/ssmtp/ssmtp.conf:

root=<username>@gmail.com mailhub=smtp.gmail.com:587 FromLineOverride=YES hostname=<username>@gmail.com rewriteDomain= UseSTARTTLS=YES AuthUser=<username>@gmail.com AuthPass=<password>

Pascal.
-- 
--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
Imran M Yousuf· Jan 9, 2008, 03:12 UTC · re: Paolo Ciarrocchi · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

Hi Paolo,

I just setup GMail with git-send-email using http://git.or.cz/gitwiki/GitTips#head-a015948617d9becbdc9836776f96ad244ba87cb8.

Just add port 587 below the host and it should work fine. In the username it should some.user.name@gmail.com.

Best regards,
Imran
On Jan 8, 2008 10:58 PM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
Show 30 quoted lines
> Hi all,
> as I previously wrote I would like to use git-send-email to send out a series
> of patches.
> While I was looking for documentation I saw the following statement in the
> git wiki:
>
> " Mailing off a set of patches to a mailing list can be quite neatly
> done by git-send-email.
> One of the problems you may encounter there is figuring out which machine
> is going to send your mail.
> I tried smtp.gmail.com, but that one requires tls and a password,
> and git-send-email could not handle that "
>
> From http://git.or.cz/gitwiki/GitTips.
>
> Is this statemant still correct ?
> Is msmtp the only solution for using git-send-mail with gmail? (tls +
> autentication).
>
> Thanks.
>
> regards,
> --
> Paolo
> http://paolo.ciarrocchi.googlepages.com/
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran@smartitengineering.com
Mobile: +880-1711402557
Douglas Stockwell· Jan 9, 2008, 04:06 UTC · re: Paolo Ciarrocchi · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

Paolo Ciarrocchi wrote:
Show 12 quoted lines
> " Mailing off a set of patches to a mailing list can be quite neatly
> done by git-send-email.
> One of the problems you may encounter there is figuring out which machine
> is going to send your mail.
> I tried smtp.gmail.com, but that one requires tls and a password,
> and git-send-email could not handle that "
> 
> From http://git.or.cz/gitwiki/GitTips.
> 
> Is this statemant still correct ?
> Is msmtp the only solution for using git-send-mail with gmail? (tls +
> autentication).

No, as of 34cc60ce2b48f6037997543ddbab1ed9903df4a8 you can use SSL and SMTP-Auth.

[sendemail]
         smtpserver = smtp.gmail.com
         smtpuser = <user>@gmail.com
         smtppass = <password>
         smtpssl = true
Can you suggest changes to the documentation if these options are unclear?
Doug
Paolo Ciarrocchi· Jan 9, 2008, 23:09 UTC · re: Douglas Stockwell · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

On Jan 9, 2008 5:06 AM, Douglas Stockwell <doug@11011.net> wrote:
Show 24 quoted lines
> Paolo Ciarrocchi wrote:
> > " Mailing off a set of patches to a mailing list can be quite neatly
> > done by git-send-email.
> > One of the problems you may encounter there is figuring out which machine
> > is going to send your mail.
> > I tried smtp.gmail.com, but that one requires tls and a password,
> > and git-send-email could not handle that "
> >
> > From http://git.or.cz/gitwiki/GitTips.
> >
> > Is this statemant still correct ?
> > Is msmtp the only solution for using git-send-mail with gmail? (tls +
> > autentication).
>
> No, as of 34cc60ce2b48f6037997543ddbab1ed9903df4a8 you can use SSL and
> SMTP-Auth.
>
> [sendemail]
>          smtpserver = smtp.gmail.com
>          smtpuser = <user>@gmail.com
>          smtppass = <password>
>          smtpssl = true
>
> Can you suggest changes to the documentation if these options are unclear?

Well, it would be nice to add this information to the wiki, it's still mentioning that you require an external program for supporting the TLS connection. I'll do that when I'll get my box working with the configuration you suggested,

What I'm getting at the moment is: paolo@paolo-desktop:~/git$ git-send-email -compose -to paolo.ciarrocchi@gmail.com /home/paolo/Desktop/patch/ snip snip Can't locate Net/SMTP/SSL.pm in @INC (@INC contains: /home/paolo/share/perl/5.8.8 /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /home/paolo/bin/git-send-email line 627.

Tv on #git helped me in finding an Ubuntu package which includes SSL.pm : http://packages.ubuntu.com/cgi-bin/search_contents.pl?word=SSL.pm&searchmode=searchfiles&case=insensitive&version=gutsy&arch=i386 which repors: usr/lib/perl5/Net/SSL.pm perl/libcrypt-ssleay-perl [universe] usr/share/perl5/HTTP/Daemon/SSL.pm perl/libhttp-daemon-ssl-perl [universe] usr/share/perl5/IO/Socket/SSL.pm perl/libio-socket-ssl-perl usr/share/perl5/Net/IMAP/Simple/SSL.pm perl/libnet-imap-simple-ssl-perl [universe] usr/share/perl5/Net/Server/Proto/SSL.pm perl/libnet-server-perl [universe] usr/share/perl5/POE/Component/Client/HTTP/SSL.pm perl/libpoe-component-client-http-perl [universe]

I installed libcrypt-ssleay-perl but still no luck.
Regards,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/
Douglas Stockwell· Jan 10, 2008, 03:45 UTC · re: Paolo Ciarrocchi · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

Paolo Ciarrocchi wrote:
Show 11 quoted lines
> Well, it would be nice to add this information to the wiki, it's still
> mentioning
> that you require an external program for supporting the TLS connection.
> I'll do that when I'll get my box working with the configuration you suggested,
> 
> What I'm getting at the moment is:
> paolo@paolo-desktop:~/git$ git-send-email -compose -to
> paolo.ciarrocchi@gmail.com /home/paolo/Desktop/patch/
> snip
> snip
> Can't locate Net/SMTP/SSL.pm in @INC (@INC contains:

As indicated, the module you need is Net::SMTP::SSL, if there is no package for ubuntu, you can install it using CPAN:

perl -MCPAN -e 'install Net::SMTP::SSL'
Doug
Paolo Ciarrocchi· Jan 10, 2008, 11:13 UTC · re: Douglas Stockwell · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

On Jan 10, 2008 4:45 AM, Douglas Stockwell <doug@11011.net> wrote:
Show 18 quoted lines
> Paolo Ciarrocchi wrote:
>
> > Well, it would be nice to add this information to the wiki, it's still
> > mentioning
> > that you require an external program for supporting the TLS connection.
> > I'll do that when I'll get my box working with the configuration you suggested,
> >
> > What I'm getting at the moment is:
> > paolo@paolo-desktop:~/git$ git-send-email -compose -to
> > paolo.ciarrocchi@gmail.com /home/paolo/Desktop/patch/
> > snip
> > snip
> > Can't locate Net/SMTP/SSL.pm in @INC (@INC contains:
>
> As indicated, the module you need is Net::SMTP::SSL, if there is no
> package for ubuntu, you can install it using CPAN:
>
> perl -MCPAN -e 'install Net::SMTP::SSL'

Thank you. I'll try that and update the wiki with the information you provided as soon as I have git-send-email working properly :-)

Ciao,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/
Paolo Ciarrocchi· Jan 10, 2008, 22:49 UTC · re: Douglas Stockwell · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

On Jan 10, 2008 4:45 AM, Douglas Stockwell <doug@11011.net> wrote:
Show 18 quoted lines
> Paolo Ciarrocchi wrote:
>
> > Well, it would be nice to add this information to the wiki, it's still
> > mentioning
> > that you require an external program for supporting the TLS connection.
> > I'll do that when I'll get my box working with the configuration you suggested,
> >
> > What I'm getting at the moment is:
> > paolo@paolo-desktop:~/git$ git-send-email -compose -to
> > paolo.ciarrocchi@gmail.com /home/paolo/Desktop/patch/
> > snip
> > snip
> > Can't locate Net/SMTP/SSL.pm in @INC (@INC contains:
>
> As indicated, the module you need is Net::SMTP::SSL, if there is no
> package for ubuntu, you can install it using CPAN:
>
> perl -MCPAN -e 'install Net::SMTP::SSL'

I'm now getting: Unable to initialize SMTP properly. Is there something wrong with your config? at /home/paolo/bin/git-send-email line 638.

I tried to get help on #git but I failed, it looks like other people are getting the same error.

Ciao,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/
Baz· Jan 11, 2008, 12:19 UTC · re: Paolo Ciarrocchi · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

On Jan 10, 2008 10:49 PM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
Show 23 quoted lines
> On Jan 10, 2008 4:45 AM, Douglas Stockwell <doug@11011.net> wrote:
> > Paolo Ciarrocchi wrote:
> >
> > > Well, it would be nice to add this information to the wiki, it's still
> > > mentioning
> > > that you require an external program for supporting the TLS connection.
> > > I'll do that when I'll get my box working with the configuration you suggested,
> > >
> > > What I'm getting at the moment is:
> > > paolo@paolo-desktop:~/git$ git-send-email -compose -to
> > > paolo.ciarrocchi@gmail.com /home/paolo/Desktop/patch/
> > > snip
> > > snip
> > > Can't locate Net/SMTP/SSL.pm in @INC (@INC contains:
> >
> > As indicated, the module you need is Net::SMTP::SSL, if there is no
> > package for ubuntu, you can install it using CPAN:
> >
> > perl -MCPAN -e 'install Net::SMTP::SSL'
>
> I'm now getting:
> Unable to initialize SMTP properly.  Is there something wrong with
> your config? at /home/paolo/bin/git-send-email line 638.

You also need to have Authen::SASL installed. Do you have that? As I recall I needed to edit the code to even see that error.

With Authen::SASL and Net::SMTP::SSL, you can get 1 patch at a time in via gmail. The alternative connection mode which git-send-email doesn't support yet is to connect over smtp then negotiate TLS using 'STARTTLS'. If you do this then you can send multiple patches via gmail with a single call to git-send-email.

There was a patch offered a while back from Simon Sasburg to add starttls support to git-send-email. At the time I questioned it but I hadn't seen the 1-patch-at-a-time limit then. Thread: http://kerneltrap.org/mailarchive/git/2007/10/31/373400 (nb the key thing added by this patch is starttls, not tls)

>
> I tried to get help on #git but I failed, it looks like other people
> are getting the same error.

Hope this helps, Baz

Show 11 quoted lines
>
> Ciao,
> --
> Paolo
> http://paolo.ciarrocchi.googlepages.com/
> -
>
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Douglas Stockwell· Jan 11, 2008, 16:36 UTC · re: Baz · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

Baz wrote:
Show 6 quoted lines
> On Jan 10, 2008 10:49 PM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> With Authen::SASL and Net::SMTP::SSL, you can get 1 patch at a time in
> via gmail. The alternative connection mode which git-send-email
> doesn't support yet is to connect over smtp then negotiate TLS using
> 'STARTTLS'. If you do this then you can send multiple patches via
> gmail with a single call to git-send-email.
I just tested this. I *was* able to send multiple patches in a single call?
Doug
Baz· Jan 11, 2008, 17:22 UTC · re: Douglas Stockwell · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

On Jan 11, 2008 4:36 PM, Douglas Stockwell <doug@11011.net> wrote:
Show 9 quoted lines
> Baz wrote:
> > On Jan 10, 2008 10:49 PM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> > With Authen::SASL and Net::SMTP::SSL, you can get 1 patch at a time in
> > via gmail. The alternative connection mode which git-send-email
> > doesn't support yet is to connect over smtp then negotiate TLS using
> > 'STARTTLS'. If you do this then you can send multiple patches via
> > gmail with a single call to git-send-email.
>
> I just tested this. I *was* able to send multiple patches in a single call?

I'm not going to question the bearer of good news :). The error simon was getting with this was:

> Well, it seems that this only works when sending only 1 patch, when
> sending multiple patches the second one fails with this error:
>> 5.7.0 No identity changes permitted. c14sm2136541nfi

(this was off-list at the tail end of the thread). IIRC I confirmed that this happened to me but I've used msmtp ever since. Maybe something's changed at the google end in the meantime.

And looking back at Paolo's problem I see its not going to be the Authen::SASL problem, its too early in the code; its possible that he's still trying to connect to port 587 (requires smtp/starttls) not the default ssl port.

>
> Doug

Cheers, Baz

Show 7 quoted lines
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Paolo Ciarrocchi· Feb 24, 2008, 21:42 UTC · re: Paolo Ciarrocchi · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

On 1/11/08, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> > perl -MCPAN -e 'install Net::SMTP::SSL'

still no luck: git-send-email --to paolo.ciarrocchi@gmail.com --smtp-server smtp.gmail.com --smtp-user paolo.ciarrocchi --smtp-pass XXXX /home/paolo/Desktop/patch/* [...] Who should the emails appear to be from? [Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>] Emails will be sent from: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> Message-ID to be used as In-Reply-To for the first email? (mbox) Adding cc: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> from line 'From: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>' (sob) Adding cc: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> from line 'Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> ' Unable to initialize SMTP properly. Is there something wrong with your config? at /home/paolo/bin/git-send-email line 719.

Ciao, -- Paolo http://paolo.ciarrocchi.googlepages.com/

Paolo Ciarrocchi· Jan 10, 2008, 11:17 UTC · re: Douglas Stockwell · lore

Re: gmail smtp server and git-send-mail. Is this combination working?

On Jan 9, 2008 5:06 AM, Douglas Stockwell <doug@11011.net> wrote:
Show 24 quoted lines
> Paolo Ciarrocchi wrote:
> > " Mailing off a set of patches to a mailing list can be quite neatly
> > done by git-send-email.
> > One of the problems you may encounter there is figuring out which machine
> > is going to send your mail.
> > I tried smtp.gmail.com, but that one requires tls and a password,
> > and git-send-email could not handle that "
> >
> > From http://git.or.cz/gitwiki/GitTips.
> >
> > Is this statemant still correct ?
> > Is msmtp the only solution for using git-send-mail with gmail? (tls +
> > autentication).
>
> No, as of 34cc60ce2b48f6037997543ddbab1ed9903df4a8 you can use SSL and
> SMTP-Auth.
>
> [sendemail]
>          smtpserver = smtp.gmail.com
>          smtpuser = <user>@gmail.com
>          smtppass = <password>
>          smtpssl = true
>
> Can you suggest changes to the documentation if these options are unclear?

I got confuse by the ssl part in the name of the option, I was looking and grepping for tls.

As I wrote in my previous email I think it's worth to add this very useful information into the wiki as well.

Thanks.
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/

← back to recent threads