Escape lines with just a . , which breaks SMTP
authorJamie Cameron <jcameron@webmin.com>
Sun, 20 Sep 2009 06:03:02 +0000 (23:03 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sun, 20 Sep 2009 06:03:02 +0000 (23:03 -0700)
sendmail/filter.pl

index b0bd17b..6b62968 100755 (executable)
@@ -35,7 +35,16 @@ while(<STDIN>) {
        elsif (!$_) { last; }
        }
 while(<STDIN>) {
-       $body .= $_;
+       if ($_ eq ".\n") {
+               # Single line with a . confuses SMTP
+               $body .= ". \n";
+               }
+       elsif ($_ eq ".\r\n") {
+               $body .= ". \r\n";
+               }
+       else {
+               $body .= $_;
+               }
        }
 
 # read the filter file