What's cooking (2024/04 #09)
[alt-git.git] / taboo.perl
blobddce90f0cf8b05e2b4c0bdb8149963b7004aac16
1 #!/usr/bin/perl -w
3 my $tmpl = ' if (%%PATTERN%%) {
4 print "$lineno ${_}matches %%QPATTERN%%\n";
5 return;
7 ';
8 my $stmt = "";
9 my $in_header = 1;
11 while (<DATA>) {
12 if (/^\$global_taboo_body =/) {
13 $in_header = 0;
15 next if (/^\043/ || /^\$/ || /^END$/ || /^\s*$/);
16 chomp;
17 my $p = $_;
18 if ($in_header) {
19 $p = '/^[-\w_]*:/ && ' . $p;
21 my $q = quotemeta($p);
22 my $stmt1 = $tmpl;
23 $stmt1 =~ s|%%PATTERN%%|$p|g;
24 $stmt1 =~ s|%%QPATTERN%%|$q|g;
25 $stmt .= $stmt1;
27 close DATA;
29 $stmt = 'sub check {
30 my ($line, $lineno) = @_;
31 ' . $stmt . '
34 eval $stmt;
35 while (<>) {
36 check($_, $.);
39 my $how_to_update_this_script = <<'EOF' ;
40 ( sed -e '/^__DATA__$/q' taboo.perl && \
41 wget -q -O - http://vger.kernel.org/majordomo-taboos.txt ) \
42 >taboo.perl+
43 if diff -u taboo.perl taboo.perl+; \
44 then \
45 rm -f taboo.perl+; \
46 echo >&2 No changes.; \
47 else \
48 mv taboo.perl+ taboo.perl; \
49 chmod +x taboo.perl; \
51 EOF
53 __DATA__
54 #TABOO-START
56 # These are Majordomo's global majordomo.cf as used at
57 # vger.kernel.org. This is automated extract from running
58 # system configuration. THESE MIGHT NOT BE USEFULL IN ANY
59 # OTHER ENVIRONMENT, AND THIS EXTRACT IS SHOWN ONLY FOR
60 # YOU TO SEE, WHAT TRIGGERS BLOCKING AT VGER'S LISTS.
62 # taboo headers to catch
64 $global_taboo_headers = <<'END';
65 m/From:.*MAILER-DAEMON/i
66 m/^Mailing-List:/i
67 m/^list-/i
68 /^subject: ndn: /i
69 /^subject:\s*RCPT:/i
70 /^subject:\s*Delivery Confirmation\b/i
71 /^subject:\s*NON-DELIVERY of:/i
72 /^subject:.*Undeliverable Message\b/i
73 /^subject:.*Receipt Confirmation\b/i
74 /^subject:.*Failed mail\b/i
75 /^subject:.*Returned mail\b/i
76 /^subject:\s*unable to deliver mail\b/i
77 /^subject:\s.*\baway from my mail\b/i
78 /^subject:\s*Autoreply/i
79 /^subject:\s*Path Too Long fixer/i
80 /^subject:\s*Buy In-Stream preroll video/i
81 /#field0#/
82 m%content-type:.*text/html%i
83 /x-mailing-list:.*\@vger\.kernel\.org/i
84 # DATE: 25 Jun 01 3:08:39 AM
85 m/DATE:\s*..\s...\s..\s.*:..:..\s..\s*$/i
86 m/nntp-server.caltech.edu/
87 m/Mail Bomber/
88 m/X-Mailman-Version:/
89 m/X-EM-Registration:/
90 m/x-esmtp:/
91 m/Local time zone must be set/
92 m/X-Mailer:.*eMerge/i
93 m/X-Mailer:.Trade-Navigator/i
94 m/From:.*MAILER-DAEMON/i
95 m/X-Mailer:.*Group Mail/
96 m/^Status:/
97 m/^X-Status:/
98 m/X-Set:/
99 m/^X-Mailer:.*JiXing/
100 m/^X-Mailer:.*MailXSender/
101 m!Message-Id:.*<.*\@vger.kernel.org>!
102 m!Message-Id:.*<.*\@zeus.kernel.org>!
103 m/Subject:.*detected a virus /
104 m/Subject:.*Acai/
105 #m/Anti-Virus/i
106 m/Subject:.*[Vv]irus [Ff]ound/
107 m/Subject:.*[Vv]irus [Aa]lert/
108 m/^Subject:\s*Report to Sender/
109 m/^Subject:.*AntiVir ALARM/
110 m!^X-Library:\s*Indy!
111 m!Content-Type:\s*application/x-msdownload!
112 m!Conetnt-Type:\s*application/msword!
113 m!MiME-!
114 m!netdev-bounce\@oss\.sgi\.com!
115 m!Undeliverable:!
116 m!Syntax error in!
117 m!^Illegal-Object:!
118 m!Subject:.*paycheck!i
119 m!Subject:.*Urgent\s*Business\s*Request!i
120 m!Subject:.*Urgent\s*Business!i
121 m!Subject:.*Business\s*Request!i
122 m!Subject:.*tiffany\s*uk!i
123 m!Subject:.*pandra\s*charms!i
124 m!Subject:.*Mail delivery failure!
125 m!Subject.*\[SPAM\]!
126 m!Subject:.*Norton AntiVirus detected!
127 m!X-Spam-Flag:.*YES!
128 m!Subject:.*\sSARS\s!i
129 m!Subject:.*MMS Notification!
130 m!Subject:.*Rejected Mail!
131 m!Subject:.*Report to Recipient!
132 m!Subject:.*You sent potentially!
133 m!WAVA Postmaster!
134 m!^SUBJECT:!
135 m!Delivered-To:!
136 m!^From:\s*Majordomo!
137 m!Subject:\s+Out of Office AutoReply!
138 #m!Content-Type: multipart/alternative!
139 m!From:.*amavisd-new!
140 m!Subject:.*found.*virus!i
141 m!Subject:.*As Seen on CNN!i
142 m!Subject:.*Mail Delivery!
143 m!Subject:.*Essential.*Software.*On.*CD!i
144 m!ScanMail for Lotus Notes!
145 m!InternetBank Agreement!
146 m!X-WEBC-Mail-From-Script:!
147 m!X-Mailer: RLSP Mailer!
148 m!Subject: Rediff\'s Auto Response!
149 m!Email account utilization warning!
150 m!From:.*Lyris.List!
151 m!Listar command results!
152 m!EHLO vger.kernel.org!
153 m!HELO vger.kernel.org!
154 m!stk-sub!
155 m!owner-majordomo\@!
156 m!LOTTERY!i
157 m!SWEEPSTAKE!i
158 m!GSM wireless terminal from China!
159 m!http://vk.com/!
160 m!eyari\.com!i
163 # TABOO BODY
165 # Taboo body contents to catch and forward to the approval address
167 # For example:
168 # $global_taboo_body = <<'END';
169 # /taboo topic/i
170 # /another taboo/i
171 # END
172 # NOTE! Using ' instead of " in the next line is VERY IMPORTANT!!!
174 $global_taboo_body = <<'END';
175 m!MailEnable: You are not permitted to post to the list!o
176 m!^X-Mailing-List: !o
177 m!^List-ID: !o
178 m%Content-Type:.*text/html%io
179 m%Content-Type:.*multipart/alternative%io
180 #m/charset=.*windows-/io
181 m!Webmail Administrator!o
182 m!Re-type Password!o
183 m!FROM THE DESK OF!io
184 m!Your mailbox quota!io
185 m!Dear lucky winner!io
186 m!Welcome to our Newsletter!o
189 #TABOO-END