wiki:QuotasParBoite

Version 10 (modified by anonyme, 6 years ago) (diff)

--

generic viagra valium buy codeine valium online alprazolam buy cheap xenical buy xenical online celexa norvasc 5mg glucophage loss weight norvasc 5mg tramadol klonopin zanaflex lipitor side effects ephedrine zoloft side effects sildenafil viagra generic levitra buy zithromax clomid success rates cheap zanaflex carisoprodol buy online codeine online zanaflex ambien side effects zyprexa attorney bontril sr clomid side effects effects nexium side hydroxycut with ephedrine buy bontril clomid success rates generic ultram cheap cialis generic propecia meridia generic sildenafil buy cheap codeine side effects of zoloft generic viagra acyclovir side effects buy online ultracet acyclovir online ephedrine hcl buy didrex norvasc side effects buy online ultram bontril sr effects glucophage side side effects of zoloft hydrocodone online acyclovir carisoprodol buying lipitor recall zithromax z pak generic tadalafil zanaflex effects nexium side atenolol side effects acyclovir medication buy hydrocodone carisoprodol buy online glucophage pcos tramadol online buy ambien online bontril 35mg acomplia treatment tramadol cod cheap cialis buy online diazepam valium xanax online cheap zanaflex canada discount celexa celebrex side effects of zyprexa buy hydrocodone zyprexa attorney buy online diazepam citrate sildenafil acne tetracycline glucophage phentermine tramadol does meridia work zithromax z pak ephedrine diet pills sildenafil buy soma carisoprodol hydrocodone online side effects of clomid generic norvasc glucophage phentermine alcohol lexapro buy ephedrine buy citrate sildenafil klonopin withdrawal effects nexium side effects of zoloft tramadol buy ephedrine low cost xenical meridia side effects prevacid online zyprexa lawyer buy codeine soma buy bontril cheap xenical generic viagra ephedrine hydrocodone no prescription valium buy xenical hydrocodone no prescription clomid is ultracet a narcotic buy hydrocodone dangers of ephedrine cheap xenical acyclovir online cheap didrex buy tramadol buy codeine glucophage phentermine codeine generic propecia atenolol buy cheap ultracet cheap propecia buy ultracet prevacid side effects xanax online side effects of zoloft buy celebrex clomid side effects buy cheap ultram glucophage acyclovir side effects generic propecia sildenafil viagra ephedrine cheap diazepam buy soma cheap valium without prescription dangers of ephedrine viagra hydrocodone online diazepam lexapro withdrawal zithromax z pak cheap codeine generic nexium bontril online side effects of xanax drug ultracet generic viagra lexapro symptom withdrawal buy atenolol atenolol and flushing buy ultracet affect nexium side alcohol lexapro acyclovir side effects celexa & discontinuation symptoms cheap codeine cheap cialis soft tab tadalafil slot machine celebrex buy ambien online buy codeine online pharmacy tramadol acyclovir online generic valium klonopin picture ambien cheap propecia buy tramadol xanax online buy online codeine generic valium xanax xr effects side tetracycline prevacid solutab cheap cialis buy levitra online affect nexium side zyprexa lawyer ephedrine diet pills meridia discount buy valium alprazolam propecia norvasc side effects generic tadalafil atenolol buy online codeine ephedrine hcl buy xenical klonopin picture ephedrine hcl zithromax z pak side effects from lipitor buy ultram online buy levitra buy valium discount didrex cheap viagra glucophage xr meridia side effects generic sildenafil side effects of zoloft klonopin wafer buy zolpidem online buy tramadol cheap propecia buy hydrocodone online cheap ephedra lexapro symptom withdrawal glucophage phentermine buy zithromax buy ephedra sildenafil buy viagra buy codeine acyclovir side effects buy online ultracet acomplia treatment soma online zoloft side effects clomid success xanax lexapro symptom withdrawal buy prevacid zithromax z pak lipitor buy cheap ultram drug klonopin generic levitra what does alprazolam look like ephedrine diet pills cheap xenical buy citrate sildenafil viagra alternative drug klonopin buy valium online buy zolpidem online buy cheap celexa buy cheap ultram meridia discount cialis meridia discount lipitor side effects hydroxycut with ephedrine xanax xr phentermine online generic cialis generic tadalafil buy prevacid side effects of xanax hydrocodone cod cheap diazepam norvasc 5 mg prevacid side effects of zyprexa buy cheap carisoprodol buy phentermine alcohol lexapro buy bontril acomplia pill zyprexa lawyer order cialis generic cialis bontril klonopin withdrawal bontril online lexapro symptom withdrawal buy online fioricet norvasc 5mg meridia discount levitra lexapro withdrawal soft tab tadalafil meridia side effects atenolol glucophage loss weight online atenolol acyclovir zovirax nexium online buy xanax online buy tetracycline generic valium antibiotic tetracycline klonopin generic viagra carisoprodol atenolol and flushing acyclovir zovirax lexapro symptom withdrawal

