/howto-configure-msmtp-to-work-with-gmail-on-linux

11 篇文章 0 订阅

http://www.absolutelytech.com/2010/07/17/howto-configure-msmtp-to-work-with-gmail-on-linux/

----

http://msmtp.sourceforge.net/doc/msmtprc.txt

http://msmtp.sourceforge.net/documentation.html

---

Msmtp is a small but powerful and highly customizable smtp client. You can access gmail smtp using msmtp, which is exactly what I’ll teach in this tutorial.

Step by step instructions:
  1. Install msmtp and ca-certificates for use with SSL:
    sudo apt-get install msmtp ca-certificates

  2. We’ll create and edit the configuration file using Gedit:

    sudo gedit /etc/msmtprc

    Now copy and paste the following code in the text editor:

    defaults
    tls on
    tls_starttls on
    tls_trust_file /etc/ssl/certs/ca-certificates.crt
     
    account default
    host smtp.gmail.com
    port 587
    auth on
    user username@gmail.com
    password mypass
    from username@gmail.com
    logfile /var/log/msmtp.log

    Needless to say, you have to replace username@gmail.com with your email and mypass with your password

  3. It should be readable by anyone. However, we’ll still execute the following command to be sure.

    sudo chmod 0644 /etc/msmtprc
  4. Your msmtp configuration is ready. Lets send a test email to yourself to see if everything’s working properly:
    echo -e "Subject: Test Mail\r\n\r\nThis is a test mail" |msmtp --debug --from=default -t username@gmail.com

    Again replace username@gmail.com with your own email address and execute it. You should receive an email.

These are the exact commands to be used with Ubuntu.
You can replicate the steps for another distibution by using equivalent commands (For eg; yum install in place of apt-get install for centos, redhat, fedora.)
Cheers!

CATEGORY: How-ToUbuntu (Linux)

TAGGED: ca-certificatesGmaillinuxmsmtpmsmtp gmailubuntu

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值