email notification tools

1. xdg-email : xfce默认email client

fakeCmd = “xdg-email \
–attach xx \
–subject ‘subj’ \
–body ‘Attached you find the logo for the contest.’ \
'xx@live.com

2. 直接呼叫开源版雷鸟icedove

theCmd = ‘icedove -compose “to=xx@gmail.com,subject=%s,attachment=file:///home/y/temp/zip/%s,body=%s”‘ % (
filename,
filename,
filename
)

3. 使用原始的/usr/bin/mail

echo "Sending Test Email" | mail -s "Hello" testing@test.com

mail -s "`date`" xx@yy.com < /etc/hosts

4. java

javax.mail:mail:1.4.1

5. mailx

mailx -s "subject:test mail" foo@bar.com
mailx -s "subject:test mail" foo@bar.com

6. sendmail

sendmail foo@bar.com < /etc/hosts

———————————————–

gerrit email设置(使用aliyun个人邮箱)

[sendemail]
    smtpServer = smtp.aliyun.com
    smtpServerPort = 465
    smtpEncryption = SSL
    smtpUser = XX@aliyun.com
[user]
    email = XX@aliyun.com

使用默认sendmail:

/usr/bin/mail -> /etc/alternatives/mail -> /usr/bin/bsd-mailx
/usr/bin/mailx -> /etc/alternatives/mailx -> /usr/bin/bsd-mailx

使用heirloom-mailx

/usr/bin/mail -> /etc/alternatives/mail -> /usr/bin/heirloom-mailx
/usr/bin/mailx -> /etc/alternatives/mailx ->/usr/bin/heirloom-mailx

配置文件在: /etc/nail.rc

set from=XX@aliyun.com
set smtp=smtps://smtp.aliyun.com:465
set smtp-auth=login
set smtp-auth-user=XX@aliyun.com
set smtp-auth-password=???
set auth-login=XX

安装以及配置

参考https://holarails.wordpress.com/2013/11/17/configure-sendmail-in-ubuntu-12-04-and-make-it-fast/

apt-get install sendmail
sendmailconfig