Great Circle Associates Majordomo-Users
(February 1993)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Screening From: addresses
From: Tim Guarnieri <timg @ mv . us . adobe . com>
Date: Thu, 25 Feb 93 12:11:53 PST
To: majordomo-users @ GreatCircle . COM
In-reply-to: Your message of "Thu, 25 Feb 93 11:35:35 PST." <9302251935.AA23947@mycroft.GreatCircle.COM>


Brent, el al:

I've added perl code that does the following:

 - Traps non-local addresses, logs, then exits.

 - Modified the command interpreter loop to ignore lines
   that are automatically inserted at the top of the body 
   of the message by QuickMail and cc:Mail. Note: I need
   to add a few more rules here.

Much thanks goes to Paul Vixie of DEC's Network Systems Lab  
for helping me with some obscure Perl syntax problems.

Things I am planning on doing:

 - Modifying the script to strip cruft from the $reply_to string
   since this is for internal use only.

 - Modify the command interpreter such that if the owner of the
   list sends a subscribe command the subscription is automatically
   done and an 'approve' message isn't sent back (since that's
   really an extra interation).  NOTE:  This feature may already
   be in the code, I haven't looked.  I just know I need it.

   Brent - perhaps you can save me some time -- is this feature
           already in there?

Anyway, that's all for now, more later...

Tim

P.S.  Perl code mods are below.  Disclaimer:  the code could probably
      be cleaner and might not be placed in the optimal place in the
      algorithm.  Comments, suggestions, etc. are welcome.


(1) Address checking code (comes after valid_addr check)
    ---------------------

# Now check for outside callers...

# First parse for <> style addresses

if ($reply_to =~ /</o) {
     ($junk,$reply_to_too) = split(/</,$reply_to);
     ($reply_to_too,$junk) = split(/>/,$reply_to_too);
} else
{
     $reply_too_to = $reply_to;
}

# Is it unqualified or does it have an @?  If @, then better be from within.
# Make toplevel whatever the top of your domain tree is.

if (!(($reply_to_too !~ /@/o) || ($reply_to_too =~ /@([\w\_\-]+\.)*toplevel.com$/io
))) {
     &log("Attempted connection from $reply_to failed -- non-local address");
     $reply_to = $whoami_owner;
     exit 0;
}

# Setting $reply_to before exit 0 probably isn't necessary, but is there
# for warm an fuzzies.

# Watch for bangpath addresses, too.  Host1 & host2 are local uucp receivers
# Those aren't the real names, I'm just being paranoid - :-)

if (($reply_to_too =~ /\!/o) && !(($reply_to =~ /^host1\!/io) || ($reply_to_to
o =~ /^host2\!/io))) {
     &log("Attempted connection from $reply_to failed -- non-local address-2");
     $reply_to = $whoami_owner;
     exit 0;
}


(2) Mods for screening QuickMail crap from the body (top of cmd loop)
    -----------------------------------------------

    if ($_ =~ /Subject:/o) {next;}      # Filter QuickMail header
    if ($_ =~ /OFFICE/o) {next;}        # Filter QuickMail header

# Note: this could be done in one command, but looks awful!

   



References:
Indexed By Date Previous: Re: Screening From: addresses
From: Brent Chapman <brent@GreatCircle.COM>
Next: Re: Screening From: addresses
From: Brent Chapman <brent@GreatCircle.COM>
Indexed By Thread Previous: Re: Screening From: addresses
From: Brent Chapman <brent@GreatCircle.COM>
Next: Re: Screening From: addresses
From: Brent Chapman <brent@GreatCircle.COM>

Google
 
Search Internet Search www.greatcircle.com