Projekte
Spamsichere mailto-Links
In der heutigen Zeit in der e-Mail Postfächer von einer wahren Spamflut überrollt werden, ist es für Webmaster eine Pflicht die e-Mail-Addressen auf ihren Seiten vor dem Auslesen zu schützen.
Das angebotene php-Skript verwendet hierfür folgende Techniken:
- Codierung der einzelnen Zeichnen im Quelltext in Unicode
- Aufteilung des Linkteils auf mehrere Zeilen im Quelltext Mithilfe einer Einbettung in ein JavaScript.
- Anzeige für den User in Form einer dynamisch erzeugten Grafik
- Auch bei deaktivierten JavaScript sieht der User die Grafik (ab v0.3)
- Anstelle der Grafik kann der Link nun auch einfach mit dem Wort 'e-mail' beschriftet werden (ab v0.4)
- Mit der Funktion replace_email(TEXT) werden alle e-Mail-Adressen in dem gegebenen Text geschützt, z.B. zum Schutz von Gästebucheinträgen geeignet. (ab v0.4)
- Kompletter recode des JavaScripts zur Herstellung der Kompatibilität zum xhtml+xml Standard. (v0.5)
- Umleitung auf Fehlerseite bei abgeschaltetem JScript. (ab v0.5)
- Erweiterung um get_browser Funktion zum richtigen maskieren des JavaScripts für verschiedene Browser. (ab v0.5)
Natürlich kann auch das angebotene Skript nicht vollkommen vor dem Auslesen durch Spam-Webspider schützen, aber die Verwendung der Sicherungsmassnahmen sind ein grosser Schritt in die richtige Richtung.
- Version 0.1: Download (Grösse 3 kB, Hits: 162)
- Version 0.2: Download (Grösse 4 kB, Hits: 144)
- Version 0.3: Download (Grösse 4 kB, Hits: 147)
- Version 0.4: Download (Grösse 4 kB, Hits: 146) (Stable released: 05.09.2006)
- Version 0.5: Download (Grösse 5 kB, Hits: 138) (Testing released: 10.11.2006)
Postfix - like ISP with Spamassasin
This howto is mostly based on the howto at workaround.org you can find here.
Follow this howto and then do the changes I explain you here.
Changes at step 7:
For security reasons, we want to use encrypted passwords in the database. But the postfix smtp-mysql plugin doesn't work with encrypted passwords yet. So we use the courier-authdaemon instead, which we will configure at step 8 for that usage.
Your /etc/postfix/sasl/smtpd.conf, which you create should look as the following:
log_level: 3
mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5
authdaemond_path: /var/run/courier/authdaemon/socket
Because the postfix smtpd is running in a chroot enviroment, you have to link the authdaemon-socket to this.
ln /var/run/courier/authdaemon/socket /var/spool/postfix/var/run/courier/authdaemon/socket
chown -R daemon:daemon /var/spool/postfix/var/run/courier
Because the socket changes everytime you restart the courier-authdaemon you must refresh the hardlink above. Best do this with the authdaemon start-script /etc/init.d/courier-authdaemon.
Edit the file like this:
# Start daemons.
cd /
if test -x /authlib/authdaemond
then
echo -n Starting Courier authdaemon:
/authlib/authdaemond start
sleep 3
ln -f /var/run/courier/authdaemon/socket /var/spool/postfix/var/run/courier/authdaemon/socket
echo done.
fi
;;
Changes at step 8:
Use the ENCRYPTED passwords instead of clear text passwords in the the database
The lines in howto look like that:
MYSQL_CLEAR_PWFIELD password
Yours should look like this:
#MYSQL_CLEAR_PWFIELD (comment this out)
Now when inserting new user-accounts to database use mysql-function ENCRYPT() for the passwords
And now the real changes begin:
Configure the amavis as explained at the workaround.org-howto. Then edit the file /etc/spamassassin/local.cf:
# for details of what can be tweaked.
#
# How many hits before a message is considered spam.
required_hits 5.0
# Whether to change the subject of suspected spam
rewrite_subject 0
# Text to prepend to subject if rewrite_subject is used
subject_tag *****SPAM*****
# Encapsulate spam in an attachment
report_safe 1
# Use terse version of the spam report
use_terse_report 0
# Enable the Bayes system
use_bayes 1
# Enable Bayes auto-learning
auto_learn 1
# Enable or disable network checks
skip_rbl_checks 0
use_razor2 1
use_dcc 0
use_pyzor 0
# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages all
# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales all
To train the Spamassassin I have wrote an own bash-script you should run every hour with cron.
The version 0.1 scans for spam and ham in each spam-directory and ham-directory of every mailaccount you create on your system.
If you have users on your server you can not trust doing spam-sorting right, you should not use this script-version but should wait for version 0.2, which is estimated end of September 2006.
This version will have advanced scanning and removing control.
And here is the script in it's actual version.
You can download all versions of the script here:
- Version 0.1: Download (Grösse 6 kB, Hits: 400) (Stable released: 05.09.2006)
Für Anregungen und Fehlermeldungen an
wäre ich sehr dankbar.

