从上找到的一个配置脚本,下载后添加可执行权限,然后运行即可。
下面是脚本setup-msmtp-for-gmail.sh的内容
#!/bin/sh# Sending emails using Gmail and msmtp# Author: [Josef Jezek](http://about.me/josefjezek)# Donate: [Gittip](https://www.gittip.com/josefjezek)# Link: [Gist](https://gist.github.com/6194563)# Usage: setup-msmtp-for-gmail.shsudo apt-get update -qsudo apt-get install msmtp-mta ca-certificates heirloom-mailx -yqif command -v zenity >/dev/null; then GMAIL_USER=$(zenity --entry --title="Gmail username" --text="Enter your gmail username with domain (username@gmail.com):") GMAIL_PASS=$(zenity --entry --title="Gmail password" --text="Enter your gmail password:" --hide-text)else read -p "Gmail username with domain (username@gmail.com): " GMAIL_USER read -p "Gmail password: " GMAIL_PASSfi echo # an empty line if [ -z "$GMAIL_USER" ]; then echo "No gmail username given. Exiting."; exit -1; fiif [ -z "$GMAIL_PASS" ]; then echo "No gmail password given. Exiting."; exit -1; fisudo tee /etc/msmtprc >/dev/null <<__EOF# Accounts will inherit settings from this sectiondefaultsauth ontls ontls_certcheck off# tls_trust_file /etc/ssl/certs/ca-certificates.crtlogfile /var/log/msmtp.log# A first gmail addressaccount gmailhost smtp.gmail.comport 587from $GMAIL_USERuser $GMAIL_USERpassword $GMAIL_PASS# A second gmail addressaccount gmail2 : gmailfrom username@gmail.comuser username@gmail.compassword password# A freemail serviceaccount freemailhost smtp.freemail.examplefrom joe_smith@freemail.exampleuser joe.smithpassword secret# A provider's serviceaccount providerhost smtp.provider.example# Set a default accountaccount default : gmail__EOFsudo chmod 600 /etc/msmtprcsudo chown -R www-data:www-data /etc/msmtprcHOST=$(hostname)sudo mail -vs "Email relaying configured at ${HOST}" $GMAIL_USER <<__EOFThe postfix service has been configured at host '${HOST}'.Thank you for using this postfix configuration script.__EOF echo "I have sent you a mail to $GMAIL_USER"echo "This will confirm that the configuration is good."echo "Please check your inbox at gmail."
运行完后,将修改用户和组位当前用户(sudo chown xxx:xxx /etc/msmtprc),然后可以将/etc/msmtprc拷贝为~/.msmtprc,此外,记得登陆gmail邮箱,看看是不是存在安全提示,
点击"allowing access to less secure apps",然后打开i如下设置:
然后即可以用git send-email提交kernel补丁了:(可以参考和分享给大家的资料, 或点)
1、配置git send-email如下(.gitconfig)
[sendemail] smtpserver = /usr/bin/msmtp
2、生成patch
git format-patch -1
比如生成的patch是: 0001-ASoC-compress-Set-reasonable-compress-id-string.patch
如果需要一次生成多个patch的话,使用下面的命令:
git format-patch -s -n --cover-letter --thread
3、检查patch
./scripts/checkpatch.pl 0001-ASoC-compress-Set-reasonable-compress-id-string.patch
4、获得maintainer
./scripts/get_maintainer.pl 0001-ASoC-compress-Set-reasonable-compress-id-string.patch
5、提交
git send-email --to xx@xx --to xx@xx --cc xx@xx --cc xx@xx 0001-ASoC-compress-Set-reasonable-compress-id-string.patch
如果提交的是一些列patch的话,将这些patch在一个git send-email中发送。
完。