Using msmtp to send your patches – This method worked for me
NOTE: git send-email supports TLS/SSL now.
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.
A neat little program, msmtp http://msmtp.sourceforge.net/ can help you there. Install and configure a .msmtprc file in your home directory, the likes of:
# Example for a user configuration file # Set default values for all following accounts. defaults tls on tls_trust_file /etc/pki/tls/certs/ca-bundle.crt logfile ~/.msmtp.log # My email service account gmail host smtp.gmail.com port 587 from email@example.com auth on user firstname.lastname@example.org password my-secret # Set a default account account default : gmail
This takes gmail as an example. The password field is not required. msmtp will prompt you for your password if the field is omitted. The ca-bundle.crt is the file with CA certificates for Fedora Core 6, for other distros you might have to dig it up from somewhere else. On Ubuntu /etc/ssl/certs/ca-certificates.crt should be used, for example. Now, by giving the full path name to the msmtp program as smtp server to git-send-email, you can send the patches through gmail or some other smtp account with TLS and/or user authentication.
git-send-email --smtp-server /usr/local/bin/msmtp <file|directory>
An alternative to setting –smtp-server each time is to set the global sendemail.smtpserver value.
git-config --global sendemail.smtpserver /usr/local/bin/msmtp
Another option is to configure a local smtp server on your machine, using a well-known SMTP server as smarthost. Then, all applications using localhost as a mail server (e.g. /usr/bin/mail) will work.
Another method – I didn’t try it.
If you dont have the command git-send-email command then install it using apt-get install git-send-email
Then, add the correct configuration variables with the following:
$ git config --global sendemail.smtpserver smtp.gmail.com $ git config --global sendemail.smtpserverport 587 $ git config --global sendemail.smtpencryption tls $ git config --global sendemail.smtpuser email@example.com
Now it’s ready: the command git send-email patch-name will ask you for some info about the email sender (you can change the From: field) and recipient, your Gmail password and then it will send the email.
Optionally, it is possible to skip the password prompt by adding it to the configuration with:
$ git config --global sendemail.smtppass your_password