您的位置:首页 > 其它

[转] RedHat邮件程序mutt的设置

2013-07-08 16:08 351 查看
由于需要使用git发邮件,在配置的过程中出现了一些错误,后来找到了这篇文章,感觉不错,转载过来了

======== 以下是转载内容,转自: /article/1873935.html ==========

在linux发送邮件需要两个程序,分别是mutt和smstp。前者是mail的客户端User,后者则是个smtp的简易服务器,要发邮件两者不可或缺(当然也可以通过其他工具来发送)

可以通过以下方式查看

[root@localhost ~]# rpm -qa|grep mutt
mutt-1.4.2.2-3.0.2.el5
[root@localhost ~]#
smstp一般去/usr/local/bin或者/usr/bin等路径下find一把

[root@localhost bin]# ll
total 240
-rwxr-xr-x 1 root root 237267 Apr 10 03:36 msmtp
如果没有安装,则可以用rpm -ivh mutt-1.4.2.2-3.0.2.el5.x86_64.rpm
来安装

smstp则可以在http://download.chinaunix.net/download/0008000/7048.shtml下载。

系统这边已经安装了mutt,只需要下载个smstp然后安装即可。

安装的步骤是

[root@localhost ~]# cd msmtp-1.4.5

[root@localhost ~]# ./configure

[root@localhost ~]# make

[root@localhost ~]# make install

本次安装开始下载的是msmtp-1.4.27版本,但是编译的时候报了一个错误:

[root@localhost msmtp-1.4.27]# make
make all-recursive
make[1]: Entering directory `/root/msmtp-1.4.27'
Making all in src
make[2]: Entering directory `/root/msmtp-1.4.27/src'
CCLD msmtp
tls.o: In function
`tls_init':/root/msmtp-1.4.27/src/tls.c:1100: undefined reference
to `gnutls_priority_set_direct' collect2: ld returned 1 exit
status
make[2]: *** [msmtp] Error 1
make[2]: Leaving directory `/root/msmtp-1.4.27/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/msmtp-1.4.27'
make: *** [all] Error 2

无解,后来听朋友说换一个低版本的安装,结果未报错。选择了版本msmtp-1.4.5

邮件的发送:

[root@localhost ~]# echo "Believing the god with U"|mutt -s
"keyon's mail" lqchenzjut@163.com
[root@localhost ~]#
去指定的邮箱查看,收到了主题为keyon's mail,内容为Believing the god with
U的邮件。

若要增加附件,则加上-a参数,如当前目录:

[root@localhost ~]# ll
total 584
-rw------- 1 root root 1464 Apr
9 05:55 anaconda-ks.cfg
drwxr-xr-x 2 root root 4096 Apr
9 22:44 Desktop
-rw-r--r-- 1 root root 52465 Apr
9 05:55 install.log
-rw-r--r-- 1 root root 4728 Apr
9 05:55 install.log.syslog
drwxrwxrwx 6 1000 1000 4096 Apr 10 03:36
msmtp-1.4.5
-rw-r--r-- 1 root root 489336 Apr 9 19:37
msmtp-1.4.5.tar.bz2

发送install.log.syslog文件出去。

[root@localhost ~]# echo "Believing the god with U"|mutt -a
install.log.syslog -s "keyon's mail" lqchenzjut@163.com
[root@localhost ~]#
检查,OK。

若要发送多人,则可以在各个收件人邮箱之间以逗号区分即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: