mutt + msmtp邮件客户端配置

mutt + msmtp邮件客户端配置

# cd /opt

# wget ftp://ftp.mutt.org/mutt/mutt-1.4.2.3.tar.gz

# tar zxf mutt-1.4.2.3.tar.gz

# cd mutt-1.4.2.3

# ./configure --prefix=/usr/local/mutt

# make && make install clean

# ln -s /usr/local/mutt/bin/mutt /bin/mutt

 

# cd /opt

# wget http://down1.chinaunix.net/distfiles/msmtp-1.4.28.tar.bz2

# tar zxf msmtp-1.4.28.tar.bz2

# cd msmtp-1.4.28

# ./configure --prefix=/usr/local/msmtp

# make && make install clean

# ln -s /usr/local/msmtp/bin/msmtp /bin/msmtp

 

# cd /root

# vim .muttrc 
set sendmail="/usr/local/msmtp/bin/msmtp -a accountName" 
set [email protected]

set use_from=yes 
set editor="vim" 
set rfc2047_parameters=yes
#set create_rfc2047_parameters=yes 

 

#vim .msmtprc #设置邮件发送的用户名和密码
# The SMTP server of the provider. 
account accountName 
host smtpcom.263xmail.com  
from [email protected]

auth login
user [email protected](此用户必须真实存在,并且登录密码也是对应匹配的)

password 123456

# chmod 600 .msmtprc

 

邮件发送:

# mutt -s "hello world" -a /root/install.log [email protected] < /etc/hosts

注释:mutt命令的选项

  -a <file> attach a file to the message  

  -b <address> specify a blind carbon-copy (BCC) address
  -c <address> specify a carbon-copy (CC) address
  -e <command> specify a command to be executed after initialization   -f <file> specify which mailbox to read
  -F <file> specify an alternate muttrc file
  -H <file> specify a draft file to read header from
  -i <file> specify a file which Mutt should include in the reply
  -m <type> specify a default mailbox type
  -n  causes Mutt not to read the system Muttrc
  -p  recall a postponed message
  -R  open mailbox in read-only mode
  -s <subj> specify a subject (must be in quotes if it has spaces) 

  -v  show version and compile-time definitions
  -x  simulate the mailx send mode
  -y  select a mailbox specified in your `mailboxes' list
  -z  exit immediately if there are no messages in the mailbox
  -Z  open the first folder with new message, exit immediately if none

 

 

你可能感兴趣的:(邮件,Mutt,msmtp)