- Sur une première machine qui est publique sur internet :
smtpd_auth: dovecot smtpd_domains: "mirari.fr": "[limestone]" "un-autre-domaine.fr": "[limestone]" smtpd_ssl: true
- Sur une seconde machine située dans un réseau privé derrière la première :
smtpd_auth: dovecot smtpd_dkim: true smtpd_domains: "mirari.fr": "@virtual" "un-autre-domaine.fr": "@virtual" smtpd_sqld: true smtpd_ssl: true smtpd_virtual: dovecot
- Le fichier main.cf (désolé pour l'indentation, c'est prévu pour 1 tab = 4 espaces) :
# Configuration variables
compatibility_level = 2
map_directory = ${config_directory}/map
sql_directory = ${config_directory}/sql
ssl_directory = ${config_directory}/ssl
# System configuration
smtp_host_lookup = dns,native
# Mailer daemon
inet_interfaces = all
inet_protocols = all
smtpd_banner = {{ hostname }}.{{ domain }} ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
recipient_delimiter = +
smtputf8_enable = yes
# TLS support
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
{% if smtpd_ssl is defined %}
smtpd_tls_security_level = may
smtpd_tls_cert_file = ${ssl_directory}/fr.mirari.smtp.pem
smtpd_tls_key_file = ${ssl_directory}/fr.mirari.smtp.key
smtpd_tls_CAfile = {{ ssl.public }}
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
{% else %}
smtpd_tls_security_level = none
{% endif %}
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
{% if smtpd_sqld is defined %}
check_recipient_access mysql:${sql_directory}/check.cf,
{% endif %}
reject_unauth_destination,
reject_unverified_recipient,
reject_rbl_client zen.spamhaus.org,
reject_rbl_client cbl.abuseat.org
smtpd_sender_restrictions =
reject_unknown_sender_domain
# SASL authentication
#smtp_sasl_auth_enable = yes
#smtp_sasl_password_maps = hash:${config_directory}/sasl_passwd
#smtp_sasl_security_options = noplaintext,noanonymous
{% if (smtpd_auth | default('')) == 'dovecot' %}
# http://wiki2.dovecot.org/HowTo/PostfixAndDovecotSASL
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
{% if smtpd_ssl is defined %}
smtpd_tls_auth_only = yes
{% endif %}
{% endif %}
#header_checks = regexp:${config_directory}/header_checks
{% if smtpd_dkim is defined %}
# DKIM signature
milter_default_action = accept
milter_protocol = 6
smtpd_milters = unix:{{ dkim.socket }}
non_smtpd_milters = unix:{{ dkim.socket }}
{% endif %}
# Server configuration
mydestination =
mydomain = {{ domain }}
myhostname = {{ hostname }}.$mydomain
myorigin = $mydomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 {{ network }}
mynetworks_style = host
# Transport configuration (transport per domain)
transport_maps = hash:${map_directory}/transport
# Relay configuration (accepted domains and relay hosts)
sender_dependent_relayhost_maps = hash:${map_directory}/relay_from
relay_domains = ${map_directory}/relay_to
{% if '@local' in smtpd_domains.itervalues () %}
# Local delivery
alias_maps = hash:/etc/aliases
home_mailbox = .maildir/
mailbox_size_limit = 1073741824
message_size_limit = 102400000
{% else %}
# Disable local delivery
local_recipient_maps =
local_transport = error:local delivery is disabled
{% endif %}
{% if '@virtual' in smtpd_domains.itervalues () %}
# Virtual delivery
{% if (smtpd_virtual | default('')) == 'dovecot' %}
# http://wiki2.dovecot.org/HowTo/PostfixDovecotLMTP
virtual_transport = lmtp:unix:private/dovecot-lmtp
{% endif %}
virtual_alias_domains = mysql:${sql_directory}/forward_domain.cf
virtual_alias_maps = mysql:${sql_directory}/forward_map.cf
virtual_mailbox_domains = mysql:${sql_directory}/mailbox_domain.cf
{% endif %}
Hésite pas à demander si tu as des questions ou que tu veux voir l'un des fichiers liés (je n'ai pas tout posté parce qu'il y en a une tripotée, celui-ci est le plus important)