Update of dovecot version
This commit is contained in:
4 files changed
+95
-87
No files matched your search
@@ -1,12 +0,0 @@
|
||||
connect = host=localhost dbname=postfix user=postfix password=YOUR_PASSWORD
|
||||
|
||||
map {
|
||||
pattern = shared/last-login/$user
|
||||
table = mailbox
|
||||
value_field = last_login
|
||||
value_type = uint
|
||||
|
||||
fields {
|
||||
username = $user
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
connect = host=localhost dbname=postfix user=postfix_readonly password=YOUR_PASSWORD
|
||||
driver = mysql
|
||||
|
||||
# Query to retrieve password. user can be used to retrieve username in other formats also.
|
||||
password_query = SELECT username AS user, CONCAT(password_hash_type, password) AS password, CONCAT(domain, '/', local_part, '/') AS maildir, 5000 AS userdb_uid, 5000 AS userdb_gid, CONCAT('*:bytes=', quota) AS userdb_quota_rule FROM mailbox WHERE username = CONCAT('%n', '@', COALESCE((SELECT target_domain FROM alias_domain WHERE alias_domain = '%d' AND active='1'), '%d')) AND active='1'
|
||||
|
||||
# Query to retrieve user information, note uid matches dovecot.conf AND Postfix virtual_uid_maps parameter.
|
||||
user_query = SELECT CONCAT(domain, '/', local_part, '/') AS maildir, 5000 AS uid, 5000 AS gid, CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = CONCAT('%n', '@', COALESCE((SELECT target_domain FROM alias_domain WHERE alias_domain = '%d' AND active='1'), '%d')) AND active='1'
|
||||
|
||||
iterate_query = SELECT username AS user FROM mailbox
|
||||
+95
-64
@@ -1,83 +1,100 @@
|
||||
#general settings
|
||||
dovecot_config_version = 2.4.0
|
||||
dovecot_storage_version = 2.4.0
|
||||
listen = *, ::
|
||||
login_greeting = Server ready.
|
||||
mmap_disable = yes
|
||||
mail_fsync = always
|
||||
mail_nfs_index = yes
|
||||
mail_nfs_storage = yes
|
||||
info_log_path = /dev/null
|
||||
auth_verbose = no
|
||||
auth_verbose_passwords = no
|
||||
auth_debug = no
|
||||
auth_debug_passwords = no
|
||||
mail_debug = no
|
||||
verbose_ssl = no
|
||||
mail_location = maildir:/var/mail/vmail/%d/%n
|
||||
mail_home = /var/mail/vmail/%d/%n
|
||||
mail_plugins = mail_crypt quota zlib
|
||||
mail_driver = maildir
|
||||
mail_path = /var/mail/vmail/%{user | domain}/%{user | username}
|
||||
mail_home = /var/mail/vmail/%{user | domain}/%{user | username}
|
||||
mail_plugins {
|
||||
mail_compress = yes
|
||||
mail_crypt = yes
|
||||
}
|
||||
mailbox_list_index = yes
|
||||
mail_always_cache_fields = date.save
|
||||
imap_hibernate_timeout = 5s
|
||||
mail_attribute_dict = file:%h/dovecot-attributes
|
||||
|
||||
#plugin setup
|
||||
plugin {
|
||||
mail_crypt_save_version = 2
|
||||
mail_crypt_global_private_key = </etc/dovecot/ecprivkey.pem
|
||||
mail_crypt_global_public_key = </etc/dovecot/ecpubkey.pem
|
||||
zlib_save = gz
|
||||
zlib_save_level = 6
|
||||
quota_grace = 10%%
|
||||
quota_status_success = DUNNO
|
||||
quota_status_nouser = DUNNO
|
||||
quota_status_overquota = "552 5.2.2 Mailbox is full"
|
||||
quota = count:User quota
|
||||
quota_rule = *:bytes=50M
|
||||
quota_vsizes = yes
|
||||
last_login_dict = proxy::lastlogin
|
||||
last_login_key = last-login/%u
|
||||
sieve = file:~/sieve;active=~/.dovecot.sieve
|
||||
sieve_plugins = sieve_imapsieve
|
||||
imapsieve_url = sieve://danwin1210.de
|
||||
mail_attribute {
|
||||
dict file {
|
||||
path = %{home}/dovecot-attributes
|
||||
}
|
||||
}
|
||||
crypt_global_private_key main {
|
||||
crypt_private_key_file = /etc/dovecot/ecprivkey.pem
|
||||
}
|
||||
crypt_global_public_key_file = /etc/dovecot/ecpubkey.pem
|
||||
mail_compress_write_method = gz
|
||||
|
||||
# sieve = file:~/sieve;active=~/.dovecot.sieve
|
||||
sieve_script personal {
|
||||
driver = file
|
||||
path = ~/sieve
|
||||
active_path = ~/.dovecot.sieve
|
||||
}
|
||||
# sieve_plugins = sieve_imapsieve
|
||||
sieve_plugins {
|
||||
sieve_imapsieve = yes
|
||||
}
|
||||
imapsieve_url = sieve://danwin1210.de
|
||||
#}
|
||||
|
||||
#auth settings
|
||||
disable_plaintext_auth = yes
|
||||
auth_cache_size = 1M
|
||||
auth_cache_ttl = 5mins
|
||||
auth_cache_negative_ttl = 5mins
|
||||
auth_default_realm = danwin1210.de
|
||||
auth_default_domain = danwin1210.de
|
||||
auth_username_chars =
|
||||
auth_mechanisms = plain login
|
||||
auth_allow_weak_schemes = yes
|
||||
|
||||
#TLS parameters
|
||||
ssl = required
|
||||
ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key
|
||||
ssl_server_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
ssl_server_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
|
||||
ssl_client_ca_dir = /etc/ssl/certs
|
||||
ssl_dh = </etc/dovecot/dh.pem
|
||||
ssl_server_dh_file = /etc/dovecot/dh.pem
|
||||
ssl_min_protocol = TLSv1.2
|
||||
ssl_cipher_list = HIGH:!PSK:!aNULL:!MD5:!SHA:!CAMELLIA:!AES+SHA256:!AES+SHA384;
|
||||
ssl_curve_list = X448:X25519:secp521r1:secp384r1
|
||||
ssl_prefer_server_ciphers = yes
|
||||
ssl_server_prefer_ciphers = server
|
||||
|
||||
#protocol setup
|
||||
protocols = "imap pop3 lmtp sieve"
|
||||
protocol imap {
|
||||
mail_plugins = $mail_plugins imap_quota imap_zlib imap_sieve last_login
|
||||
mail_plugins {
|
||||
imap_sieve = yes
|
||||
last_login = yes
|
||||
}
|
||||
imap_metadata = yes
|
||||
}
|
||||
protocol pop3 {
|
||||
mail_plugins {
|
||||
last_login = yes
|
||||
}
|
||||
imap_metadata = yes
|
||||
}
|
||||
protocol lmtp {
|
||||
mail_plugins = mail_crypt quota zlib sieve last_login
|
||||
mail_plugins {
|
||||
sieve = yes
|
||||
}
|
||||
}
|
||||
protocol sieve {
|
||||
mail_plugins =
|
||||
mail_plugins {
|
||||
last_login = yes
|
||||
}
|
||||
}
|
||||
#service setup
|
||||
service anvil {
|
||||
unix_listener anvil-auth-penalty {
|
||||
#disable since we don't have IP info
|
||||
mode = 0
|
||||
unix_listener anvil {
|
||||
mode = 0666
|
||||
}
|
||||
}
|
||||
service auth {
|
||||
@@ -92,7 +109,7 @@ service auth {
|
||||
group = postfix
|
||||
}
|
||||
|
||||
inet_listener {
|
||||
inet_listener auth-port {
|
||||
port = 12345
|
||||
}
|
||||
|
||||
@@ -108,17 +125,17 @@ service auth-worker {
|
||||
}
|
||||
}
|
||||
service imap {
|
||||
service_count = 1000
|
||||
service_restart_request_count = 1000
|
||||
client_limit = 1
|
||||
unix_listener imap-master {
|
||||
user = $default_internal_user
|
||||
user = dovecot
|
||||
}
|
||||
}
|
||||
service imap-login {
|
||||
inet_listener imap {
|
||||
port = 143
|
||||
}
|
||||
service_count = 1000
|
||||
service_restart_request_count = 1000
|
||||
vsz_limit = 1G
|
||||
process_min_avail = 1
|
||||
}
|
||||
@@ -132,40 +149,25 @@ service lmtp {
|
||||
group = vmail
|
||||
}
|
||||
service pop3 {
|
||||
service_count = 1000
|
||||
service_restart_request_count = 1000
|
||||
client_limit = 1
|
||||
}
|
||||
service pop3-login {
|
||||
inet_listener pop3 {
|
||||
port = 110
|
||||
}
|
||||
service_count = 1000
|
||||
service_restart_request_count = 1000
|
||||
vsz_limit = 1G
|
||||
}
|
||||
service quota-status {
|
||||
executable = quota-status -p postfix
|
||||
inet_listener quota-status {
|
||||
port = 12340
|
||||
}
|
||||
client_limit = 1
|
||||
}
|
||||
|
||||
#SQL queries
|
||||
passdb {
|
||||
passdb sql {
|
||||
driver = sql
|
||||
args = /etc/dovecot/dovecot-sql.conf.ext
|
||||
query = SELECT username AS user, CONCAT(password_hash_type, password) AS password, 5000 AS userdb_uid, 5000 AS userdb_gid, CONCAT('*:bytes=', quota) AS userdb_quota_rule FROM mailbox WHERE username = CONCAT('%{user | username}', '@', COALESCE((SELECT target_domain FROM alias_domain WHERE alias_domain = '%{user | domain}' AND active='1'), '%{user | domain}')) AND active='1'
|
||||
}
|
||||
userdb {
|
||||
driver = prefetch
|
||||
}
|
||||
userdb {
|
||||
userdb sql {
|
||||
driver = sql
|
||||
args = /etc/dovecot/dovecot-sql.conf.ext
|
||||
}
|
||||
dict {
|
||||
lastlogin = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
|
||||
user = dovecot
|
||||
group = dovecot
|
||||
query = SELECT 5000 AS uid, 5000 AS gid, CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = CONCAT('%{user | username}', '@', COALESCE((SELECT target_domain FROM alias_domain WHERE alias_domain = '%{user | domain}' AND active='1'), '%{user | domain}')) AND active='1'
|
||||
iterate_query = SELECT username AS user FROM mailbox
|
||||
}
|
||||
|
||||
#namespace configuration
|
||||
@@ -192,3 +194,32 @@ namespace inbox {
|
||||
special_use = \Sent
|
||||
}
|
||||
}
|
||||
mysql localhost {
|
||||
dbname=postfix
|
||||
user=postfix
|
||||
password=YOUR_PASSWORD
|
||||
}
|
||||
sql_driver = mysql
|
||||
|
||||
last_login {
|
||||
dict proxy {
|
||||
name = sql
|
||||
}
|
||||
key = last-login/%{user}
|
||||
precision = s
|
||||
}
|
||||
|
||||
dict_server {
|
||||
dict sql {
|
||||
dict_map shared/last-login/$user {
|
||||
sql_table = mailbox
|
||||
value_field last_login {
|
||||
type = uint
|
||||
}
|
||||
|
||||
key_field username {
|
||||
value = $user
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
require_once 'vendor/autoload.php';
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\SMTP;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
const DBHOST = 'localhost'; // Database host
|
||||
const DBUSER = 'postfix_readonly'; // Database user
|
||||
|
||||
Reference in new issue
Block a user