Great Circle Associates Majordomo-Workers
(April 1996)
 

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

Subject: Domain-restrictions in Majordomo 1.93
From: Petter Reinholdtsen <petterr @ stud . cs . uit . no>
Date: Tue, 30 Apr 1996 17:21:55 +0200
To: majordomo-workers @ greatcircle . com, may @ cc . uit . no


Here is a patch to be able to restrict posting to lists by domain and
not only email-address.  This patch gives you the possibility to have
domain-names in the address-list used by the "restrict_post" option.

Domain-names is matched by the missing '@' in the name.  Domains will
only match if the name is missing.  Eksample address list:
	maniac@aol.com
	pere@td.org.uit.no
	uit.no
This will allow any user on the uit.no domain and maniac@aol.com to
post.  spammer@aol.com will not be allowed to post.

The examples are not random. :-)
-- 
##>  Petter Reinholdtsen <##   | pere@td.org.uit.no
                               | Petter Reinholdtsen, studpost, IMR
http://www.cs.uit.no/~petterr/ | University of Tromsoe, Norway

diff -u src-1.93/resend src-1.93-local/resend
--- src-1.93/resend     Sat Jan  7 18:31:43 1995
+++ src-1.93-local/resend       Tue Apr 30 17:09:16 1996
@@ -327,7 +327,7 @@
            $file = "$listdir/$file";
        }
         if ( open (LISTFD, "<${file}") != 0 ) {
-           @output = grep (&addr_match($from, $_), <LISTFD>);
+           @output = grep (&addrdomain_match($from, $_), <LISTFD>);
             close (LISTFD);
    
             if ( $#output != -1 ) {
@@ -369,6 +369,19 @@
     close(MAILIN);
     unlink(</tmp/resend.$$.*>);
     exit(0);
+}
+
+sub addrdomain_match {
+    local($from, $a2) = @_;
+    local($tmp);
+    if ($a2 =~ /@/) {
+        &addr_match($from, $a2);
+    } else {
+       # Remove localpart (the username) to avoid matches on uit.no@aol.com
+       # with uit.no
+       ($tmp, $from) = split(/@/, $from);
+        &addr_match($from, $a2,1);
+    }
 }
 
 sub check_balance {


Follow-Ups:
Indexed By Date Previous: Re: hostile address
From: Merrill Cook <mcook@ecunet.org>
Next: Re: Domain-restrictions in Majordomo 1.93
From: Chan Wilson <cwilson@slurp.neu.sgi.com>
Indexed By Thread Previous: Subscribing list to itself.
From: frank@ansto.gov.au (Frank Crawford)
Next: Re: Domain-restrictions in Majordomo 1.93
From: Chan Wilson <cwilson@slurp.neu.sgi.com>

Google
 
Search Internet Search www.greatcircle.com