[imp] [PATCH] Prevent sending mail to " "@your.domain

Magnus Nordseth magnun at stud.ntnu.no
Fri Aug 1 19:08:12 PDT 2003


We have experienced problems with users trying sending mail to an address
consiting of whitespaces (don't ask me how the mange to =)), and this
generates some annoying mail bounces. 

The quick fix is to strip whiespaces at the beginning and end of the
addresses before cheking if they are valid. This will generate an error
message to the user if he tries to send such mail.  A patch is applied, and I
encourage to include it (or similar functionality) in future releases :o)


-- 
Magnus Nordseth
-------------- next part --------------
--- compose.php.orig	Sat Aug  2 03:14:59 2003
+++ compose.php	Sat Aug  2 03:08:33 2003
@@ -744,12 +744,15 @@
      $message = Horde::getFormData('message', '');
      $recips = null;
      if ($f_to = Horde::getFormData('to', getAddressList('to'))) {
+         $f_to = trim($f_to);
          $recips = $f_to;
      }
      if ($f_cc = Horde::getFormData('cc', getAddressList('cc'))) {
+         $f_cc = trim($f_cc);
          $recips .= (empty($recips)) ? $f_cc : ', ' . $f_cc;
      }
      if ($f_bcc = Horde::getFormData('bcc', getAddressList('bcc'))) {
+         $f_bcc = trim($f_bcc);
          $recips .= (empty($recips)) ? $f_bcc : ', ' . $f_bcc;
      }
 


More information about the imp mailing list