English Français

Pysieved avec le système de workaround.org

voici quelques notes pour utiliser le système de filtrage sieve en utilisant le sytème de mail Workaround ISP style email
en gros j'utilise le tutoriel workaround (avec une toute petite modification), j'ajoute pysieved et j'utilise le le meilleur webmail (squirrelmail bien sur) avec le plugin avelsieve.

Pysieved

Première étape, s'occuper de Pysieved, le serveur de sieve.

cd /usr/local
cp /la_ou/ta_téléchargé/pysieved-HEAD.tar.gz .
tar xvf pysieved-HEAD.tar.gz
cp /usr/local/pysieved/pysieved.ini /usr/local/etc/

pleins de trucs ont besoin d'être modifiés, donc en gros je donne ici le fichier de configuration complet (avec en plus l'option bindaddr qui pourrait être utile dans certains cas).

/usr/local/etc/pysieved.ini:

[main]
# Authentication back-end to use
auth = Dovecot

# User DB back-end to use
userdb = Dovecot

# Storage back-end to use
storage = Dovecot

# Bind to what address? (Ignored with --stdin)
#bindaddr = 127.0.0.1

# Listen on what port? (Ignored with --stdin)
port = 2000

# Write a pidfile here
pidfile = /var/run/pysieved.pid

# What UID and GID should own all files? -1 to not bother
uid = -1
gid = -1

# Switch user@host.name to host.name/user?
hostdirs = False

[Dovecot]
# Path to Dovecot's auth socket (do not set unless you're using Dovecot auth)
mux = /var/spool/postfix/private/auth

# Path to Dovecot's master socket (if using Dovecot userdb lookup)
master = /var/run/dovecot/auth-master

# Path to sievec
sievec = /usr/lib/dovecot/sievec

# Where in user directory to store scripts
scripts = pysieved

# Filename used for the active SIEVE filter (see README.Dovecot)
active = .dovecot.sieve

# What user/group owns the mail storage (-1 to never setuid/setgid)
uid = -1
gid = -1

édite et recharge inted

echo "sieve stream tcp nowait root /usr/bin/python python /usr/local/pysieved/pysieved.py --inetd" >> /etc/inetd.conf
/etc/init.d/openbsd-inetd restart

Squirrelmail

je ne sais pas pourquoi mais j'ai bien cru que cette étape allé être long et chiant, mais finalement pas.. :]

avec une config de squirrelmail qui fonctionne il faut

  1. télécharger le plugin avelsieve dans le bon répertoire depuis le site de l'auteur ou bien depuis sa page dans la section "plugins de squirrelmail.
  2. extraire l'archive
  3. copier config_sample vers config.php
cd /chemin/vers/squirrelmail/plugins/
cp /la/ou/tu_a/téléchargé/avelsieve-1.9.7.tar.gz .
tar zxvf avelsieve-1.9.7.tar.gz
cp avelsieve/config/config_sample.php avelsieve/config/config.php

ensuite il faut exécuter conf.pl (dans /chemin/vers/squirrelmail/config) pour activer le plugin

Dovecot

j'ai changé une ligne dans le fichier dovecot.conf afin d'avoir un peu plus "d'espace"
avant :

mail_location = maildir:/home/vmail/%d/%n

après

mail_location = maildir:/home/vmail/%d/%n/maildir

IMPORTANT: si ton serveur de mail a déjà reçu des mails avant cette manipulation il va alors falloir déplacer des trucs de /home/vmail/domain.tld/user/ vers /home/vmail/domain.tld/user/maildir/

après le répertoire /home/vmail/domain.tld/user/ devrait ressembler à:

lrwxrwxrwx 1 vmail vmail 18 2008-05-16 12:41 .dovecot.sieve -> pysieved/phpscript
drwx------ 9 vmail vmail 4,0K 2008-05-15 20:34 maildir
drwxr-xr-x 2 vmail vmail 4,0K 2008-05-16 12:41 pysieved

et /home/vmail/domain.tld/user/maildir/ ressemblerais à :

drwx------ 2 vmail vmail 4,0K 2008-05-15 20:30 cur
-rw------- 1 vmail vmail 168 2008-05-15 20:30 dovecot.index
-rw------- 1 vmail vmail 17K 2008-05-15 20:32 dovecot.index.cache
-rw------- 1 vmail vmail 756 2008-05-15 20:32 dovecot.index.log
-rw------- 1 vmail vmail 89 2008-05-15 20:30 dovecot-uidlist
drwx------ 5 vmail vmail 4,0K 2008-05-15 20:34 .INBOX.Drafts
drwx------ 5 vmail vmail 4,0K 2008-05-15 20:34 .INBOX.Sent
drwx------ 5 vmail vmail 4,0K 2008-05-15 21:46 .INBOX.spam
drwx------ 5 vmail vmail 4,0K 2008-05-15 20:25 .INBOX.Trash
drwx------ 2 vmail vmail 4,0K 2008-05-15 20:30 new
-rw------- 1 vmail vmail 47 2008-05-15 20:34 subscriptions
drwx------ 2 vmail vmail 4,0K 2008-05-15 20:30 tmp

quleques "burnes" (et les astuces)

il y a quelques trucs qu'il faut savoir:

cd /path/to/squirrelmail/plugins/avelsieve/
cp table.php table.php.bak
wget http://www.rockynet.com/patches/table.patch
patch table.php table.patch

et voilà, tu peux, si tu veux, supprimer toute les règles sieve.

c'est tout c'est fini.. .. . \o/

Add A Comment

Add A Comment

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)
Code in the picture:
Your Name(*):
Email:
Website:
Comment(*):