1
2
3
4
5
|
[root@localhost ~]
# mailx -V
12.4 7
/29/08
[root@localhost ~]
# cat /etc/issue
CentOS release 6.8 (Final)
Kernel \r on an \m
|
1
2
3
4
5
|
set
from=usernam@163.com
set
smtp=smtp.163.com
set
smtp-auth-user=username@163.com
set
smtp-auth-password=
passwd
set
smtp-auth=login
|
1
|
cat
/opt/tesh
|mailx -
v
-s
'hello'
'*****@163.com'
|
1
2
3
4
|
554 DT:SPM 163 smtp3,DdGowACX1p2fRn9X_lIIAA--.2018S2 1467958944,please see http:
//mail
.163.com
/help/help_spam_16
.htm?ip=*.*.*.*&hostid=smtp3&
time
=1467958944
smtp-server: 554 DT:SPM 163 smtp3,DdGowACX1p2fRn9X_lIIAA--.2018S2 1467958944,please see http:
//mail
.163.com
/help/help_spam_16
.htm?ip=*.*.*.*&hostid=smtp3&
time
=1467958944
"/root/dead.letter"
0
/0
. . . message not sent.
|
1
2
3
4
5
|
set
from=224******53@qq.com
set
smtp=smtp.qq.com
set
smtp-auth-user=224******53@qq.com
set
smtp-auth-password=euia********chb
#授权码
set
smtp-auth=login
|
1
2
3
4
5
6
7
8
|
set
from=224******53@qq.com
set
smtp=smtp.qq.com
set
smtp-auth-user=224******53@qq.com
set
smtp-auth-password=euia********chb
set
smtp-auth=login
set
smtp-use-starttls
set
ssl-verify=ignore
set
nss-config-
dir
=
/etc/pki/nssdb/
|
1
2
3
4
5
|
mkdir
-p
/root/
.certs/
echo
-n | openssl s_client -connect smtp.qq.com:465 |
sed
-
ne
'/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
> ~/.certs
/qq
.crt
certutil -A -n
"GeoTrust SSL CA"
-t
"C,,"
-d ~/.certs -i ~/.certs
/qq
.crt
certutil -A -n
"GeoTrust Global CA"
-t
"C,,"
-d ~/.certs -i ~/.certs
/qq
.crt
certutil -L -d
/root/
.certs
|
1
2
3
4
5
6
7
8
|
set
from=224******53@qq.com
set
smtp=smtp.qq.com
set
smtp-auth-user=224******53@qq.com
set
smtp-auth-password=euia********chb
set
smtp-auth=login
set
smtp-use-starttls
set
ssl-verify=ignore
set
nss-config-
dir
=
/root/
.certs
|
1
2
3
4
5
|
[root@localhost
test
]
# cd /home/test/.mozilla/firefox/twmiqm5n.default/
[root@localhost twmiqm5n.default]
# ll *db
-rw-------. 1
test
test
65536 Jul 7 16:29 cert8.db
-rw-------. 1
test
test
16384 Jul 7 16:29 key3.db
-rw-------. 1
test
test
16384 May 28 20:38 secmod.db
|
1
2
3
4
5
6
7
8
|
set
from=224******53@qq.com
set
smtp=smtp.qq.com
set
smtp-auth-user=224******53@qq.com
set
smtp-auth-password=euia********chb
set
smtp-auth=login
set
smtp-use-starttls
set
ssl-verify=ignore
set
nss-config-
dir
=
/root/
.certs1
|
1
2
3
4
5
6
7
8
9
10
|
[root@localhost .certs]
# pwd
/root/
.certs
[root@localhost .certs]
# ll
total 80
-rw-------. 1 root root 65536 Jul 8 15:13 cert8.db
-rw-r--r--. 1 root root 2293 Jul 7 16:25 qq.crt
-rw-------. 1 root root 16384 Jul 8 15:13 key3.db
-rw-------. 1 root root 16384 Jul 7 16:24 secmod.db
[root@localhost .certs]
# certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt
Notice: Trust flag u is
set
automatically
if
the private key is present.
|
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
|
Resolving host smtp.qq.com . . .
done
.
Connecting to *.*.*.* . . . connected.
220 smtp.qq.com Esmtp QQ Mail Server
>>> EHLO localhost
250-smtp.qq.com
250-PIPELINING
250-SIZE 73400320
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN
250-MAILCOMPRESS
250 8BITMIME
>>> STARTTLS
220 Ready to start TLS
Comparing DNS name:
"mx2.qq.com"
................................
Comparing DNS name:
"smtp.qq.com"
SSL parameters: cipher=AES-256, keysize=256, secretkeysize=256,
issuer=CN=GeoTrust SSL CA - G3,O=GeoTrust Inc.,C=US
subject=CN=pop.qq.com,OU=R&D,O=Shenzhen Tencent Computer Systems Company Limited,L=Shenzhen,ST=Guangdong,C=CN
>>> EHLO localhost
250-smtp.qq.com
250-PIPELINING
250-SIZE 73400320
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN
250-MAILCOMPRESS
250 8BITMIME
>>> AUTH LOGIN
334 VXNlcm5hbWU6
>>> MjI0Njk0NTU1M0BxcS5jb20=
334 UGFzc3dvcmQ6
>>> ZXVpYXl1a3JrZ3JoZWNoYg==
235 Authentication successful
>>> MAIL FROM:<22******53@qq.com>
250 Ok
>>> RCPT TO:<username@163.com>
250 Ok
>>> DATA
354 End data with <CR><LF>.<CR><LF>
>>> .
250 Ok: queued as
>>> QUIT
221 Bye
|
1
2
3
4
5
|
wget http:
//caspian
.dotconf.net
/menu/Software/SendEmail/sendEmail-v1
.56.
tar
.gz
tar
-zxvf sendEmail-v1.56.
tar
.gz
cd
sendEmail-v1.56
mv
sendEmail
/usr/local/bin/
yum -y
install
perl-IO-Socket-SSL openssl-perl openssl-devel
|
1
2
3
4
5
6
7
8
|
#!/bash/sh
from_email=
'username@hotmail.com'
smtp=
'smtp-mail.outlook.com:587'
title=
'标题'
to_email=`username@qq.com`
passwd
=
'passwd'
body=`
cat
test
`
/usr/sbin/sendEmail
-o tls=
yes
-f
"$from_email"
-s
"$smtp"
-u
"$title"
-o message-content-
type
=text -o message-charset=utf8 -t
"$to_email"
-xu
"$from_email"
-xp
"$passwd"
-m
"$body"
|