[Mimedefang] How can I get just the domain from $sender

Jim McCullars jim at info.uah.edu
Tue Feb 22 11:50:04 EST 2005

>my ($sendusername, $senddomain) = split('@', $Sender);

   Except that one, a sender address can have angle brackets around it;
and two, it can have more than one @-sign, if someone uses a route-addr.
Better to use a regexp that anchors to the end, something like:

  if($Sender =~ /\@abc\.com>?$/i) {
    # the sender is local...


Jim McCullars
University of Alabama in Huntsville

More information about the MIMEDefang mailing list