From d6e04b603a81d6c55c3bb71974689892762b6a01 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Oct 2013 13:30:54 +0200 Subject: successfully validate Mailer mails with msglint --- _test/tests/inc/mailer.test.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '_test') diff --git a/_test/tests/inc/mailer.test.php b/_test/tests/inc/mailer.test.php index fefb6f508..feb454fcf 100644 --- a/_test/tests/inc/mailer.test.php +++ b/_test/tests/inc/mailer.test.php @@ -164,6 +164,7 @@ class mailer_test extends DokuWikiTest { // prepare a simple multipart message $mail = new TestMailer(); $mail->to(array('Möp ',' foo ')); + $mail->from('Me '); $mail->subject('This is a töst'); $mail->setBody('Hello Wörld, @@ -173,6 +174,8 @@ class mailer_test extends DokuWikiTest { $msg = $mail->dump(); $msglines = explode("\n", $msg); + //echo $msg; + // ask message lint if it is okay $html = new HTTPClient(); $results = $html->post('http://tools.ietf.org/tools/msglint/msglint', array('msg'=>$msg)); @@ -195,6 +198,10 @@ class mailer_test extends DokuWikiTest { // check the line for errors if(substr($line,0,5) == 'ERROR'){ + // ignore some errors + if(strpos($line, "missing mandatory header 'return-path'")) continue; #set by MDA + if(strpos($line, "bare newline in text body decoded")) continue; #seems to be false positive + // get the context in which the error occured $errorin = ''; if(preg_match('/line (\d+)$/', $line, $m)){ -- cgit v1.2.3