setup:mx_v2
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| setup:mx_v2 [2018/08/17 10:35] – [SQL] root | setup:mx_v2 [2020/11/27 15:01] (current) – [MX Setup] root | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== MX Setup ====== | ====== MX Setup ====== | ||
| + | |||
| + | | ||
| ===== Environment Setup ===== | ===== Environment Setup ===== | ||
| Line 40: | Line 42: | ||
| <code bash> | <code bash> | ||
| + | cat > / | ||
| + | user = mail_admin | ||
| + | password = mail_admin_password | ||
| + | dbname = mail | ||
| + | query = SELECT destination FROM forwardings WHERE source=' | ||
| + | hosts = 127.0.0.1 | ||
| + | EOF | ||
| + | |||
| + | cat > / | ||
| + | user = mail_admin | ||
| + | password = mail_admin_password | ||
| + | dbname = mail | ||
| + | query = SELECT domain AS virtual FROM domains WHERE domain=' | ||
| + | hosts = 127.0.0.1 | ||
| + | EOF | ||
| + | |||
| + | cat > / | ||
| + | user = mail_admin | ||
| + | password = mail_admin_password | ||
| + | dbname = mail | ||
| + | query = SELECT destination FROM forwardings WHERE source=' | ||
| + | hosts = 127.0.0.1 | ||
| + | EOF | ||
| + | |||
| + | cat > / | ||
| + | user = mail_admin | ||
| + | password = mail_admin_password | ||
| + | dbname = mail | ||
| + | query = SELECT CONCAT(SUBSTRING_INDEX(email,' | ||
| + | hosts = 127.0.0.1 | ||
| + | EOF | ||
| + | |||
| + | cat > / | ||
| + | user = mail_admin | ||
| + | password = mail_admin_password | ||
| + | dbname = mail | ||
| + | query = SELECT email FROM users WHERE email=' | ||
| + | hosts = 127.0.0.1 | ||
| + | EOF | ||
| + | |||
| + | cat > / | ||
| + | user = mail_admin | ||
| + | password = mail_admin_password | ||
| + | dbname = mail | ||
| + | query = SELECT transport FROM transport WHERE domain=' | ||
| + | hosts = 127.0.0.1 | ||
| + | EOF | ||
| + | |||
| + | cat > / | ||
| + | user = mail_admin | ||
| + | password = mail_admin_password | ||
| + | dbname = mail | ||
| + | query = SELECT quota FROM users WHERE email=' | ||
| + | hosts = 127.0.0.1 | ||
| + | EOF | ||
| + | |||
| chmod o= / | chmod o= / | ||
| chgrp postfix / | chgrp postfix / | ||
| Line 47: | Line 105: | ||
| < | < | ||
| apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-lmtpd dovecot-mysql | apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-lmtpd dovecot-mysql | ||
| + | </ | ||
| + | |||
| + | FIXME | ||
| + | |||
| + | < | ||
| + | # See / | ||
| + | |||
| + | smtpd_banner = $myhostname ESMTP $mail_name (Cray Linux Environment) | ||
| + | biff = no | ||
| + | |||
| + | # appending .domain is the MUA's job. | ||
| + | append_dot_mydomain = no | ||
| + | |||
| + | # Uncomment the next line to generate " | ||
| + | # | ||
| + | |||
| + | readme_directory = no | ||
| + | |||
| + | # Server TLS parameters | ||
| + | smtpd_tls_cert_file = / | ||
| + | smtpd_tls_key_file = / | ||
| + | smtpd_use_tls = yes | ||
| + | smtpd_tls_session_cache_database = btree: | ||
| + | smtpd_tls_dh1024_param_file = / | ||
| + | |||
| + | # Send TLS parameters | ||
| + | smtp_tls_cert_file = $smtpd_tls_cert_file | ||
| + | smtp_tls_key_file = $smtpd_tls_key_file | ||
| + | smtp_use_tls = $smtpd_use_tls | ||
| + | smtp_tls_session_cache_database = btree: | ||
| + | smtp_tls_security_level = may | ||
| + | |||
| + | # Disable ssl compression (postfix >=2.11) | ||
| + | # | ||
| + | |||
| + | # Secure cipherlist setup | ||
| + | tls_preempt_cipherlist = yes | ||
| + | smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3 | ||
| + | smtpd_tls_protocols = $smtpd_tls_mandatory_protocols | ||
| + | smtp_tls_mandatory_protocols = $smtpd_tls_mandatory_protocols | ||
| + | smtp_tls_protocols = $smtpd_tls_mandatory_protocols | ||
| + | |||
| + | smtpd_tls_mandatory_ciphers = high | ||
| + | smtpd_tls_ciphers = $smtpd_tls_mandatory_ciphers | ||
| + | smtp_tls_mandatory_ciphers = $smtpd_tls_mandatory_ciphers | ||
| + | smtp_tls_ciphers = $smtpd_tls_mandatory_ciphers | ||
| + | |||
| + | smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5, aEDH, RC4, eNULL, DES, 3DES | ||
| + | smtpd_tls_exclude_ciphers = $smtpd_tls_mandatory_exclude_ciphers | ||
| + | smtp_tls_mandatory_exclude_ciphers = $smtpd_tls_mandatory_exclude_ciphers | ||
| + | smtp_tls_exclude_ciphers = $smtpd_tls_mandatory_exclude_ciphers | ||
| + | |||
| + | # See / | ||
| + | # information on enabling SSL in the smtp client. | ||
| + | |||
| + | myhostname = < | ||
| + | |||
| + | alias_maps = hash:/ | ||
| + | alias_database = hash:/ | ||
| + | |||
| + | myorigin = / | ||
| + | mydestination = arwen.luthienstar.fr, | ||
| + | relayhost = | ||
| + | mynetworks = 127.0.0.0/8 | ||
| + | mailbox_command = procmail -a " | ||
| + | mailbox_size_limit = 0 | ||
| + | recipient_delimiter = + | ||
| + | inet_interfaces = all | ||
| + | inet_protocols = all | ||
| + | message_size_limit = 30720000 | ||
| + | virtual_alias_maps = proxy: | ||
| + | virtual_mailbox_domains = proxy: | ||
| + | virtual_mailbox_maps = proxy: | ||
| + | virtual_mailbox_base = /home/vmail | ||
| + | virtual_uid_maps = static:5000 | ||
| + | virtual_gid_maps = static:5000 | ||
| + | |||
| + | # Security | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | smtpd_sasl_auth_enable = yes | ||
| + | broken_sasl_auth_clients = yes | ||
| + | smtpd_sasl_authenticated_header = yes | ||
| + | smtpd_recipient_restrictions = reject_invalid_hostname, | ||
| + | transport_maps = proxy: | ||
| + | proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks | ||
| + | |||
| + | # | ||
| + | |||
| + | milter_default_action = accept | ||
| + | milter_protocol = 6 | ||
| + | milter_command_timeout = 60s | ||
| + | |||
| + | smtpd_milters = unix:/ | ||
| + | non_smtpd_milters = unix:/ | ||
| + | |||
| + | virtual_transport = maildrop | ||
| + | maildrop_destination_recipient_limit = 1 | ||
| + | |||
| </ | </ | ||
| ===== Dovecot-lda ===== | ===== Dovecot-lda ===== | ||
| + | FIXME Config Sieve | ||
| + | < | ||
| + | require " | ||
| + | require " | ||
| + | require " | ||
| + | require " | ||
| + | require " | ||
| + | if header :contains " | ||
| + | fileinto " | ||
| + | } | ||
| + | |||
| + | if envelope :detail :matches " | ||
| + | set :lower :upperfirst " | ||
| + | if mailboxexists " | ||
| + | fileinto " | ||
| + | } else { | ||
| + | fileinto :create " | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| ===== SPF Milter ===== | ===== SPF Milter ===== | ||
setup/mx_v2.1534494918.txt.gz · Last modified: 2018/08/17 10:35 by root