From 5617c91957851165722a23f4d57ac6b7a3170ce0 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 27 Sep 2011 02:43:39 +0200 Subject: initial import --- index.py | 56 +++++++++++++++ static/css/main.css | 129 +++++++++++++++++++++++++++++++++++ static/img/PythonPowered.png | Bin 0 -> 945 bytes static/img/gnu-head-tiny.jpg | Bin 0 -> 3049 bytes static/img/mailman.jpg | Bin 0 -> 2022 bytes static/img/penguin.png | Bin 0 -> 6147 bytes templates/index.html | 75 +++++++++++++++++++++ templates/layout.html | 57 ++++++++++++++++ templates/new.html | 67 ++++++++++++++++++ templates/spam.html | 157 +++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 541 insertions(+) create mode 100755 index.py create mode 100644 static/css/main.css create mode 100644 static/img/PythonPowered.png create mode 100644 static/img/gnu-head-tiny.jpg create mode 100644 static/img/mailman.jpg create mode 100644 static/img/penguin.png create mode 100644 templates/index.html create mode 100644 templates/layout.html create mode 100644 templates/new.html create mode 100644 templates/spam.html diff --git a/index.py b/index.py new file mode 100755 index 0000000..bd0a491 --- /dev/null +++ b/index.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +from web import template, form, application, ctx +from socket import gethostbyaddr + +urls = ( + '/', 'index', + '/neu.*', 'new', + '/new', 'new', + '/help/spam.*', 'spam', +) + +render = template.render('templates/', base='layout'); + +create_form = form.Form( + form.Textbox('name', + form.notnull, + description = 'Name of your list'), + form.Textbox('email', + form.notnull, + form.regexp('.*fu-berlin\.de', 'E-mail address should end with fu-berlin.de'), + description = 'Your E-mail address'), + ) + +class index: + def GET(self): + return self.POST(); + + def POST(self): + return render.index() + +class spam: + def GET(self): + return self.POST(); + + def POST(self): + return render.spam() + +class new: + def GET(self): + form = create_form() + user = {'ip': ctx.ip, 'host': gethostbyaddr(ctx.ip)[0]} + return render.new(form, user) + + def POST(self): + form = create_form() + user = {'ip': ctx.ip, 'host': gethostbyaddr(ctx.ip)[0]} + if not form.validates(): + return render.new(form, user) + else: + return "Done." + + +if __name__ == "__main__": + app = application(urls, globals(), autoreload=False) + app.run() diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 0000000..8a8df82 --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,129 @@ +body { + margin: 0; + padding: 0; + background: #ffffff; + min-width: 800px; +} + +p.headline { + font-size: 2.4em; + margin: 0.3em 0; + font-weight: blod; +} + +p.subtext { + font-size: 1.7em; + margin: 10px 0; + font-weight: blod; +} + +span.spline { + color: red; +} + +#header { + text-align: center; +} + +#header table { + margin: 0 auto; +} + +div#title { + background: #9cf; + font-size: 1.8em; + font-weight: blod; + padding: 5px 0; + text-align: center; +} + +.small { + font-size: 0.8em; +} + +#footer { + font-size: 0.9em; + text-align: center; +} + +div.info, div.create { + margin: 2em auto; +} + +div.info { + width: 50%; +} + +div.create { + width: 70%; +} + +div.header { + background: #fff0d0; + padding: 0.2em; +} + +div#status .ok { + color: green; +} + +div#status { + text-align: center; +} + +div#status span { + font-size: 2em; +} + +div.create li { + margin: 1em 0; +} + +div.create li li { + margin: 0; +} + +form table { + width: 80%; + margin: 0 auto; +} + +form td, form th { + padding-top: 1em; +} + +form th { + text-align: right; + font-weight: normal; + vertical-align: top; + padding-right: 1em; + width: 40%; +} + +form .wrong { + display: block; + font-weight: normal; + color: red; + margin-top: 0.2em; +} + +input { + width: 20em; +} + +input.submit { + width: 10em; + margin: 1em auto 0; + padding: 0.4em; + display: block; + font-weight: bold; +} + +div#info.create { + text-align: center; +} + +div#info.create .header { + text-align: left; + margin-bottom: 1em; +} diff --git a/static/img/PythonPowered.png b/static/img/PythonPowered.png new file mode 100644 index 0000000..2e9d99c Binary files /dev/null and b/static/img/PythonPowered.png differ diff --git a/static/img/gnu-head-tiny.jpg b/static/img/gnu-head-tiny.jpg new file mode 100644 index 0000000..441be50 Binary files /dev/null and b/static/img/gnu-head-tiny.jpg differ diff --git a/static/img/mailman.jpg b/static/img/mailman.jpg new file mode 100644 index 0000000..94a4c01 Binary files /dev/null and b/static/img/mailman.jpg differ diff --git a/static/img/penguin.png b/static/img/penguin.png new file mode 100644 index 0000000..7ff0c0d Binary files /dev/null and b/static/img/penguin.png differ diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..99bf8b9 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,75 @@ +$var title: Mailinglisten +$var headline: + Willkommen auf dem Mailinglistenserver von + spline!
+ + Welcome to + the spline + mailing lists server! + + +
+
+ Übersicht aller bekanntgegebenen Listen: +
+ + Overview of publicly-advertised mailing lists:
+ https:// + + lists.spline.inf.fu-berlin.de/mailman/listinfo/ + +
+ +
+
+ Neue Mailingliste einrichten: +
+ + To create a new mailing list:
+ https:// + + lists.spline.inf.fu-berlin.de/neu/ +
+ (Einrichten nur aus der FU)
+ (restricted access, only *.fu-berlin.de may create mailing lists) +
+ +
+
+ HILFE / HELP +
+ + +
+ +
+ +
+ system status:
+ + +++ RUNNING +++ + +
+ diff --git a/templates/layout.html b/templates/layout.html new file mode 100644 index 0000000..6e24a22 --- /dev/null +++ b/templates/layout.html @@ -0,0 +1,57 @@ +$def with (content) + + + + spline - $content.title + + + + + + +
+ $:content.headline +
+ +
+ $:content +
+ + + + diff --git a/templates/new.html b/templates/new.html new file mode 100644 index 0000000..1bea143 --- /dev/null +++ b/templates/new.html @@ -0,0 +1,67 @@ +$def with (form, user) + +$var title: Mailinglisten +$var headline: + Create new mailing list + +
+
+ The rules +
+ + +
+ +
+
+ Create a mailing list +
+ +
+ $:form.render() + + +
+
+ +
+
+ Information +
+ + The following information will be logged:
+
+ Your internet address: $user['ip']
+ Your hostname: $user['host']
+
diff --git a/templates/spam.html b/templates/spam.html new file mode 100644 index 0000000..4396ef7 --- /dev/null +++ b/templates/spam.html @@ -0,0 +1,157 @@ +$var title: Mailinglisten +$var headline: + spam, und was mensch dagegen machen kann
+ + als AdministratorIn einer Mailingliste bei + spline + +
+ Es gibt verschiedene Möglichkeiten, abhängig z.B. davon, ob die Liste komplett moderiert ist, oder nur Mitglieder posten dürfen. +
    +
  • + Zunächst bemühen wir uns bei spline, Spam erst gar nicht + anzunehmen. + +
      +
    • + Da dies natürlich automatisiert passiert, ist das eine etwas + heikle Sache, da auf gar keinen Fall legitime Mail abgewiesen + werden soll. +
    • +
    • + Andersherum sehen wir immer wieder Spammer, die ihre Emails + darauf trainieren, am Spamfilter vorbei zu kommen. +
    • +
    • + Manchmal dauert es eine Weile, bis sich die Situation durch + verbesserte Filtermaßnahmen wieder normalisiert. +
    • +
    +
  • + +
  • + Trotzdem bleiben innerhalb des "Sicherheitsabstandes" nicht wenige + Spam-Mails. + +
      +
    • + Mailman bietet Dir die Möglichkeit, basierend auf der + Spam-Kennzeichnung Mails wegzuwerfen oder zurückzuweisen. +
    • +
    • Schau dir im Admin-Interface mal +
        +
      • + "Abo-Regeln und Adreßfilter..." +
          +
        • + "Spam-Filter" an. +
        • +
        +
      • +
      +
    • + +
    • + Im oberen Bereich, der + Konfigurationsoption header_filter_rules, könntest du + folgende Zeilen eintragen,
      + um Spam ab einem Wert von 5 auszusortieren (jede Zeile wird + separat verarbeitet): + +
      +            X-Spam-Status: Yes
      +            X-Spam-Level: \+{5,}
      +          
      +
    • + +
    • + der "Spam-Status: Yes" wird ab einem Level von 5 + gesetzt. +
    • + +
    • + Wenn du den "Sicherheitsabstand" größer oder kleiner haben + willst, verwendest du nur die zweite Zeile, und erhöhst (oder + verringerst) die Zahl. + +
        +
      • + Aber vorsicht, ich hatte schon legitime Mail mit einem + score von 3.6,
        + und auch wenn sie nicht einfach verschwindet, sondern mit + einer Fehler-
        + meldung zurück geht, wissen viele Absender nicht was sie + machen können. +
      • +
      +
    • +
    +
  • + +
  • + Insbesondere wenn die Liste nur für Mitglieder ist, gibt es noch + eine weitere Möglichkeit den Administrationsaufwand zu verringern: + +
      +
    • + Mails von Nichtmitgliedern sofort verwerfen, +
    • + +
    • + aber dem Admin eine Kopie schicken, der dann im Zweifel die + weggeworfene Nachricht erneut an die Liste schickt und damit + "legitimiert". +
    • + +
    • + Anstatt am Web-Interface rumzuklicken muss man nur seine + Emails lesen/löschen (und kann da evtl. nochmal lokal + filtern). +
    • + +
    • + Die Konfigurationsoptionen dafür finden sich unter +
        +
      • + "Abo-Regeln und Adreßfilter..." +
          +
        • + "Absender-Filter" +
        • +
        +
      • +
      + + die Optionen heißen generic_nonmember_action + und forward_auto_discards. +
    • +
    +
  • + +
  • + Bei allen Mühen, etwas Spam wird immer bleiben. Bei weniger als 3 + Mails/Tag lohnt es sich vielleicht, zu lernen wie man mit seinem + Mailprogramm die an die Benachrichtigungsmail angehängte Nachricht + zurückschickt, um die gehaltene Mail ohne Web-Interaktion direkt + zu löschen. Oder vielleicht kann Dein Mailprogramm die + Spam-Kennzeichnung im Mail-Kopf finden und die Mail in einen + besonderen Ordner verschieben, den Du nur alle 3 Tage anguckst? + Meistens sieht man ja auf den ersten Blick ob etwas spam + ist... Eine .procmailrc-Regel dafür wäre z.B.: + +
    +        # hinfort mit spam!
    +        :0
    +        * ^X-Spam-Level: \+\+\+\+\+\+*|^X-Spam-Level: * \*\*\*\*\*\**
    +        $$MAILDIR/spam
    +      
    + Die Regel greift ab einem Spam-Level von 5, was normalerweise + reicht. Die Variante mit den Sternen ist für Spam von anderswo, + spline macht nur + +
  • +
+ + Viel Erfolg,
+ Florian
+ mailman AT spline +
-- cgit v1.2.3-1-g7c22