• Serveurs
  • [Discussion] Installer un serveur de mail avec Postfix et Dovecot

En ayant marre de voir mes courriels ne pas être acheminer par Microsoft sur leurs divers domaines, j'ai décidé de leur envoyer un rapport.

Voici leur réponse :
Conditionally mitigated
XX.XX.XX.XX
Our investigation has determined that the above IP(s) qualify for conditional mitigation. These IP(s) have been unblocked, but may be subject to low daily email limits until they have established a good reputation.

Please note that mitigating this issue does not guarantee that your email will be delivered to a user’s inbox.

Ongoing complaints from users will result in removal of the mitigation.
Je leur ai précisé que selon ce site, je ne figurais pourtant dans aucune BDD fâcheuse...

Leur hégémonie me dégoûte de plus en plus, et me donne un peu plus l'envie de me passer de leurs services.

Et vous, vous en êtes où ?
Avec les fachos du net ?
Rien à espérer d'eux.
tu es chez quel hébergeur @arckosfr ?
scaleway aka online
la roulette russe quoi
Ok, en tout cas quand on fait du mail il y a vraiment des hébergeurs à éviter, genre les offres grand publique comme Kimsufi & co.
@arckosfr tes mails arrivent directement en boite de reception ou en spam sur hotmail ?

thanks
Salut,

J'ai ces deux erreurs dans mon syslog
Nov 17 00:18:51 www kernel: opendmarc[7599]: segfault at 8 ip 0000000000407684 sp 00007094665c3ec0 error 4 in opendmarc[400000+10000]
Nov 17 00:18:51 www kernel: grsec: From IP.DE.MON.FAI: Segmentation fault occurred at 0000000000000008 in /usr/sbin/opendmarc[opendmarc:7599] uid/euid:118/118 gid/egid:125/125, parent /usr/sbin/opendmarc[opendmarc:7593] uid/euid:118/118 gid/egid:125/125
Une idée ?

Merci
en boite de réception, apres n'ayant pas de ".hotmail" j'avais tester sur une boite outlook microsoft, qui passe par leurs messagerie, si tu veux je peu t'envoyé un mail et tu pourras voir
Bonjour suite à ce Tutoriel (Serveur Mail) et à l'utilisation du script d'installation (vachement pratique merci beaucoup, je ne suis jamais allé aussi loin dans l'installation du serveur mail) j'ai un petit soucis.

En gros tout à l'air OK, sauf 1 truc : le SMTP en SSL
Voici un screenshot de l'ecran test dans RainLoop (je ne connaissais pas, il à l'air super) :


Et ici, le rapport généré par le script de dépannage
### Rapport pour Mail généré le 17-11-2015 à 10:30

Kernel : 3.16.0-4-amd64

...................................
## Check Ports                  ##
...................................
25 :
0.0.0.0:25 13530/master
110 :

143 :
0.0.0.0:143 13538/dovecot
587 :
0.0.0.0:587 13530/master
993 :
0.0.0.0:993 13538/dovecot
995 :

4190 :
0.0.0.0:4190 13538/dovecot

...................................
## Check Softs                   ##
...................................
Le programme postfix est installé
Le programme postfix-mysql est installé
Le programme dovecot-core est installé
Le programme dovecot-imapd est installé
Le programme dovecot-lmtpd est installé
Le programme dovecot-mysql est installé
Le programme dovecot-sieve est installé
Le programme dovecot-managesieved est installé
Le programme opendkim est installé
Le programme opendkim-tools est installé
Le programme opendmarc est installé
Le programme spamassassin est installé
Le programme spamc est installé

...................................
## OpenDKIM Confs               ##
...................................

##### ----------- File : /etc/opendkim.conf -----------------------------------------------------------------------------------------------------------------------------

AutoRestart             Yes
AutoRestartRate         10/1h
UMask                   002
Syslog                  Yes
SyslogSuccess           Yes
LogWhy                  Yes

OversignHeaders         From
AlwaysAddARHeader       Yes

Canonicalization        relaxed/simple

ExternalIgnoreList      refile:/etc/opendkim/TrustedHosts
InternalHosts           refile:/etc/opendkim/TrustedHosts
KeyTable                refile:/etc/opendkim/KeyTable
SigningTable            refile:/etc/opendkim/SigningTable

Mode                    sv
PidFile                 /var/run/opendkim/opendkim.pid
SignatureAlgorithm      rsa-sha256

UserID                  opendkim:opendkim

Socket                  local:/var/spool/postfix/opendkim/opendkim.sock

##### ----------- File : /etc/opendkim/TrustedHosts -----------------------------------------------------------------------------------------------------------------------------

