From 01a9545ffb9178ff9a5af9f629c69d5313282710 Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Dec 08 2012 10:59:09 +0000 Subject: added postfix test to use ESMTP --- diff --git a/tests/p_postfix/30_postfix_mta_ehlo.sh b/tests/p_postfix/30_postfix_mta_ehlo.sh new file mode 100755 index 0000000..f752998 --- /dev/null +++ b/tests/p_postfix/30_postfix_mta_ehlo.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# Author: Christoph Galuschka + +t_Log "Running $0 - postfix can accept and deliver local email using ESMTP." + +MAILSPOOL=/var/spool/mail/root + +# make shure spool file is empty +cat /dev/null > $MAILSPOOL +ret_val=1 + +# send mail to localhost +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" +if [ $? = 0 ] + then + t_Log 'Mail has been queued successfully' + MTA_ACCEPT=0 +fi + +sleep 1 +grep -q 't_functional test' $MAILSPOOL +if [ $? = 0 ] + then + t_Log 'previously sent mail is in '$MAILSPOOL + SPOOLFILE=0 +fi + +if ([ $MTA_ACCEPT = 0 ] && [ $SPOOLFILE = 0 ]) + then + ret_val=0 +fi + +t_CheckExitStatus $ret_val +