2a3519
added test to sendmail to use ESMTP
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
|
3
|
+
|
4
|
+
t_Log "Running $0 - sendmail can accept and deliver local email using ESMTP."
|
5
|
+
|
6
|
+
MAILSPOOL=/var/spool/mail/root
|
7
|
+
|
8
|
+
# make shure spool file is empty
|
9
|
+
cat /dev/null > $MAILSPOOL
|
10
|
+
ret_val=1
|
11
|
+
|
12
|
+
# send mail to localhost
|
13
|
+
echo -e "ehlo localhost\nmail from: root@localhost\nrcpt to: root@localhost\ndata\nt_functional test\n.\nquit\n" | nc -w 5 localhost 25 | grep -q "250 2.0.0"
|
14
|
+
if [ $? = 0 ]
|
15
|
+
then
|
16
|
+
t_Log 'Mail has been queued successfully'
|
17
|
+
MTA_ACCEPT=0
|
18
|
+
fi
|
19
|
+
|
20
|
+
sleep 1
|
21
|
+
grep -q 't_functional test' $MAILSPOOL
|
22
|
+
if [ $? = 0 ]
|
23
|
+
then
|
24
|
+
t_Log 'previously sent mail is in '$MAILSPOOL
|
25
|
+
SPOOLFILE=0
|
26
|
+
fi
|
27
|
+
|
28
|
+
if ([ $MTA_ACCEPT = 0 ] && [ $SPOOLFILE = 0 ])
|
29
|
+
then
|
30
|
+
ret_val=0
|
31
|
+
fi
|
32
|
+
|
33
|
+
t_CheckExitStatus $ret_val
|
34
|
+
|