2a3519 added test to sendmail to use ESMTP

Authored and Committed by Christoph Galuschka 12 years ago
    added test to sendmail to use ESMTP
    reordered tests
    
        
tests/p_sendmail/10_sendmail_smtp.sh tests/p_sendmail/sendmail_smtp.sh
file renamed
file was renamed with no change to the file
tests/p_sendmail/15-test-sendmail.sh tests/p_sendmail/1-test-sendmail.sh
file renamed
file was renamed with no change to the file
tests/p_sendmail/30_sendmail_mta_ehlo.sh ADDED
@@ -0,0 +1,34 @@
1
+ #!/bin/sh
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
+