URL: https://linuxfr.org/forums/linux-debian-ubuntu/posts/exim4-probleme-de-quota Title: Exim4 probleme de quota .. Authors: Sylvain Date: 2008年09月22日T13:42:23+02:00 Tags: Score: 0 Bonjour, ne sachant plus trop quoi faire je me retourne sur mon forum preferé .. J'essaye de mettre en place une solution de quota sur un serveur exim4 couplé à mySql. Le soucis c'est que le systeme me retourne aucune erreur, mais le quota est toujours 'illimité'.. En furetant sur internet, je trouve pas d'autre moyen que celui ci: Voici mon fichier exim4.conf ###################################################################### # MAIN CONFIGURATION SETTINGS # ###################################################################### # MySQL defines MYSQL_SERVER=localhost MYSQL_USER=exim MYSQL_PASSWORD=SECRET MYSQL_DB=exim MYSQL_EMAILTABLE=emailtable MYSQL_DOMAINTABLE=domaintable MYSQL_DOMAINRTABLE=relaytable MYSQL_WHITETABLE=whitelist MYSQL_BLACKTABLE=blacklist MYSQL_AUTHTABLE=boxauth # Mailman vars MAILMAN_HOME=/var/lib/mailman MAILMAN_WRAP=MAILMAN_HOME/mail/wrapper MAILMAN_UID=list MAILMAN_GID=list # MySQL queries MYSQL_Q_ISAWAY=SELECT domain FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' AND is_away='yes' MYSQL_Q_AWAYTEXT=SELECT away_text FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' MYSQL_Q_FORWARD=SELECT forward FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' AND forward != '' MYSQL_Q_CC=SELECT cc FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' MYSQL_Q_LOCAL=SELECT domain FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' AND box != '' MYSQL_Q_WCLOCAL=SELECT domain FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='*' AND forward != '' MYSQL_Q_WCLOCFW=SELECT forward FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='*' AND forward != '' MYSQL_Q_LDOMAIN=SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='$domain' MYSQL_Q_RDOMAIN=SELECT DISTINCT domain FROM MYSQL_DOMAINRTABLE WHERE domain='$domain' MYSQL_Q_BOXNAME=SELECT box FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' MYSQL_Q_SPAMC=SELECT domain FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' AND opt_spamscan='yes' MYSQL_Q_VSCAN=SELECT domain FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' AND opt_virscan='yes' MYSQL_Q_SPAMPURGE=SELECT domain FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' AND opt_spampurge='yes' MYSQL_Q_DISABLED=SELECT domain FROM MYSQL_EMAILTABLE WHERE domain='${quote_mysql:$domain}' AND local_part='${quote_mysql:$local_part}' AND is_enabled='no' MYSQL_Q_WHITELIST=SELECT DISTINCT MYSQL_WHITETABLE.address FROM MYSQL_WHITETABLE WHERE '${quote_mysql:$sender_address}' LIKE whitelist.address MYSQL_Q_BLACKLIST=SELECT DISTINCT MYSQL_BLACKTABLE.address FROM MYSQL_BLACKTABLE WHERE '${quote_mysql:$sender_address}' LIKE blacklist.address MYSQL_Q_AUTHPWD1=SELECT boxname FROM MYSQL_AUTHTABLE WHERE boxname='2ドル' AND boxpwd=encrypt('3ドル',boxpwd) MYSQL_Q_AUTHPWD2=SELECT boxname FROM MYSQL_AUTHTABLE WHERE boxname='1ドル' AND boxpwd=encrypt('2ドル',boxpwd) MYSQL_Q_QUOTA=SELECT quota FROM MYSQL_EMAILTABLE WHERE local_part='${quote_mysql:$local_part}' and domain='${quote_mysql:$domain}' # MySQL connection hide mysql_servers = "MYSQL_SERVER/MYSQL_DB/MYSQL_USER/MYSQL_PASSWORD" # starting 'normal' config domainlist qualify_domain = mysql;MYSQL_Q_LDOMAIN domainlist local_domains = mysql;MYSQL_Q_LDOMAIN domainlist relay_to_domains = mysql;MYSQL_Q_RDOMAIN hostlist relay_from_hosts = 127.0.0.1 acl_smtp_rcpt = acl_check_rcpt never_users = root trusted_users = amavis : list host_lookup = * rfc1413_hosts = * rfc1413_query_timeout = 15s check_spool_space = 50M check_log_space = 20M return_size_limit = 20k message_size_limit = 30M ignore_bounce_errors_after = 2d timeout_frozen_after = 7d deliver_queue_load_max = 8 queue_only_load = 10 remote_max_parallel = 15 #tls_certificate = #tls_privatekey = #tls_advertise_hosts = * ###################################################################### # ACL CONFIGURATION # # Specifies access control lists for incoming SMTP mail # ###################################################################### begin acl acl_check_rcpt: £spaces£ £/spaces£accept hosts = : £spaces£ £/spaces£deny domains = +local_domains £spaces£ £/spaces£local_parts = ^[.] : ^.*[@%!/|] £spaces£ £/spaces£deny domains = !+local_domains £spaces£ £/spaces£local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./ £spaces£ £/spaces£accept local_parts = postmaster £spaces£ £/spaces£domains = +local_domains £spaces£ £/spaces£require verify = sender £spaces£ £/spaces£accept domains = +local_domains £spaces£ £/spaces£endpass £spaces£ £/spaces£verify = recipient £spaces£ £/spaces£accept domains = +relay_to_domains £spaces£ £/spaces£endpass £spaces£ £/spaces£verify = recipient £spaces£ £/spaces£accept hosts = +relay_from_hosts £spaces£ £/spaces£accept authenticated = * £spaces£ £/spaces£deny message = relay not permitted ###################################################################### # ROUTERS CONFIGURATION # # Specifies how addresses are handled # ###################################################################### # THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! # # An address is passed to each router in turn until it is accepted. # ###################################################################### begin routers fail_router: £spaces£ £/spaces£driver = redirect £spaces£ £/spaces£domains = ${lookup mysql {MYSQL_Q_DISABLED}{$value}} £spaces£ £/spaces£data = ":fail:" £spaces£ £/spaces£allow_fail ##uncomment, if you plan to use mailman (www.list.org) #mailman_aliases: # driver = redirect # allow_fail # allow_defer # data = ${lookup{$local_part}lsearch{/etc/aliases.mailman}} # file_transport = address_file # pipe_transport = address_pipe amavis_director: £spaces£ £/spaces£driver = manualroute £spaces£ £/spaces£domains = ${lookup mysql {MYSQL_Q_VSCAN}{$value}} £spaces£ £/spaces£condition = "${if or { \ £spaces£ £/spaces£{eq{$received_protocol}{scanned-ok}} \ £spaces£ £/spaces£{eq{$received_protocol}{spam-scanned}} \ # if you like to scan mails from localhost too, then comment the following line (not good for big mailman lists...) £spaces£ £/spaces£{eq{$sender_host_address}{127.0.0.1}} \ £spaces£ £/spaces£} \ £spaces£ £/spaces£{0}{1}}" £spaces£ £/spaces£route_list = "* localhost byname" £spaces£ £/spaces£transport = amavis £spaces£ £/spaces£verify = false dnslookup: £spaces£ £/spaces£driver = dnslookup £spaces£ £/spaces£domains = ! +local_domains £spaces£ £/spaces£transport = remote_smtp £spaces£ £/spaces£ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 £spaces£ £/spaces£no_more blacklist_router: £spaces£ £/spaces£driver = manualroute £spaces£ £/spaces£senders = ${lookup mysql {MYSQL_Q_BLACKLIST}{$value}} £spaces£ £/spaces£condition = "${if !def:h_X-Spam-Flag: {1}{0}}" £spaces£ £/spaces£headers_add = X-Spam-Flag: YES £spaces£ £/spaces£route_list = * localhost £spaces£ £/spaces£self = pass system_aliases: £spaces£ £/spaces£driver = redirect £spaces£ £/spaces£allow_fail £spaces£ £/spaces£allow_defer £spaces£ £/spaces£data = ${lookup{$local_part}lsearch{/etc/aliases}} # user = exim £spaces£ £/spaces£file_transport = address_file £spaces£ £/spaces£pipe_transport = address_pipe spamcheck_director: £spaces£ £/spaces£driver = manualroute £spaces£ £/spaces£domains = ${lookup mysql {MYSQL_Q_SPAMC}{$value}} £spaces£ £/spaces£senders = ! ${lookup mysql {MYSQL_Q_WHITELIST}{$value}} £spaces£ £/spaces£condition = ${if and { \ £spaces£ £/spaces£{!eq {$received_protocol}{spam-scanned}} \ £spaces£ £/spaces£{!eq {$received_protocol}{local}} \ £spaces£ £/spaces£} {1}{0}} £spaces£ £/spaces£headers_remove = X-Spam-Flag £spaces£ £/spaces£route_list = "* localhost byname" £spaces£ £/spaces£transport = spamcheck £spaces£ £/spaces£verify = false spampurge_director: £spaces£ £/spaces£driver = manualroute £spaces£ £/spaces£domains = ${lookup mysql {MYSQL_Q_SPAMPURGE}{$value}} £spaces£ £/spaces£condition = "${if eq{$h_X-Spam-Flag:}{YES} {1}{0}}" £spaces£ £/spaces£route_list = "* localhost byname" £spaces£ £/spaces£transport = devnull_transport £spaces£ £/spaces£verify = false vacation_director: £spaces£ £/spaces£driver = accept £spaces£ £/spaces£domains = ${lookup mysql {MYSQL_Q_ISAWAY}{$value}} £spaces£ £/spaces£transport = vacation_autoreply £spaces£ £/spaces£unseen virtual_cc_director: £spaces£ £/spaces£driver = redirect £spaces£ £/spaces£data = ${lookup mysql {MYSQL_Q_CC}{$value}} £spaces£ £/spaces£unseen virtual_forward_director: £spaces£ £/spaces£driver = redirect £spaces£ £/spaces£data = ${lookup mysql {MYSQL_Q_FORWARD}{$value}} virtual_local_mailbox: £spaces£ £/spaces£driver = accept £spaces£ £/spaces£domains = ${lookup mysql {MYSQL_Q_LOCAL}{$value}} £spaces£ £/spaces£transport = virtual_local_md_delivery virtual_wclocal_redirect: £spaces£ £/spaces£driver = redirect £spaces£ £/spaces£domains = ${lookup mysql {MYSQL_Q_WCLOCAL}{$value}} £spaces£ £/spaces£data = ${lookup mysql {MYSQL_Q_WCLOCFW}{$value}} ###################################################################### # TRANSPORTS CONFIGURATION # ###################################################################### # ORDER DOES NOT MATTER # # Only one appropriate transport is called for each delivery. # ###################################################################### begin transports remote_smtp: £spaces£ £/spaces£driver = smtp devnull_delivery: £spaces£ £/spaces£driver = appendfile £spaces£ £/spaces£file = /dev/null £spaces£ £/spaces£group = mail address_pipe: £spaces£ £/spaces£driver = pipe £spaces£ £/spaces£return_output address_file: £spaces£ £/spaces£driver = appendfile £spaces£ £/spaces£delivery_date_add £spaces£ £/spaces£envelope_to_add £spaces£ £/spaces£return_path_add address_reply: £spaces£ £/spaces£driver = autoreply amavis: £spaces£ £/spaces£driver = pipe £spaces£ £/spaces£command = "/usr/sbin/amavis <${sender_address}> ${pipe_addresses}" £spaces£ £/spaces£message_prefix = £spaces£ £/spaces£message_suffix = £spaces£ £/spaces£check_string = £spaces£ £/spaces£escape_string = # for debugging change return_output to true £spaces£ £/spaces£return_output = false £spaces£ £/spaces£return_path_add = false £spaces£ £/spaces£user = amavis £spaces£ £/spaces£group = mail £spaces£ £/spaces£path = "/bin:/sbin:/usr/bin:/usr/sbin" £spaces£ £/spaces£current_directory = "/var/amavis" spamcheck: £spaces£ £/spaces£driver = pipe £spaces£ £/spaces£command = /usr/sbin/exim -oMr spam-scanned -bS £spaces£ £/spaces£use_bsmtp = true £spaces£ £/spaces£transport_filter = "/usr/bin/spamc" £spaces£ £/spaces£home_directory = "/tmp" £spaces£ £/spaces£current_directory = "/tmp" £spaces£ £/spaces£user = Debian-exim £spaces£ £/spaces£group = Debian-exim £spaces£ £/spaces£log_output = true £spaces£ £/spaces£return_fail_output = true £spaces£ £/spaces£return_path_add = false £spaces£ £/spaces£message_prefix = £spaces£ £/spaces£message_suffix = virtual_local_md_delivery: £spaces£ £/spaces£driver = appendfile £spaces£ £/spaces£directory = /var/spool/virtual_mail/${lookup mysql {MYSQL_Q_BOXNAME}{$value}} £spaces£ £/spaces£create_directory £spaces£ £/spaces£delivery_date_add £spaces£ £/spaces£envelope_to_add £spaces£ £/spaces£return_path_add £spaces£ £/spaces£user = Debian-exim £spaces£ £/spaces£group = Debian-exim £spaces£ £/spaces£mode = 0660 £spaces£ £/spaces£directory_mode = 0770 £spaces£ £/spaces£quota = 5M £spaces£ £/spaces£quota_warn_threshold = 80% £spaces£ £/spaces£quota_warn_message = "\ £spaces£ £/spaces£To: $local_part@$domain\n\ £spaces£ £/spaces£Subject: Your mailbox at $domain\n\n\ £spaces£ £/spaces£This message is automatically created by the mail delivery software\n\ £spaces£ £/spaces£at $domain.\n\n\ £spaces£ £/spaces£The size of your mailbox has exceeded a warning threshold that is\n\ £spaces£ £/spaces£set by the system administrator. Please remove mails from your\n\ £spaces£ £/spaces£mailbox in order to avoid possible rejection of incoming mail.\n\n\ £spaces£ £/spaces£Feel free to contact our tech support if you encounter any problems.\n\n\ £spaces£ £/spaces£----------------------------------------------------------------\n\n\" vacation_autoreply: £spaces£ £/spaces£driver = autoreply £spaces£ £/spaces£to = ${sender_address} £spaces£ £/spaces£from = "vacation@${domain}" £spaces£ £/spaces£subject = "Absence du correspondant ${local_part}@${domain}" £spaces£ £/spaces£text = ${lookup mysql {MYSQL_Q_AWAYTEXT}{$value}} devnull_transport: £spaces£ £/spaces£driver = appendfile £spaces£ £/spaces£file = /dev/null £spaces£ £/spaces£user = Debian-exim ###################################################################### # RETRY CONFIGURATION # ###################################################################### begin retry # This single retry rule applies to all domains and all errors. It specifies # retries every 15 minutes for 2 hours, then increasing retry intervals, # starting at 1 hour and increasing each time by a factor of 1.5, up to 16 # hours, then retries every 6 hours until 4 days have passed since the first # failed delivery. # Domain Error Retries # ------ ----- ------- * * F,2h,15m; G,16h,1h,1.5; F,4d,6h ###################################################################### # REWRITE CONFIGURATION # ###################################################################### # There are no rewriting specifications in this default configuration file. begin rewrite ###################################################################### # AUTHENTICATION CONFIGURATION # ###################################################################### # There are no authenticator specifications in this default configuration file. begin authenticators fixed_plain: £spaces£ £/spaces£driver = plaintext £spaces£ £/spaces£public_name = PLAIN £spaces£ £/spaces£server_condition = ${lookup mysql{MYSQL_Q_AUTHPWD1}{1}fail} £spaces£ £/spaces£server_set_id = 2ドル fixed_login: £spaces£ £/spaces£driver = plaintext £spaces£ £/spaces£public_name = LOGIN £spaces£ £/spaces£server_prompts = "Username:: : Password::" £spaces£ £/spaces£server_condition = ${lookup mysql{MYSQL_Q_AUTHPWD2}{1}fail} £spaces£ £/spaces£server_set_id = 1ドル ###################################################################### # CONFIGURATION FOR local_scan() # ###################################################################### # If you have built Exim to include a local_scan() function that contains # tables for private options, you can define those options here. Remember to # uncomment the "begin" line. It is commented by default because it provokes # an error with Exim binaries that are not built with LOCAL_SCAN_HAS_OPTIONS # set in the Local/Makefile. # begin local_scan Evidemment si je met n'importe quoi comme quota dans transport, j'ai bien une erreur dans le exim4/main.log, mais si je respecte la doc j'ai aucune erreur, par contre il ne prend jamais en compte mon quota. Par exemple: smtp:/# authtest box1007 Authentication succeeded. Authenticated: box1007 (uid 102, gid 104) Home Directory: /var/spool/virtual_mail/ Maildir: box1007 Quota: (none) Encrypted Password: ULgsxCYFURSFQ Cleartext Password: (none) Options: (none) Bien sur, derriere aucun quota est pris en compte par les webmails etc . Je suis vraiment a court d'idée, une aide serait la bienvenue. Merci !