127.0.0.1
localhost
::1
*.antarka.com

##### ----------- File : /etc/opendkim/KeyTable -----------------------------------------------------------------------------------------------------------------------------

mail._domainkey.antarka.com antarka.com:mail:/etc/opendkim/keys/antarka.com/mail.private

##### ----------- File : /etc/opendkim/SigningTable -----------------------------------------------------------------------------------------------------------------------------

*@antarka.com mail._domainkey.antarka.com

##### ----------- File : /etc/opendmarc.conf -----------------------------------------------------------------------------------------------------------------------------

AutoRestart             Yes
AutoRestartRate         10/1h
UMask                   0002
Syslog                  true

AuthservID              "sd-79585.antarka.com"
TrustedAuthservIDs      "sd-79585.antarka.com"
IgnoreHosts             /etc/opendkim/TrustedHosts

RejectFailures          false

UserID                  opendmarc:opendmarc
PidFile                 /var/run/opendmarc.pid
Socket                  local:/var/spool/postfix/opendmarc/opendmarc.sock

...................................
## DoveCot Confs                ##
...................................

##### ----------- File : /etc/dovecot/dovecot.conf -----------------------------------------------------------------------------------------------------------------------------

!include_try /usr/share/dovecot/protocols.d/*.protocol
protocols = imap lmtp sieve
listen = *
!include conf.d/*.conf

##### ----------- File : /etc/dovecot/dovecot-sql.conf.ext -----------------------------------------------------------------------------------------------------------------------------

# Paramètres de connexion
driver = mysql
connect = host=127.0.0.1 dbname=postfix user=postfix password=monpass

# Permet de définir l'algorithme de hachage.
# Pour plus d'information: http://wiki2.dovecot.org/Authentication/PasswordSchemes
# /!\ ATTENTION : ne pas oublier de modifier le paramètre $CONF['encrypt'] de PostfixAdmin
default_pass_scheme = MD5-CRYPT

# Requête de récupération du mot de passe du compte utilisateur
password_query = SELECT password FROM mailbox WHERE username = '%u'

##### ----------- File : /etc/dovecot/conf.d/auth-sql.conf.ext -----------------------------------------------------------------------------------------------------------------------------

passdb {
  driver = sql
  args = /etc/dovecot/dovecot-sql.conf.ext
}

userdb {
  driver = static
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
}

##### ----------- File : /etc/dovecot/conf.d/10-auth.conf -----------------------------------------------------------------------------------------------------------------------------

disable_plaintext_auth = yes
auth_mechanisms = plain login
!include auth-sql.conf.ext

##### ----------- File : /etc/dovecot/conf.d/10-mail.conf -----------------------------------------------------------------------------------------------------------------------------

mail_location = maildir:/var/mail/vhosts/%d/%n/mail
maildir_stat_dirs=yes

namespace inbox {
    inbox = yes
}

mail_uid = 5000
mail_gid = 5000

first_valid_uid = 5000
last_valid_uid = 5000

mail_privileged_group = vmail

##### ----------- File : /etc/dovecot/conf.d/10-master.conf -----------------------------------------------------------------------------------------------------------------------------

service imap-login {

    inet_listener imap {
        port = 143
    }

    inet_listener imaps {
        port = 993
        ssl = yes
    }

    service_count = 0

}

service imap {

}

service lmtp {

    unix_listener /var/spool/postfix/private/dovecot-lmtp {
        mode = 0600
        user = postfix
        group = postfix
    }

}

service auth {

    unix_listener /var/spool/postfix/private/auth {
        mode = 0666
        user = postfix
        group = postfix
    }

    unix_listener auth-userdb {
        mode = 0600
        user = vmail
        group = vmail
    }

    user = dovecot

}

service auth-worker {

    user = vmail

}

##### ----------- File : /etc/dovecot/conf.d/10-ssl.conf -----------------------------------------------------------------------------------------------------------------------------

ssl = required
ssl_cert = </etc/ssl/certs/mailserver_dovecot.crt
ssl_key = </etc/ssl/private/mailserver_dovecot.key
ssl_protocols = !SSLv2 !SSLv3
ssl_cipher_list = ALL:!aNULL:!eNULL:!LOW:!MEDIUM:!EXP:!RC2:!RC4:!DES:!3DES:!MD5:!PSK:!SRP:!DSS:!AECDH:!ADH:@STRENGTH
ssl_prefer_server_ciphers = yes
ssl_dh_parameters_length = 2048

##### ----------- File : /etc/dovecot/conf.d/20-lmtp.conf -----------------------------------------------------------------------------------------------------------------------------

protocol lmtp {

  postmaster_address = postmaster@antarka.com
  mail_plugins =  sieve

}

##### ----------- File : /etc/dovecot/conf.d/90-sieve.conf -----------------------------------------------------------------------------------------------------------------------------

plugin {

    sieve = /var/mail/vhosts/%d/%n/.dovecot.sieve
    sieve_default = /var/mail/sieve/default.sieve
    sieve_dir = /var/mail/vhosts/%d/%n/sieve
    sieve_global_dir = /var/mail/sieve

}

...................................
## PostFix Confs                ##
...................................

##### ----------- File : /etc/postfix/main.cf -----------------------------------------------------------------------------------------------------------------------------

#######################
## GENERALS SETTINGS ##
#######################

smtpd_banner         = $myhostname ESMTP $mail_name (Debian/GNU)
biff                 = no
append_dot_mydomain  = no
readme_directory     = no
delay_warning_time   = 4h
mailbox_command      = procmail -a "$EXTENSION"
recipient_delimiter  = +
disable_vrfy_command = yes
message_size_limit   = 502400000
mailbox_size_limit   = 1024000000

inet_interfaces = all
inet_protocols = ipv4

myhostname    = sd-79585.antarka.com
myorigin      = sd-79585.antarka.com
mydestination = localhost localhost.$mydomain
mynetworks    = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
relayhost     =

alias_maps     = hash:/etc/aliases
alias_database = hash:/etc/aliases

####################
## TLS PARAMETERS ##
####################

# SMTP ( OUTGOING / Client )
# ----------------------------------------------------------------------
smtp_tls_loglevel            = 1
smtp_tls_security_level      = may
smtp_tls_CAfile              = /etc/ssl/certs/mailserver_ca.crt
smtp_tls_protocols           = !SSLv2, !SSLv3
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_mandatory_ciphers   = high
smtp_tls_exclude_ciphers     = aNULL, eNULL, EXPORT, DES, 3DES, RC2, RC4, MD5, PSK, SRP, DSS, AECDH, ADH
smtp_tls_note_starttls_offer = yes

# SMTPD ( INCOMING / Server )
# ----------------------------------------------------------------------
smtpd_tls_loglevel            = 1
smtpd_tls_auth_only           = yes
smtpd_tls_security_level      = may
smtpd_tls_received_header     = yes
smtpd_tls_protocols           = !SSLv2, !SSLv3
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_mandatory_ciphers   = medium

# Infos (voir : postconf -d)
# Medium cipherlist = aNULL:-aNULL:ALL:!EXPORT:!LOW:+RC4:@STRENGTH
# High cipherlist   = aNULL:-aNULL:ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH

# smtpd_tls_exclude_ciphers   = NE PAS modifier cette directive pour des raisons de compatibilité
#                               avec les autres serveurs de mail afin d'éviter une erreur du type
#                               "no shared cipher" ou "no cipher overlap" puis un fallback en
#                               plain/text...
# smtpd_tls_cipherlist        = Ne pas modifier non plus !

smtpd_tls_CAfile              = $smtp_tls_CAfile
smtpd_tls_cert_file           = /etc/ssl/certs/mailserver_postfix.crt
smtpd_tls_key_file            = /etc/ssl/private/mailserver_postfix.key
smtpd_tls_dh1024_param_file   = $config_directory/dh2048.pem
smtpd_tls_dh512_param_file    = $config_directory/dh512.pem

smtp_tls_session_cache_database  = btree:${data_directory}/smtp_scache
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
lmtp_tls_session_cache_database  = btree:${data_directory}/lmtp_scache

tls_preempt_cipherlist = yes
tls_random_source      = dev:/dev/urandom

# ----------------------------------------------------------------------

#####################
## SASL PARAMETERS ##
#####################

smtpd_sasl_auth_enable          = yes
smtpd_sasl_type                 = dovecot
smtpd_sasl_path                 = private/auth
smtpd_sasl_security_options     = noanonymous
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
smtpd_sasl_local_domain         = $mydomain
smtpd_sasl_authenticated_header = yes

broken_sasl_auth_clients = yes

##############################
## VIRTUALS MAPS PARAMETERS ##
##############################

virtual_uid_maps        = static:5000
virtual_gid_maps        = static:5000
virtual_minimum_uid     = 5000
virtual_mailbox_base    = /var/mail
virtual_transport       = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps    = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps      = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
relay_domains           = mysql:/etc/postfix/mysql-relay-domains.cf

######################
## ERRORS REPORTING ##
######################

# notify_classes = bounce, delay, resource, software
notify_classes = resource, software

error_notice_recipient     = admin@domain.tld
# delay_notice_recipient   = admin@domain.tld
# bounce_notice_recipient  = admin@domain.tld
# 2bounce_notice_recipient = admin@domain.tld

##################
## RESTRICTIONS ##
##################

smtpd_recipient_restrictions =
     permit_mynetworks,
     permit_sasl_authenticated,
     reject_non_fqdn_recipient,
     reject_unauth_destination,
     reject_unknown_recipient_domain,
     reject_rbl_client zen.spamhaus.org

smtpd_helo_restrictions =
     permit_mynetworks,
     permit_sasl_authenticated,
     reject_invalid_helo_hostname,
     reject_non_fqdn_helo_hostname
     # reject_unknown_helo_hostname

smtpd_client_restrictions =
     permit_mynetworks,
     permit_inet_interfaces,
     permit_sasl_authenticated
     # reject_plaintext_session,
     # reject_unauth_pipelining

smtpd_sender_restrictions =
     reject_non_fqdn_sender,
     reject_unknown_sender_domain

smtpd_relay_restrictions =
     permit_mynetworks,
     reject_unknown_sender_domain,
     permit_sasl_authenticated,
     reject_unauth_destination

#############
## MILTERS ##
#############

milter_protocol = 6
milter_default_action = accept
smtpd_milters = unix:/opendkim/opendkim.sock, unix:/opendmarc/opendmarc.sock
non_smtpd_milters = unix:/opendkim/opendkim.sock

##### ----------- File : /etc/postfix/master.cf -----------------------------------------------------------------------------------------------------------------------------

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
  -o content_filter=spamassassin
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
submission inet n       -       -       -       -       smtpd
  -o content_filter=spamassassin
  -o syslog_name=postfix/submission
  -o smtpd_tls_dh1024_param_file=${config_directory}/dh2048.pem
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix	-	n	n	-	2	pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

spamassassin unix -     n       n       -       -       pipe
  user=debian-spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

##### ----------- File : /etc/postfix/mysql-virtual-mailbox-domains.cf -----------------------------------------------------------------------------------------------------------------------------

hosts = 127.0.0.1
user = postfix
password = monpass
dbname = postfix

query = SELECT domain FROM domain WHERE domain='%s' and backupmx = 0 and active = 1

##### ----------- File : /etc/postfix/mysql-virtual-mailbox-maps.cf -----------------------------------------------------------------------------------------------------------------------------

hosts = 127.0.0.1
user = postfix
password = monpass
dbname = postfix

query = SELECT maildir FROM mailbox WHERE username='%s' AND active = 1

##### ----------- File : /etc/postfix/mysql-virtual-alias-maps.cf -----------------------------------------------------------------------------------------------------------------------------

hosts = 127.0.0.1
user = postfix
password = monpass
dbname = postfix

query = SELECT goto FROM alias WHERE address='%s' AND active = 1

...................................
## ClamAV Confs                ##
...................................

##### ----------- File : /etc/clamav/freshclam.conf -----------------------------------------------------------------------------------------------------------------------------

--> Fichier Invalide

##### ----------- File : /etc/clamav/clamd.conf -----------------------------------------------------------------------------------------------------------------------------

--> Fichier Invalide

...................................
## Spamassassin Confs            ##
...................................

##### ----------- File : /etc/spamassassin/local.cf -----------------------------------------------------------------------------------------------------------------------------

rewrite_header Subject *****SPAM*****
report_safe 0
whitelist_from *@antarka.com

add_header all Report _REPORT_
add_header spam Flag _YESNOCAPS_
add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
add_header all Level _STARS(*)_
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_

##### ----------- File : /etc/default/spamassassin -----------------------------------------------------------------------------------------------------------------------------

# /etc/default/spamassassin
# Duncan Findlay

# WARNING: please read README.spamd before using.
# There may be security risks.

# If you're using systemd (default for jessie), the ENABLED setting is
# not used. Instead, enable spamd by issuing:
# systemctl enable spamassassin.service
# Change to "1" to enable spamd on systems using sysvinit:
ENABLED=0

# Options
# See man spamd for possible options. The -d option is automatically added.

# SpamAssassin uses a preforking model, so be careful! You need to
# make sure --max-children is not set to anything higher than 5,
# unless you know what you're doing.

OPTIONS="--create-prefs --max-children 5 --helper-home-dir"

# Pid file
# Where should spamd write its PID to file? If you use the -u or
# --username option above, this needs to be writable by that user.
# Otherwise, the init script will not be able to shut spamd down.
PIDFILE="/var/run/spamd.pid"

# Set nice level of spamd
#NICE="--nicelevel 15"

# Cronjob
# Set to anything but 0 to enable the cron job to automatically update
# spamassassin's rules on a nightly basis
CRON=1

...................................
## Logs                          ##
...................................

##### ----------- File : /var/log/mail.warn -----------------------------------------------------------------------------------------------------------------------------

Nov 17 09:34:27 sd-79585 dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:34:27 sd-79585 dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:38:06 sd-79585 dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:38:06 sd-79585 dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:38:06 sd-79585 dovecot: ssl-params: Warning: Regenerating /var/lib/dovecot/ssl-parameters.dat for ssl_dh_parameters_length=2048
Nov 17 09:38:10 sd-79585 dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:38:10 sd-79585 dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:38:10 sd-79585 dovecot: ssl-params: Warning: Regenerating /var/lib/dovecot/ssl-parameters.dat for ssl_dh_parameters_length=2048
Nov 17 09:38:12 sd-79585 dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:38:12 sd-79585 dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:38:12 sd-79585 dovecot: ssl-params: Warning: Regenerating /var/lib/dovecot/ssl-parameters.dat for ssl_dh_parameters_length=2048
Nov 17 09:42:11 sd-79585 dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:42:11 sd-79585 dovecot: ssl-params: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:42:11 sd-79585 dovecot: ssl-params: Error: child process failed with status 15
Nov 17 09:42:11 sd-79585 dovecot: anvil: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:42:11 sd-79585 dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 17 09:42:11 sd-79585 dovecot: ssl-params: Warning: Regenerating /var/lib/dovecot/ssl-parameters.dat for ssl_dh_parameters_length=2048

##### ----------- File : /var/log/mail.err -----------------------------------------------------------------------------------------------------------------------------

Nov 17 09:42:11 sd-79585 dovecot: ssl-params: Error: child process failed with status 15

...................................
## Vhost Confs                   ##
...................................

##### ----------- File : /etc/nginx/sites-enabled/rainloop.conf -----------------------------------------------------------------------------------------------------------------------------

server {
    listen 	     80;
    server_name  webmail.antarka.com;

    root         /var/www/rainloop;
    index        index.php;
    charset      utf-8;

    add_header Strict-Transport-Security max-age=31536000;

    # auth_basic "Webmail - Connexion";
    # auth_basic_user_file /etc/nginx/passwdfile;

    location ^~ /data {
        deny all;
    }

    location / {
        try_files $uri $uri/ index.php;
    }

    location ~* \.php$ {
        include       /etc/nginx/fastcgi_params;
        fastcgi_pass  unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

##### ----------- File : /etc/nginx/sites-enabled/postfixadmin.conf -----------------------------------------------------------------------------------------------------------------------------

server {
    listen          80;
    server_name     postfixadmin.antarka.com;
    root            /var/www/postfixadmin;
    index           index.php;
    charset         utf-8;

    auth_basic "PostfixAdmin - Connexion";
    auth_basic_user_file /etc/nginx/passwdfile;

    location / {
        try_files $uri $uri/ index.php;
    }

    location ~* \.php$ {
        include       /etc/nginx/fastcgi_params;
        fastcgi_pass  unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

...................................
## DNS                           ##
...................................

- MX       : antarka.com.		3600	IN	MX	1 mx.antarka.com.
- SPF      : antarka.com.		3600	IN	TXT	"v=spf1 a mx ip4:62.210.105.59 ~all"
- DKIM     : mail._domainkey.antarka.com. 3600 IN	TXT	"v=DKIM1\; k=rsa\;  p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCyexDyJQVMRIzCl2JiagW8hapkDHXANhlqdzE4ql8iLeocYtruyRSWKTZ+PxIKuTwlvQoqrEovvq/d4Ukw2uQFH28rXyBCdc78M6Kbs0jew0L3AY6wGQoqkvKvoaMRUGkmlocXrxKT4F7pnISrBrdCIEK4phfvMLQ1V2KsPvrGlwIDAQAB"
- DMARC    : _dmarc.antarka.com.	3600	IN	TXT	"v=DMARC1\; p=reject\; rua=mailto:postmaster@antarka.com\; ruf=mailto:admin@antarka.com\; fo=0\; adkim=s\; aspf=s\; pct=100\; rf=afrf\; sp=reject"
- PFA      : postfixadmin.antarka.com. 3600	IN	CNAME	sd-79585.antarka.com.
- RAINLOOP : rainloop.antarka.com.	3600	IN	CNAME	sd-79585.antarka.com.
- REVERSE  : 62-210-105-59.rev.poneytelecom.eu.


...................................
## DOVEADM                       ##
...................................

- User Info --------------------
field	value
uid	5000
gid	5000
home	/var/mail/vhosts/antarka.com/admin
mail	maildir:/var/mail/vhosts/antarka.com/admin/mail
--------------------------------

- Dovecot errors ---------------
Nov 17 09:42:11 ssl-params: Warning: Regenerating /var/lib/dovecot/ssl-parameters.dat for ssl_dh_parameters_length=2048
--------------------------------

Du coup si quelqu'un sait d'ou viens cette erreur, et comment la réparé, je suis preneur. ^^

Cordialement, Purexo

EDIT :
En Debug random, je me suis dit : 'tiens si je mettais le SECURE en STARTTLS au lieu de SSL' et ben visiblement ça marche.
Je me suis envoyé un mail de mon compte OVH contact@purexo.eu vers le serveur créé contact@antarka.com : OK (ça c'est le test IMAP du coup)
J'ai testé le sens inverse : contact@antarka.com -> contact@purexo.eu . Le message mets un peu de temps à passer.
Nov 17 11:59:55 sd-79585 postfix/smtp[16159]: connect to mx1.ovh.net[213.186.33.29]:25: Connection refused
Je crois que OVH fait par moment la gueule.

Donc SSL : BAD. STARTTLS : OK

Si il y moyen de faire plus propre je prens, mais au pire ça à l'air de fonctionner ^^
C'est normale. Le SMTP chez moi aussi est en STARTTLS
La connexion SMTP se fera toujours par STARTTLS et non pas par SMTPS, j'avais déjà indiqué la raison un peu plus haut :
Hardware wrote:Je n'ai pas activé le port SMTPS car ça fait 15 ans qu'il est déprécié, donc complètement obsolète. A la base il n'a pas été prévu pour une utilisation mail, en plus niveau sécurité ce n'est pas le top. On le retrouve souvent chez certains fournisseurs de mail pour des raisons de compatibilité mais il ne faut plus l'utiliser.

A la place, il faut utiliser le port 587 (MSA submission) avec une annonce STARTTLS avant de passer en AUTH SMTP. C'est le port officiel pour envoyer des mails à partir d'un client (MUA) vers un serveur de mails (MTA).
Bonjour à tous,
Une petite question pour savoir d'où viennent ces erreurs?
*Warning: Database is older than source file
et
*Warning: Database is older than source file ------ /etc/aliases

Elles sont remontées avec Logwatch:
--------------------- Postfix Begin ------------------------ 

 ****** Summary *************************************************************************************
 
        6   *Warning: Database is older than source file 
 
   20.211M  Bytes accepted                          21,193,238
   25.002K  Bytes sent via SMTP                         25,602
   10.101M  Bytes sent via LMTP                     10,591,867
   10.106M  Bytes delivered                         10,597,004
 ========   ==================================================
 
       15   Accepted                                    60.00%
       10   Rejected                                    40.00%
 --------   --------------------------------------------------
       25   Total                                      100.00%
 ========   ==================================================
 
       10   5xx Reject HELO/EHLO                       100.00%
 --------   --------------------------------------------------
       10   Total 5xx Rejects                          100.00%
 ========   ==================================================
 
        7   Connections             
        1   Connections lost (inbound) 
        7   Disconnections          
       22   Removed from queue      
        9   Delivered               
        6   Sent via SMTP           
        5   Sent via LMTP           
        2   Bounced (remote)        
        1   Notifications sent      
 
        4   HELO/EHLO conversations errors 
        1   SMTP protocol violations 
        3   TLS connections (server) 
        6   TLS connections (client) 
 
        1   Postfix stop            
 
 ****** Detail (10) *********************************************************************************
 
        6   *Warning: Database is older than source file --------------------------------------------
        6      /etc/aliases 
Tout fonctionne pourtant mais ces erreurs persistent
D'avance merci
Hardware wrote:La connexion SMTP se fera toujours par STARTTLS et non pas par SMTPS, j'avais déjà indiqué la raison un peu plus haut :
Hardware wrote:Je n'ai pas activé le port SMTPS car ça fait 15 ans qu'il est déprécié, donc complètement obsolète. A la base il n'a pas été prévu pour une utilisation mail, en plus niveau sécurité ce n'est pas le top. On le retrouve souvent chez certains fournisseurs de mail pour des raisons de compatibilité mais il ne faut plus l'utiliser.

A la place, il faut utiliser le port 587 (MSA submission) avec une annonce STARTTLS avant de passer en AUTH SMTP. C'est le port officiel pour envoyer des mails à partir d'un client (MUA) vers un serveur de mails (MTA).
Merci pour cette réponse.

Une dernière question. J'ai quelques soucis (anodins) avec mail-tester :
http://www.mail-tester.com/web-zSJWem&reloaded=1
MailTester wrote:Votre message a échoué au test DMARC.
Une politique DMARC permet à un expéditeur de signaler que ces messages sont protégés par SPF et/ou DKIM et de donner les instructions à exécuter si aucune de ces deux méthodes d'authentifications est correcte. Veuillez vérifier que votre SPF et DKIM soient correctement configurés avant d'installer DMARC.
Vous n'êtes pas autorisé à envoyer un message avec cette addresse.
Pourtant j'ai l'impression que tout est ok
MailTester wrote:SpamAssassin pense que vous pouvez vous améliorer
Le fameux filtre anti-spam SpamAssassin. La note : -1.2.
Une note en dessous de -5 est considérée comme du spam.
-0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid
Ce score négatif deviendra positif si la signature est valide. Voir immédiatement après.
0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
Génial ! Votre signature est valide
0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain
Génial ! Votre signature est valide et provient de votre nom de domaine
-1.274 RDNS_NONE Delivered to internal network by a host with no rDNS
Ce peut-être un faux-positif, vérifier
0.001 SPF_PASS SPF: sender matches SPF record
Super! Votre enregistrement SPF est valide
Pourquoi mon DKIM n'est pas signé, sachant qu'il est Valide et Qu'il provient du bon domaine
pour le ReverseDNS j'attends la propagation.

Le dédié est sur Online.net avec le reverse était configuré sur 62-210-105-59.rev.poneytelecom.eu.
je l'ai édité en sd-79585.antarka.com. sachant que sd-79585.antarka.com. pointe bien vers l'adresse IP du Dédié
Donc j'espère que ça c'est bon. Je n'ai pas pus ajouter une entrée PTR sur OVH c'est la qu'on a le DNS, OVH me donné ça comme erreur :
 Zone is not valid : line 27: ignoring out-of-zone data (59.105.210.62.in-addr.arpa)
sachant que j'ai saisie ça :
59.105.210.62.in-addr.arpa. IN PTR  sd-79585.antarka.com.

Et une dernière chose, comment je fait pour que mes utilisateurs puissent modifier leurs mots de passes ?

En fait j'ai trouvé, il faut ajouter un plugin à rainloop : https://github.com/RainLoop/rainloop-webmail/tree/master/plugins/postfixadmin-change-password
Qu'il faudra placer dans le dossier data/_data_/_default_/plugins/postfixadmin-change-password/ de votre instalation de RainLoop
Ensuite dans l'interface admin de rainloop, configurez et activez le plugin
Bonjour,

J'ai un serveur chez so you start. Je suis entrain de l'installer sous debian 8.

J'ai suivie votre tuto mais je rencontre des problèmes.
A l'étape 7 lors de la commande telnet, je n'ai pas la ligne 250-VRFY.

Après lorsque j'essaie de configurer mon client mail (outlook) et que je lance les testes de connexion impossible de se connecter en ssl, tls ou rien.

Lorsque je saisie la commande tail -f /var/log/mail.log voila ce que j'ai :
Nov 16 16:30:40 ns236420 dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=ip, lip=ip serveur, session=<fWeBF6ok/gBQC6MI>
Nov 16 16:30:41 ns236420 postfix/smtpd[6393]: connect from xxxxxxx[ip]
Nov 16 16:30:42 ns236420 postfix/smtpd[6393]: SSL_accept error from xxxxxxx[ip]: 0
Nov 16 16:30:42 ns236420 postfix/smtpd[6393]: warning: TLS library problem: error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown:s3_pkt.c:1294:SSL alert number 46:
Nov 16 16:30:42 ns236420 postfix/smtpd[6393]: lost connection after STARTTLS from xxxxxxxx[ip]
Nov 16 16:30:42 ns236420 postfix/smtpd[6393]: disconnect from xxxxxxxx[ip]
Nov 16 16:30:42 ns236420 postfix/smtpd[6393]: connect from xxxxxxxx[ip]
Nov 16 16:30:42 ns236420 postfix/smtpd[6393]: NOQUEUE: reject: RCPT from xxxxxxxx[ip]: 504 5.5.2 <Developpeur>: Helo command rejected: need fully-qualified hostname; from=<contact@domaine.fr> to=<contact@domaine.fr> proto=ESMTP helo=<Developpeur>
Nov 16 16:30:42 ns236420 postfix/smtpd[6393]: lost connection after RCPT from xxxxxxxx[ip]
Nov 16 16:30:42 ns236420 postfix/smtpd[6393]: disconnect from xxxxxxxx[ip]
Si vous pouviez me donner une piste (voir une solution).

Cordialement

bobjo
@Purexo: Le test DMARC sur mail-tester n'est pas toujours fiable, il existe d'autres outils pour le vérifier.

@bobjo: C'est normal, j'ai désactivé la commande VRFY avec la directive disable_vrfy_command = yes dans main.cf, pour des raisons de sécurité.

Pour ton second problème, il faut que tu acceptes ou que tu ajoutes ton certificat auto-signé dans Outlook.
Bonjour !

Merci pour ce tuto -et le script associé- qui m'ont évité bien des migraines.
Néanmoins, j'ai deux questions concernant les certificats SSL à mettre en place.

Lors de la mise en place de postfix, dans le fichier de configuration :
# /etc/postfix/main.cf

smtp_tls_CAfile                = /etc/ssl/certs/ca.cert.pem
smtpd_tls_cert_file           = /etc/ssl/certs/mailserver.crt
smtpd_tls_key_file            = /etc/ssl/private/mailserver.key
Et pour dovecot :
# /etc/dovecot/conf.d/10-ssl.conf

ssl = required
ssl_cert = </etc/ssl/certs/mailserver.crt
ssl_key = </etc/ssl/private/mailserver.key
Afin d'avoir des "vrais" certificats -via startSSL ou LetsEncrypt- dois-je leur attribuer un domain précis ? (par ex: postfix.example.com) ou bien un certificat sur example.com suffit ?
Enfin, quelle est la différence entre le ca.cert.pem et le mailserver.crt ?

Merci d'avance pour vos réponses !

S. SAVINEL
@ssavinel: le domaine à attribuer au certificat est le FQDN du serveur (voir myhostname dans /etc/postfix/main.cf)

ca.cert.pem = certificat racine et intermédiaires de l'AC.
mailserver.crt = certificat du serveur de mail
@Hardware : Merci beaucoup ! Du coup tout est bon chez moi, encore merci pour ce tuto !!!
Bonjour à tous;
d'abord merci pour ce bon tuto bien détaillé et surtout très explicite, difficile en trouver en français la plus part de temps;
j'ai suivi à la loupe chaque point du tutorial, autant dire que j'ai beaucoup appris là dessus,

Tout semble correcte jusque là, postfixadmin, mysql, SMTP, tout semble fonctionne en tout cas, mais le seul point : IMAP ne se connecte pas, j'ai désespérément essayer de remédier, sans succès;
Autre point : j'ai utilisé Apache à la place de Nginx;
et Roundcube à la place de Rainloop,

Mon SMTP peut envoyer le mail sans problème, mais mon IMAP lui ne sait pas récupérer,
voilà ce que le fichier /var/log/mail-log m'afficher après le test de connection imap

Nov 20 10:42:28 mailserver dovecot: auth: Fatal: Unknown database driver 'mysql'
Nov 20 10:42:58 mailserver dovecot: imap-login: Error: Timeout waiting for handshake from auth server. my pid=4208, input bytes=0
Nov 20 10:43:28 mailserver dovecot: auth: Fatal: Unknown database driver 'mysql'
Nov 20 10:44:28 mailserver dovecot: auth: Fatal: Unknown database driver 'mysql'
Nov 20 10:44:28 mailserver dovecot: imap-login: Disconnected: Auth process broken (disconnected before auth was ready, waited 10 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<J0y8uPUklwB/AAAB>
Nov 20 10:44:58 mailserver dovecot: imap-login: Error: Timeout waiting for handshake from auth server. my pid=4216, input bytes=0
Nov 20 10:45:28 mailserver dovecot: auth: Fatal: Unknown database driver 'mysql'
et puis quand j'essaie de vérifier le lmtp j'obtien ce ci
Nov 20 10:50:39 mailserver postfix/lmtp[4383]: 0135526D7E: to=<gloire@gcreative.com>, relay=mailserver.gcreative.com[private/dovecot-lmtp], delay=0.3, delays=0.08/0.11/0.11/0, dsn=4.4.2, status=deferred (lost connection with mailserver.gcreative.com[private/dovecot-lmtp] while receiving the initial server greeting)
Nov 20 10:51:33 mailserver dovecot: lmtp(4394): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given
Nov 20 10:51:33 mailserver postfix/lmtp[4383]: EB89126D6D: to=<gloire@gcreative.com>, relay=mailserver.gcreative.com[private/dovecot-lmtp], delay=331955, delays=331955/0.01/0.02/0, dsn=4.4.2, status=deferred (lost connection with mailserver.gcreative.com[private/dovecot-lmtp] while receiving the initial server greeting)
Nov 20 10:51:33 mailserver dovecot: lmtp(4398): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given
je suis bloqué à ce niveau et je sais pas avancer

Merci de m'aider