ateliers:serveurmail:rspamd
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
ateliers:serveurmail:rspamd [2017/05/11 23:02] – créée dove | ateliers:serveurmail:rspamd [2018/01/28 14:01] (Version actuelle) – Typos okhin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
==== Ressources ==== | ==== Ressources ==== | ||
- | FIXME: A écrire | + | [[https:// |
+ | [[https:// | ||
==== Installation ==== | ==== Installation ==== | ||
- | apt-get install rspamd | + | __Ajout repository non-officiel__ : |
+ | |||
+ | Le repository officiel de debian n'est plus maintenu, il fautd onc utiliser la version upstream. | ||
+ | |||
+ | Le fichier ''/ | ||
+ | |||
+ | $ wget -O- https:// | ||
+ | |||
+ | <code|h / | ||
+ | deb http:// | ||
+ | </ | ||
+ | |||
+ | __Upgrade__ : apt-get upgrade | ||
+ | |||
+ | __Installation__ : apt-get install rspamd | ||
==== Administration ==== | ==== Administration ==== | ||
Ligne 15: | Ligne 30: | ||
FIXME: A écrire | FIXME: A écrire | ||
+ | < | ||
+ | # | ||
+ | # Python 3.5+ required | ||
+ | # Script by https:// | ||
+ | # Source adapted to 3.5 from dashie version https:// | ||
- | ==== Configuration ==== | + | import sys |
+ | import smtplib | ||
+ | import subprocess | ||
+ | import syslog | ||
+ | import time | ||
- | FIXME: A écrire | + | t_start = time.time() |
+ | |||
+ | SMTP_HOST | ||
+ | SMTP_PORT | ||
+ | RSPAMC_BIN | ||
+ | RSPAMC_ADDR = ' | ||
+ | |||
+ | mail_from | ||
+ | rcpt_to | ||
+ | |||
+ | def size(size, decimal_places): | ||
+ | for unit in ['',' | ||
+ | if size < 1024.0: | ||
+ | break | ||
+ | size /= 1024.0 | ||
+ | return " | ||
+ | |||
+ | syslog.openlog(logoption=syslog.LOG_PID, | ||
+ | |||
+ | # Pipe stdin to rspamc, and get the processed mail back | ||
+ | #XXX: this means the processed mail stays in RAM, which may not be what we want? | ||
+ | completed_process = subprocess.run([RSPAMC_BIN, | ||
+ | | ||
+ | | ||
+ | |||
+ | # Remove ' | ||
+ | mail_contents = completed_process.stdout | ||
+ | mail_contents = b' | ||
+ | |||
+ | with smtplib.SMTP(SMTP_HOST, | ||
+ | smtp.sendmail(mail_from, | ||
+ | |||
+ | t_end = time.time() | ||
+ | syslog.syslog(" | ||
+ | </ |
ateliers/serveurmail/rspamd.1494536537.txt.gz · Dernière modification : 2017/05/11 23:02 de dove