Mise en garde

Si ce Howto cherche a rester a la fois le plus debian-style et AlternC-style, il vous fait quitter les deux. Il s'adresse donc plutot a un public avertis, capable eventuellement d'aller hacker la conf de postfix a La Rache . Enfin il faut compiler une extension de MySQL afin de pouvoir dissocier ce qui est du pop des redirections (dans le cas d'une boite faisant les deux) car la config d'AlternC s'appuie par defaut sur une distribution locale du courrier, alors que dans la configuration qui suit seules les mailings lists beneficie de cela, tout le reste passant par du virtual et donc du quota.

Je suis maintenant convaincu que cette methode est loin d'etre la meilleure et qu'il y a moyen de mieux faire. Les maps SQL que j'utilise ne sont certainement pas les plus pertinentes mais j'ai du "bidouiller" pour que ca marche. Je ne dispose malheureusement pas du temps necessaire pour faire mieux.

Enfin le calcul du quota a la reception de chaque mail charge la machine, donc je deconseille ce type de configuration sur un serveur deja charge.

Installation de postfix patche pour VDA

Il faut recuperer les sources de postfix pour appliquer les patchs VDA.

apt-get install build-essential dpkg-dev fakeroot debhelper libdb4.2-dev libgdbm-dev libldap2-dev libpcre3-dev libmysqlclient10-dev libssl-dev libsasl2-dev postgresql-dev po-debconf dpatch
cd /usr/src
apt-get source postfix

wget http://web.onda.com.br/nadal/postfix/VDA/postfix-2.1.5-trash.patch.gz
gunzip postfix-2.1.5-trash.patch.gz
cd postfix-2.1.5
patch -p1 < ../postfix-2.1.5-trash.patch
dpkg-buildpackage
cd ..
dpkg -i postfix_2.1.5-9_i386.deb
dpkg -i postfix-mysql_2.1.5-9_i386.deb
dpkg -i postfix-tls_2.1.5-9_i386.deb

Ensuite on fixe ces packages afin qu'il ne soit plus mis a jour :

dpkg --get-selections| grep postfix | sed s/hold/install/ | dpkg --set-selections
aptitude hold postfix postfix-doc postfix-mysql postfix-pcre postfix-tls

Mise en place du champs quota dans MySQL

Nous allons ajouter un champs quota a la table mail_users d'AlternC, nous fixons ici un quota en 100Mo , cette donnee est exprimee en octets.

 mysql -usysusr -pmot_de_passe system -e "ALTER TABLE `mail_users` ADD `quota`  INT DEFAULT '104857600' NOT NULL ;"

Il faut en plus compiler une extension pour mysql afin que de disposer d'une fonction mailfilter. AlternC utilisant le transport local pour faire la delvrance nous devons sortir de ce shema afin de passer par un transport virtuel.

tar zxvf mailfilter.tgz
cd mailfilter
make 
cp mailfiter.so /usr/lib/mysql-fct-mailfilter.so
ldconfig 
mysql restart
mysql -usysusr -pmot_de_passe -e "create function mailfilter returns string soname 'mysql-fct-mailfilter.so' ;"

Modification des confs d'AlternC pour postfix et courrier

Il faut editer /etc/alternc/templates/postfix/main.cf et le remplacer par :

#
# Fichier de configuration de Postfix pour AlternC
# $Id: main.cf,v 1.17 2006/01/12 06:50:15 anarcat Exp $
# 
# %%warning_message%% 
# pour postfix SARGE v2

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
# recipient_delimiter = +

home_mailbox = Maildir/

smtpd_banner = $myhostname ESMTP

header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks

local_destination_concurrency_limit = 8
default_destination_concurrency_limit = 10

myhostname = %%fqdn%%
myorigin = %%fqdn%%
mynetworks = 127.0.0.1 %%mynetwork%%  82.127.2.119 81.80.253.50


# Configuration TLS pour le serveur smtp : 
smtpd_use_tls = yes
smtpd_tls_dcert_file = /etc/courier/pop3d.pem
smtpd_tls_dkey_file = $smtpd_tls_dcert_file
smtpd_tls_CApath = /etc/ssl/certs/
smtpd_tls_key_file =  $smtpd_tls_dcert_file
smtpd_tls_cert_file =  $smtpd_tls_dcert_file
smtpd_tls_loglevel = 0
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

# Configuration TLS pour le client smtp
smtp_use_tls = yes
smtp_tls_dcert_file = $smtpd_tls_dcert_file
smtp_tls_dkey_file = $smtpd_tls_dcert_file
smtp_tls_CApath = $smtpd_tls_CApath

# Configuration SASL via sasldb (/etc/sasldb) uniquement en TLS.
# Sinon le pass passe en clair et c'est mal !
smtpd_tls_auth_only = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = postfix
smtpd_sasl_security_options = noanonymous
enable_sasl_authentification = yes
broken_sasl_auth_clients = yes

# Pour ?iter certains vieux spammeurs.
disable_vrfy_command = yes

# On autorise le relai ?: les authentifi? en saslet nos domaines.
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination

alias_maps = mysql:/etc/postfix/mymailinglists.cf mysql:/etc/postfix/myalias-only.cf hash:/etc/aliases

default_privs = www-data
program_directory = /usr/lib/postfix

#Quota Postfix VDA
virtual_minimum_uid = 32
virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf proxy:mysql:/etc/postfix/mygidunderscore.cf
virtual_uid_maps = static:33
virtual_transport = virtual
virtual_mailbox_base = /
virtual_alias_maps =  proxy:mysql:/etc/postfix/myredirections.cf proxy:mysql:/etc/postfix/mymixed.cf 
virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtualmaildirunderscore.cf proxy:mysql:/etc/postfix/myvirtualmaildir.cf 
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mydomains.cf proxy:mysql:/etc/postfix/myunderscore.cf
virtual_alias_domains =
append_at_myorigin = no
append_dot_mydomain = no
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/myquota.cf
virtual_mailbox_limit_override = yes
virtual_mailbox_limit = 1073741824
virtual_mailbox_limit_inbox = no
virtual_maildir_limit_message = La boite email de votre destinataire est pleine.
virtual_create_maildirsize = yes
virtual_overquota_bounce = yes
proxy_read_maps= $virtual_gid_maps $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $virtual_mailbox_limit_maps  proxy:unix:passwd.byname 
local_transport = local
mydestination = 

il faut editer le fichier : /etc/alternc/templates/courier/authmysqlrc a la ligne 131 mettre :

MYSQL_QUOTA_FIELD quota

Ensuite il faut reprendre les fichiers de maps mysql pour postfix :

tar zxvf conf.tgz 
cd conf
for i in * 
sed -i s/MDP_SQL/A_REMPLACER_PAR_LE_VOTRE/ $i
cp * /etc/postfix

changer les droits :

chmod 640 /etc/postfix/*.cf 
chgrp postfix /etc/postfix/*.cf

AlternC install

Ensuite un petit :

alternc.install 

Et si tout va bien tout roule :)

Todo

Ajouter un script de notification de quota pour les utilisateurs.

Attachments

  • conf.tgz (812 bytes) - added by pierre-gilles 7 years ago. Maps MySQL pour Postfix pour une delivrance via virtual
  • mailfilter.tgz (1.9 KB) - added by pierre-gilles 7 years ago. Extension pour Mysql 4.X permettant d'utiliser un filtre mailfilter