summaryrefslogtreecommitdiffstats
path: root/cgi-bin/ml-request
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@gcc.gnu.org>2010-07-29 22:14:29 +0000
committerFrank Ch. Eigler <fche@gcc.gnu.org>2010-07-29 22:14:29 +0000
commitf193287a54be1eda13683135e20b1767ca7ccbfe (patch)
tree949273ad01b4fdda317d326d393426956b22d8be /cgi-bin/ml-request
parentc++0x update (diff)
downloadgcc-wwwdocs-f193287a54be1eda13683135e20b1767ca7ccbfe.tar.gz
gcc-wwwdocs-f193287a54be1eda13683135e20b1767ca7ccbfe.tar.bz2
gcc-wwwdocs-f193287a54be1eda13683135e20b1767ca7ccbfe.tar.xz
unxss
Diffstat (limited to '')
-rwxr-xr-xcgi-bin/ml-request67
1 files changed, 31 insertions, 36 deletions
diff --git a/cgi-bin/ml-request b/cgi-bin/ml-request
index c0927504..45ccf36e 100755
--- a/cgi-bin/ml-request
+++ b/cgi-bin/ml-request
@@ -1,11 +1,15 @@
1#! /bin/sh 1#! /bin/sh
2 2
3HEADER='<body><h1 align="center"><a href="/">GCC</a> mailing list request-o-matic</h1>' 3CONVAWK=/www/sourceware/cgi-bin/conv.awk
4FOOTER='<hr><a href="/">Click here</a> to return to the front GCC web page</body></html>'
5
6CONVAWK=/www/gcc/cgi-bin/conv.awk
7MAIL=/usr/bin/Mail 4MAIL=/usr/bin/Mail
8 5
6HEADER=/www/sourceware/htdocs/include/header-subpages.html
7FOOTER=/www/sourceware/htdocs/include/footer-subpages.html
8
9case "$REQUEST_METHOD" in
10 POST) QUERY_STRING=`cat` ;;
11esac
12
9if [ ! -f /usr/bin/gawk ] 13if [ ! -f /usr/bin/gawk ]
10then 14then
11 GAWK=gawk 15 GAWK=gawk
@@ -24,11 +28,8 @@ normalize()
24## input on stdin will be of the format 28## input on stdin will be of the format
25## username=emailaddr@domain.com 29## username=emailaddr@domain.com
26## listname=mailing-list-name 30## listname=mailing-list-name
27## operation=[subscribe|unsubscribe]
28## digest=[on|off]
29 31
30hasat=0 32hasgoodform=0
31hasdot=0
32email="" 33email=""
33cmdargs="" 34cmdargs=""
34prnum="" 35prnum=""
@@ -77,27 +78,21 @@ then
77 echo "<head>" 78 echo "<head>"
78 echo "<TITLE>Cannot add you to the mailing list at this time...</TITLE>" 79 echo "<TITLE>Cannot add you to the mailing list at this time...</TITLE>"
79 echo "</head>" 80 echo "</head>"
80 echo "$HEADER" 81 cat $HEADER
81 82
82 echo "<p>There was an internal error in this script. Please report" 83 echo "<p>There was an internal error in this script. Please report"
83 echo "this problem to sourcemaster@cygnus.com." 84 echo "this problem to sourcemaster@sourceware.org."
84 85
85 echo "$FOOTER" 86 cat $FOOTER
86 exit 0 87 exit 0
87fi 88fi
88 89
89 90
90if echo "$email" | grep @ >/dev/null 2>&1 91if expr "$email" : '^[a-zA-Z0-9._-]*@[a-zA-Z0-9._-]*$' >/dev/null
91then 92then
92 hasat=1 93 hasgoodform=1
93 if echo "$email" | sed 's,^[^@]*@,,' | grep '\.' >/dev/null 2>&1
94 then
95 hasdot=1
96 else
97 hasdot=0
98 fi
99else 94else
100 hasat=0 95 hasgoodform=0
101fi 96fi
102 97
103if [ -z "$listname" ] 98if [ -z "$listname" ]
@@ -132,7 +127,7 @@ then
132 fi 127 fi
133fi 128fi
134 129
135if [ -n "$email" -a "$hasat" -eq 1 -a "$hasdot" -eq 1 -a "$has_listname" -eq 1 ] 130if [ -n "$email" -a "$hasgoodform" -eq 1 -a "$has_listname" -eq 1 ]
136then 131then
137 132
138 if [ "$operation" = "subscribe" ] 133 if [ "$operation" = "subscribe" ]
@@ -150,13 +145,13 @@ then
150 echo "<head>" 145 echo "<head>"
151 echo "<TITLE>Your ${sub_prefix}subscribe request is being sent in...</TITLE>" 146 echo "<TITLE>Your ${sub_prefix}subscribe request is being sent in...</TITLE>"
152 echo "</head>" 147 echo "</head>"
153 echo "$HEADER" 148 cat $HEADER
154 149
155 QMAILHOST=gcc.gnu.org 150 QMAILHOST=sourceware.org
156 export QMAILHOST 151 export QMAILHOST
157 orig_email="${email}" 152 orig_email="${email}"
158 email="`echo ${email} | sed 's,@,=,g'`" 153 email="`echo ${email} | sed 's,@,=,g'`"
159 echo "" | $MAIL "${listname}-${digest}${operation}-${email}@gcc.gnu.org" 154 echo "" | $MAIL "${listname}-${digest}${operation}-${email}@sourceware.org"
160 155
161 echo "<h2>Your ${sub_prefix}subscribe request is being sent in...</h2>" 156 echo "<h2>Your ${sub_prefix}subscribe request is being sent in...</h2>"
162 157
@@ -180,12 +175,12 @@ then
180 echo "confirmation note soon, please try submitting your request again. " 175 echo "confirmation note soon, please try submitting your request again. "
181 echo "<p>You can" 176 echo "<p>You can"
182 echo "also do your request by sending an e-mail note to" 177 echo "also do your request by sending an e-mail note to"
183 echo "<code>${listname}-${digest}${operation}@gcc.gnu.org</code>" 178 echo "<code>${listname}-${digest}${operation}@sourceware.org</code>"
184 echo "<p>The message body and Subject line are ignored." 179 echo "<p>The message body and Subject line are ignored."
185 180
186 echo "<p>See the" 181 echo "<p>See the"
187 echo "<a href=\"http://gcc.gnu.org/lists.html\">GCC mailing list page</a>" 182 echo "<a href=\"http://sourceware.org/lists.html#faqs\">mailing"
188 echo "for more information." 183 echo "list FAQ page</a> for more information."
189else 184else
190 if [ "$has_listname" -eq 1 ] 185 if [ "$has_listname" -eq 1 ]
191 then 186 then
@@ -195,7 +190,7 @@ else
195 echo "<head>" 190 echo "<head>"
196 echo "<TITLE>Cannot handle your mailing list request...</TITLE>" 191 echo "<TITLE>Cannot handle your mailing list request...</TITLE>"
197 echo "</head>" 192 echo "</head>"
198 echo "$HEADER" 193 cat $HEADER
199 194
200 echo '<h2>Cannot handle your mailing list request...</h2>' 195 echo '<h2>Cannot handle your mailing list request...</h2>'
201 echo '<p>' 196 echo '<p>'
@@ -207,12 +202,12 @@ else
207 202
208 echo "<p>You can" 203 echo "<p>You can"
209 echo "also subscribe by sending an e-mail note to" 204 echo "also subscribe by sending an e-mail note to"
210 echo "<code>${listname}-${digest}${operation}@gcc.gnu.org</code>" 205 echo "<code>${listname}-${digest}${operation}@sourceware.org</code>"
211 echo "<p>The message body and Subject line are ignored." 206 echo "<p>The message body and Subject line are ignored."
212 207
213 echo "<p>See the" 208 echo "<p>See the"
214 echo "<a href=\"http://gcc.gnu.org/lists.html\">GCC mailing list page</a>" 209 echo "<a href=\"http://sourceware.org/ml/index.html#faqs\">sourceware"
215 echo "for more information." 210 echo "mailing list FAQ page</a> for more information."
216 else 211 else
217 echo "Content-type: text/html" 212 echo "Content-type: text/html"
218 echo "" 213 echo ""
@@ -220,24 +215,24 @@ else
220 echo "<head>" 215 echo "<head>"
221 echo "<TITLE>Cannot handle your mailing list request at this time...</TITLE>" 216 echo "<TITLE>Cannot handle your mailing list request at this time...</TITLE>"
222 echo "</head>" 217 echo "</head>"
223 echo "$HEADER" 218 cat $HEADER
224 219
225 echo '<h2>Cannot handle your mailing list request at this time...</h2>' 220 echo '<h2>Cannot handle your mailing list request at this time...</h2>'
226 221
227 echo '<p>' 222 echo '<p>'
228 echo "You did not provide a mailing list name, or you've entered a mailing" 223 echo "You did not provide a mailing list name, or you've entered a mailing"
229 echo 'list name which is not handled on <tt>gcc.gnu.org</tt>.' 224 echo 'list name which is not handled on <tt>sourceware.org</tt>.'
230 225
231 echo '<p>If you are trying to (un)subscribe to/from a mailing list hosted at <b>gnu.org</b>,' 226 echo '<p>If you are trying to (un)subscribe to/from a mailing list hosted at <b>gnu.org</b>,'
232 echo "send a mail note to <b>${listname}-request@gnu.org</b> with a message body" 227 echo "send a mail note to <b>${listname}-request@gnu.org</b> with a message body"
233 echo like, \"subscribe ${listname}\". 228 echo like, \"subscribe ${listname}\".
234 229
235 echo "<p>See the" 230 echo "<p>See the"
236 echo "<a href=\"http://gcc.gnu.org/lists.html\">GCC mailing list page</a>" 231 echo "<a href=\"http://sourceware.org/ml/index.html#faqs\">sourceware"
237 echo "for more information." 232 echo "mailing list FAQ page</a> for more information."
238 fi 233 fi
239fi 234fi
240 235
241echo "$FOOTER" 236cat $FOOTER
242 237
243exit 0 238exit 0