Index: openacs-4/packages/acs-tcl/tcl/rollout-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/rollout-email-procs.tcl,v diff -u -r1.3.4.1 -r1.3.4.2 --- openacs-4/packages/acs-tcl/tcl/rollout-email-procs.tcl 14 Jun 2004 17:49:00 -0000 1.3.4.1 +++ openacs-4/packages/acs-tcl/tcl/rollout-email-procs.tcl 10 Sep 2004 22:50:30 -0000 1.3.4.2 @@ -106,13 +106,20 @@ @author Andrew Grumet @date 29 July 2002 - } { set allowed [ns_config ns/server/[ns_info server]/acs/acs-rollout-support EmailAllow] - if { [lsearch [split $allowed ,] $to] >= 0 } { - return [_old_ns_sendmail $to $from $subject $body $extraheaders $bcc] + + # make sure we are comparing just the email address portion + # not a@b.com and a@b.com (Abc Def) + # note this takes out the name part as a side effect. -jfr + regexp {([a-zA-Z0-9][^ @]*)@([a-zA-Z0-9_.-]+\.[a-zA-Z]{2,6})} $to match beginning end + set to_for_comparison "${beginning}@${end}" + + if { [lsearch [split $allowed ,] $to_for_comparison] >= 0 } { + + return [_old_ns_sendmail $to_for_comparison $from $subject $body $extraheaders $bcc] } else { - return [ro::email::sendmail_log $to $from $subject $body $extraheaders $bcc] + return [ro::email::sendmail_log $to_for_comparison $from $subject $body $extraheaders $bcc] } }