Bonjour,
C’est le premier message que je poste sur ce forum, je vais donc me présenter avant toute chose. Je m’appelle Loïc (Tit-LoW), et je suis développeur web (CakePHP pour les curieux). Je dispose d’un serveur KS sur débian 7. Bien entendu j’ai un domaine et un environnement web (apache2, php, mysql). Depuis quelques semaines je me lance dans la configuration d’un serveur mail postfix et dovecot. J’ai suivi pour ca ces deux tutoriels :
[ul]
[li]http://www.nicogiraud.com/blog/solution-complete-de-serveur-mail-sur-debian-sqeeze.html[/li]
[li]https://www.isalo.org/wiki.debian-fr/Configuration_d’un_serveur_mail_avec_Postfix#Utiliser_le_SMTP_de_Postfix[/li][/ul]
Le serveur envoi les mails sans trop de soucis (sauf qu’ils sont déclarés comme spam mais je m’y pencherai une fois mon vrai souci résolu). Le soucis, comme je l’ai mis dans le titre : Mon serveur de mail ne reçoit absolument aucun mail. Voici (dans un premier temps) les logs de démarrage et de réception de mails :
/etc/init.d/postfix restart :
Aug 1 13:03:29 {HOSTNAME} postfix/master[3444]: terminating on signal 15
Aug 1 13:03:30 {HOSTNAME} postfix/master[3735]: daemon started -- version 2.9.6, configuration /etc/postfix
/etc/init.d/dovecot restart
Aug 1 13:03:33 {HOSTNAME} dovecot: master: Warning: Killed with signal 15 (by pid=3766 uid=0 code=kill)
Aug 1 13:03:33 {HOSTNAME} dovecot: master: Dovecot v2.1.7 starting up (core dumps disabled)
Log après envoi du mail :
Aug 1 13:09:51 {HOSTNAME} postfix/smtpd[4150]: connect from mail-oa0-f41.google.com[209.85.219.41]
Aug 1 13:09:52 {HOSTNAME} postfix/trivial-rewrite[4156]: warning: do not list domain {DOMAIN} in BOTH mydestination and virtual_mailbox_domains
Aug 1 13:09:52 {HOSTNAME} postfix/smtpd[4150]: warning: unknown smtpd restriction: "premit_mynetwork"
Aug 1 13:09:52 {HOSTNAME} postfix/smtpd[4150]: NOQUEUE: reject: RCPT from mail-oa0-f41.google.com[209.85.219.41]: 451 4.3.5 Server configuration error; from=<{MON_GMAIL}@gmail.com> to=<loic@{DOMAIN}> proto=ESMTP helo=<mail-oa0-f41.google.com>
Aug 1 13:09:52 {HOSTNAME} postfix/cleanup[4158]: 26A54DFA34: message-id=<20140801110952.26A54DFA34@{KS_DOMAIN}>
Aug 1 13:09:52 {HOSTNAME} postfix/smtpd[4150]: disconnect from mail-oa0-f41.google.com[209.85.219.41]
Aug 1 13:09:52 {HOSTNAME} postfix/qmgr[3743]: 26A54DFA34: from=<double-bounce@{KS_DOMAIN}>, size=1286, nrcpt=1 (queue active)
Aug 1 13:09:52 {HOSTNAME} postfix/trivial-rewrite[4156]: warning: do not list domain {DOMAIN} in BOTH mydestination and virtual_mailbox_domains
Aug 1 13:09:52 {HOSTNAME} postfix/trivial-rewrite[4156]: warning: do not list domain {DOMAIN} in BOTH mydestination and virtual_mailbox_domains
Aug 1 13:09:52 {HOSTNAME} postfix/trivial-rewrite[4156]: warning: do not list domain {DOMAIN} in BOTH mydestination and virtual_mailbox_domains
Aug 1 13:09:52 {HOSTNAME} postfix/local[4160]: 26A54DFA34: to=<contact@{DOMAIN}>, orig_to=<postmaster>, relay=local, delay=0.09, delays=0.05/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to mailbox)
Aug 1 13:09:52 {HOSTNAME} postfix/qmgr[3743]: 26A54DFA34: removed
Aug 1 13:13:12 {HOSTNAME} postfix/anvil[4153]: statistics: max connection rate 1/60s for (smtp:209.85.219.41) at Aug 1 13:09:51
Aug 1 13:13:12 {HOSTNAME} postfix/anvil[4153]: statistics: max connection count 1 for (smtp:209.85.219.41) at Aug 1 13:09:51
Aug 1 13:13:12 {HOSTNAME} postfix/anvil[4153]: statistics: max cache size 1 at Aug 1 13:09:51
Aug 1 13:19:34 {HOSTNAME} postfix/smtpd[4624]: connect from mail-oi0-f48.google.com[209.85.218.48]
Aug 1 13:19:35 {HOSTNAME} postfix/trivial-rewrite[4630]: warning: do not list domain {DOMAIN} in BOTH mydestination and virtual_mailbox_domains
Aug 1 13:19:35 {HOSTNAME} postfix/smtpd[4624]: warning: unknown smtpd restriction: "premit_mynetwork"
Aug 1 13:19:35 {HOSTNAME} postfix/smtpd[4624]: NOQUEUE: reject: RCPT from mail-oi0-f48.google.com[209.85.218.48]: 451 4.3.5 Server configuration error; from=<{MON_GMAIL}@gmail.com> to=<loic@{DOMAIN}> proto=ESMTP helo=<mail-oi0-f48.google.com>
Aug 1 13:19:35 {HOSTNAME} postfix/cleanup[4632]: 57ABCDFA9D: message-id=<20140801111935.57ABCDFA9D@{KS_DOMAIN}>
Aug 1 13:19:35 {HOSTNAME} postfix/smtpd[4624]: disconnect from mail-oi0-f48.google.com[209.85.218.48]
Aug 1 13:19:35 {HOSTNAME} postfix/qmgr[3743]: 57ABCDFA9D: from=<double-bounce@{KS_DOMAIN}>, size=1286, nrcpt=1 (queue active)
Aug 1 13:19:35 {HOSTNAME} postfix/trivial-rewrite[4630]: warning: do not list domain {DOMAIN} in BOTH mydestination and virtual_mailbox_domains
Aug 1 13:19:35 {HOSTNAME} postfix/trivial-rewrite[4630]: warning: do not list domain {DOMAIN} in BOTH mydestination and virtual_mailbox_domains
Aug 1 13:19:35 {HOSTNAME} postfix/trivial-rewrite[4630]: warning: do not list domain {DOMAIN} in BOTH mydestination and virtual_mailbox_domains
Aug 1 13:19:35 {HOSTNAME} postfix/local[4634]: 57ABCDFA9D: to=<contact@{DOMAIN}>, orig_to=<postmaster>, relay=local, delay=0.09, delays=0.05/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to mailbox)
Aug 1 13:19:35 {HOSTNAME} postfix/qmgr[3743]: 57ABCDFA9D: removed
Je vous met maintenant ma petite configuration postfix : (postconf -n)
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
dovecot_destination_recipient_limit = 1
inet_interfaces = all
mailbox_size_limit = 0
mydestination = {DOMAIN}, {KS_DOMAIN}, {LOCALHOST}, localhost
myhostname = {KS_DOMAIN}
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_client_restrictions = premit_mynetwork, permit_sasl_authenticated, sleep , reject_unauth_pipelining
smtpd_helo_restrictions = reject_invalid_helo_hostname
smtpd_recipient_restrictions = reject_unlisted_recipient, reject_unknown_recipient_domain, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unlisted_sender, reject_unknown_sender_domain, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_sender
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
Le fichier /etc/postfix/mysql-virtual-alias-maps.cf :
user = mails
password = ********
hosts = 127.0.0.1
dbname = mails
query = SELECT destination FROM virtual_aliases WHERE source='%s'
Le fichier /etc/postfix/mysql-virtual-mailbox-domains.cf :
user = mails
password = ********
hosts = 127.0.0.1
dbname = mails
query = SELECT 1 FROM virtual_domains WHERE name='%s'
Le fichier /etc/postfix/mysql-virtual-mailbox-maps.cf :
user = mails
password = ********
hosts = 127.0.0.1
dbname = mails
query = SELECT 1 FROM virtual_users WHERE email='%s'
Le fichier SQL qui m’a servi à générer les tables :
[code]CREATE TABLE IF NOT EXISTS virtual_aliases
(
id
int(11) NOT NULL,
domain_id
int(11) NOT NULL,
source
varchar(100) NOT NULL,
destination
varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS virtual_domains
(
id
int(11) NOT NULL,
name
varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS virtual_users
(
id
int(11) NOT NULL,
domain_id
int(11) NOT NULL,
password
varchar(32) NOT NULL,
email
varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;[/code]
Et pour finir la configuration de dovecot (dovecot -n)
[code]# 2.1.7: /etc/dovecot/dovecot.conf
OS: Linux 3.10.23-xxxx-std-ipv6-64 x86_64 ext4
disable_plaintext_auth = no
mail_location = maildir:/home/vmail/%d/%n/Maildir
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox “Sent Messages” {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
protocols = imap pop3 imap pop3
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
}
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
driver = static
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
log_path =
mail_plugins = sieve
postmaster_address = contact@{DOMAIN}
}
[/code]
Ainsi que son fichier SQL :
driver = mysql
connect = host=127.0.0.1 dbname=mails user=mails password=********
default_pass_scheme = PLAIN-MD5
password_query = SELECT email as user, password FROM virtual_users WHERE email='%u'
J’espère avoir été suffisamment précis et je vous remercie d’avance…