-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.sh
68 lines (60 loc) · 1.32 KB
/
mail.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
## mail 2016-07-22
## http://www.aqzt.com
##email: [email protected]
##robert yu
##centos 7
##定时更换/etc/mail.rc配置文件
##0 */12 * * * /data/shell/mail.sh
check=`cat /tmp/mail_check.log`
if [ "$check" == "1" ];then
cat >/etc/mail.rc<<EOF
set hold
set append
set ask
set crt
set dot
set keep
set emptybox
set indentprefix="> "
set quote
set sendcharsets=iso-8859-1,utf-8
set showname
set showto
set newmail=nopoll
set autocollapse
ignore received in-reply-to message-id references
ignore mime-version content-transfer-encoding
fwdretain subject date from to
set bsdcompat
set [email protected] smtp=192.168.1.12
set [email protected] smtp-auth-password=testtest20160722a smtp-auth=login
EOF
echo "2" > /tmp/mail_check.log
fi
if [ "$check" == "2" ];then
cat >/etc/mail.rc<<EOF
set hold
set append
set ask
set crt
set dot
set keep
set emptybox
set indentprefix="> "
set quote
set sendcharsets=iso-8859-1,utf-8
set showname
set showto
set newmail=nopoll
set autocollapse
ignore received in-reply-to message-id references
ignore mime-version content-transfer-encoding
fwdretain subject date from to
set bsdcompat
set [email protected] smtp=192.168.1.15
set [email protected] smtp-auth-password=testtest20160722b smtp-auth=login
EOF
echo "1" > /tmp/mail_check.log
fi
date >> /tmp/mail_time.log