Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 19/01/2023, à 21:26

Sebastien31T

Serveur de mail virtuel

Bonjour à tous,
Je tente de réaliser un serveur de mail avec mysql postfix et dovecot. Il s'agit pourt ceux qui coinnaisse d'une formation sur linkedin-learning.
Je pense avoir des probleme avec postfix pour commencer voici :

main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_cert_file=/etc/dovecot/private/dovecot.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_key_file=/etc/dovecot/private/dovecot.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_auth_only=yes

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination

myhostname = srvprod.obierti.com
#alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases

# configuration virtuelle
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:997
virtual_gid_maps = static:8
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf, mysql:/etc/postfix/mysql_virtual_mailbox_domainalias_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf, mysql:/etc/postfix/mysql_virtual_domainalias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domain_maps.cf
dovecot_destination_recipient_limit = 1
virtual_transport = dovecot

myorigin = /etc/mailname
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

content_filter = smtp-amavis:[127.0.0.1]:10024

voici aussi un fichier mysql :

user = postfixadmin
password = 
hosts = 127.0.0.1
dbname = postfixadmin
table = domain
select_field = domain
where_field = domain
additional_conditions = AND backupmx = 0 AND active = 1

je vous donne le log de mail:

tail -n 40 /var/log/mail.log 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .F   
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .arc 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .arj 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .cab 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .doc 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .exe 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .iso 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .jar 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .lha 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .lrz 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .lzo 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .rar 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .rpm 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .swf 
Jan 19 06:33:32 srvprod amavis[55265]: No decoder for       .zoo 
Jan 19 06:33:32 srvprod amavis[55265]: Using primary internal av scanner code for ClamAV-clamd
Jan 19 06:33:32 srvprod amavis[55265]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
Jan 19 06:33:32 srvprod postfix/sendmail[55268]: fatal: /etc/mailname: cannot open file: No such file or directory
Jan 19 06:33:32 srvprod spamd[55256]: zoom: able to use 402/403 'body_0' compiled rules (99.751%)
Jan 19 06:33:32 srvprod spamd[55256]: spamd: server started on IO::Socket::IP [::1]:783, IO::Socket::IP [127.0.0.1]:783 (running version 3.4.4)
Jan 19 06:33:32 srvprod spamd[55256]: spamd: server pid: 55256
Jan 19 06:33:32 srvprod spamd[55256]: spamd: server successfully spawned child process, pid 55269
Jan 19 06:33:32 srvprod spamd[55256]: spamd: server successfully spawned child process, pid 55270
Jan 19 06:33:32 srvprod spamd[55256]: prefork: child states: IS
Jan 19 06:33:32 srvprod spamd[55256]: prefork: child states: II
Jan 19 06:45:02 srvprod postfix/sendmail[55742]: fatal: /etc/mailname: cannot open file: No such file or directory
Jan 19 06:45:02 srvprod postfix/sendmail[55744]: fatal: /etc/mailname: cannot open file: No such file or directory
Jan 19 16:07:16 srvprod postfix/postmap[61737]: fatal: /etc/mailname: cannot open file: No such file or directory
Jan 19 16:13:22 srvprod postfix/postmap[61903]: fatal: /etc/mailname: cannot open file: No such file or directory
Jan 19 16:14:24 srvprod postfix/postmap[61911]: fatal: /etc/mailname: cannot open file: No such file or directory
Jan 19 16:43:38 srvprod postfix/sendmail[62081]: fatal: /etc/mailname: cannot open file: No such file or directory
Jan 19 16:43:38 srvprod postfix/sendmail[62083]: fatal: /etc/mailname: cannot open file: No such file or directory
Jan 19 18:57:41 srvprod postfix[63015]: fatal: usage: postfix [-c config_dir] [-Dv] command
Jan 19 18:58:23 srvprod postfix[63016]: fatal: -c requires absolute pathname
Jan 19 19:19:46 srvprod postfix[63629]: error: to submit mail, use the Postfix sendmail command
Jan 19 19:19:46 srvprod postfix[63629]: fatal: the postfix command is reserved for the superuser
Jan 19 19:20:17 srvprod postfix[63632]: fatal: usage: postfix [-c config_dir] [-Dv] command
Jan 19 20:09:11 srvprod amavis[55271]: (55271-01) SMTP: 501 5.5.2 Syntax: MAIL FROM:<address>; smtp_resp: MAIL\r\n
Jan 19 20:09:36 srvprod amavis[55271]: (55271-01) SMTP: 500 5.5.2 Error: bad syntax; smtp_resp: TO:<obierti.com>\r\n
Jan 19 20:09:44 srvprod amavis[55271]: (55271-01) SMTP: 500 5.5.2 Error: command EXIT not recognized; smtp_resp: exit\r\n

Merci de m'aider a comprendre mon erreur.
Excellente soirée a tous.
Sébastrien

Hors ligne

#2 Le 20/01/2023, à 15:08

bruno

Re : Serveur de mail virtuel

Bonjour,

Quel est le problème ?
On voit des erreurs explicites dans les logs :
- manque de certains décodeurs pour Amavis ;
- fichier /etc/mailname introuvable ;
- tentative de lancement direct de postfix avec une ligne de commande incomplète (au lieu d'utiliser le service systemd) ;
- des erreurs de syntaxe lors d'une tentative d'envoi de courriel en ligne de commande.

Est-ce que ces erreurs ont été comprises et corrigés ?

#3 Le 20/01/2023, à 16:32

Sebastien31T

Re : Serveur de mail virtuel

Bonjour Bruno
J'ai corrige (pas tout)
mais ca ne fonctionne pas

 tail -n 100 /var/log/mail.log 
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .kmz, tried: 7za, 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .7z, tried: 7zr, 7za, 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .jar, tried: 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .arj, tried: 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .rar, tried: 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .swf, tried: 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .lha, tried: 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .iso, tried: 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .cab, tried: 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .rpm, tried: 7z
Jan 20 15:14:02 srvprod amavis[86895]: No ext program for   .exe, tried: unrar-free; arj, unarj
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .7z  
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .F   
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .arc 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .arj 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .cab 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .doc 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .exe 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .iso 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .jar 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .lha 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .lrz 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .lzo 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .rar 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .rpm 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .swf 
Jan 20 15:14:02 srvprod amavis[86895]: No decoder for       .zoo 
Jan 20 15:14:02 srvprod amavis[86895]: Using primary internal av scanner code for ClamAV-clamd
Jan 20 15:14:02 srvprod amavis[86895]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
Jan 20 15:21:37 srvprod postfix[87055]: Postfix is running with backwards-compatible default settings
Jan 20 15:21:37 srvprod postfix[87055]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jan 20 15:21:37 srvprod postfix[87055]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Jan 20 15:21:37 srvprod postfix/postfix-script[87119]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Jan 20 15:21:37 srvprod postfix/postfix-script[87284]: starting the Postfix mail system
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 12: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 28: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 40: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 43: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 46: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 47: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 48: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 49: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 50: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 51: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 52: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 55: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 56: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 58: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 59: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 60: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 61: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 64: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 65: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 66: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 128: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: /etc/postfix/master.cf: line 134: using backwards-compatible default setting chroot=y
Jan 20 15:21:37 srvprod postfix/master[87286]: daemon started -- version 3.4.13, configuration /etc/postfix
Jan 20 15:21:37 srvprod amavis[87315]: starting. /usr/sbin/amavisd-new at srvprod.obierti.com amavisd-new-2.11.0 (20160426), Unicode aware, LC_ALL="C", LANG="fr_FR.UTF-8"
Jan 20 15:21:38 srvprod amavis[87324]: Net::Server: Group Not Defined.  Defaulting to EGID '128 128'
Jan 20 15:21:38 srvprod amavis[87324]: Net::Server: User Not Defined.  Defaulting to EUID '120'
Jan 20 15:21:38 srvprod amavis[87324]: No $altermime,         not using it
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .lrz, tried: lrzip -q -k -d -o -, lrzcat -q -k
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .lzo, tried: lzop -d
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .rpm, tried: rpm2cpio.pl, rpm2cpio
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .rar, tried: unrar-free
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .arj, tried: arj, unarj
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .arc, tried: nomarch, arc
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .zoo, tried: zoo
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .doc, tried: ripole
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .cab, tried: cabextract
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .zip, tried: 7za, 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .kmz, tried: 7za, 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .7z, tried: 7zr, 7za, 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .jar, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .arj, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .rar, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .swf, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .lha, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .iso, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .cab, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .rpm, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .exe, tried: unrar-free; arj, unarj
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .7z  
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .F   
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .arc 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .arj 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .cab 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .doc 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .exe 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .iso 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .jar 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .lha 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .lrz 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .lzo 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .rar 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .rpm 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .swf 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .zoo 
Jan 20 15:21:38 srvprod amavis[87324]: Using primary internal av scanner code for ClamAV-clamd
Jan 20 15:21:38 srvprod amavis[87324]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan

Hors ligne

#4 Le 20/01/2023, à 16:39

Sebastien31T

Re : Serveur de mail virtuel

Bonjour Bruno,
J'ai modifier mais ca ne fonctionne toujours pas,
Voici le log:

tail -n 100 /var/log/mail.log 
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .7z, tried: 7zr, 7za, 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .jar, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .arj, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .rar, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .swf, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .lha, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .iso, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .cab, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .rpm, tried: 7z
Jan 20 15:21:38 srvprod amavis[87324]: No ext program for   .exe, tried: unrar-free; arj, unarj
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .7z  
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .F   
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .arc 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .arj 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .cab 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .doc 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .exe 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .iso 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .jar 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .lha 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .lrz 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .lzo 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .rar 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .rpm 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .swf 
Jan 20 15:21:38 srvprod amavis[87324]: No decoder for       .zoo 
Jan 20 15:21:38 srvprod amavis[87324]: Using primary internal av scanner code for ClamAV-clamd
Jan 20 15:21:38 srvprod amavis[87324]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
Jan 20 15:37:10 srvprod postfix[88265]: Postfix is running with backwards-compatible default settings
Jan 20 15:37:10 srvprod postfix[88265]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jan 20 15:37:10 srvprod postfix[88265]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Jan 20 15:37:10 srvprod postfix/postfix-script[88271]: stopping the Postfix mail system
Jan 20 15:37:10 srvprod postfix/master[87286]: terminating on signal 15
Jan 20 15:37:10 srvprod postfix[88337]: Postfix is running with backwards-compatible default settings
Jan 20 15:37:10 srvprod postfix[88337]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jan 20 15:37:10 srvprod postfix[88337]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Jan 20 15:37:10 srvprod postfix/postfix-script[88401]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Jan 20 15:37:10 srvprod postfix/postfix-script[88566]: starting the Postfix mail system
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 12: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 28: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 40: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 43: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 46: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 47: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 48: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 49: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 50: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 51: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 52: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 55: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 56: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 58: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 59: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 60: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 61: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 64: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 65: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 66: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 128: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: /etc/postfix/master.cf: line 134: using backwards-compatible default setting chroot=y
Jan 20 15:37:10 srvprod postfix/master[88568]: daemon started -- version 3.4.13, configuration /etc/postfix
Jan 20 15:37:11 srvprod amavis[88597]: starting. /usr/sbin/amavisd-new at srvprod.obierti.com amavisd-new-2.11.0 (20160426), Unicode aware, LC_ALL="C", LANG="fr_FR.UTF-8"
Jan 20 15:37:11 srvprod amavis[88606]: Net::Server: Group Not Defined.  Defaulting to EGID '128 128'
Jan 20 15:37:11 srvprod amavis[88606]: Net::Server: User Not Defined.  Defaulting to EUID '120'
Jan 20 15:37:11 srvprod amavis[88606]: No $altermime,         not using it
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .lrz, tried: lrzip -q -k -d -o -, lrzcat -q -k
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .lzo, tried: lzop -d
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .rpm, tried: rpm2cpio.pl, rpm2cpio
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .rar, tried: unrar-free
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .arj, tried: arj, unarj
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .zoo, tried: zoo
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .doc, tried: ripole
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .cab, tried: cabextract
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .zip, tried: 7za, 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .kmz, tried: 7za, 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .jar, tried: 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .arj, tried: 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .rar, tried: 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .swf, tried: 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .lha, tried: 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .iso, tried: 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .cab, tried: 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .rpm, tried: 7z
Jan 20 15:37:11 srvprod amavis[88606]: No ext program for   .exe, tried: unrar-free; arj, unarj
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .F   
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .arj 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .cab 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .doc 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .exe 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .iso 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .jar 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .lha 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .lrz 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .lzo 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .rar 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .rpm 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .swf 
Jan 20 15:37:11 srvprod amavis[88606]: No decoder for       .zoo 
Jan 20 15:37:11 srvprod amavis[88606]: Using primary internal av scanner code for ClamAV-clamd
Jan 20 15:37:11 srvprod amavis[88606]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan

Hors ligne

#5 Le 21/01/2023, à 11:21

bruno

Re : Serveur de mail virtuel

On ne sait toujours pas ce qui ne fonctionne pas…

Dans un premier temps désactive Amavis qui ne semble pas être complètement installé / configuré.
Essaie aussi de comprendre pourquoi postfix démarre en  mode de  rétro-compatibilité, comme indiqué lire : cohttp://www.postfix.org/COMPATIBILITY_README.html

#6 Le 21/01/2023, à 13:13

Sebastien31T

Re : Serveur de mail virtuel

Bonjour,
j'ai fais comme tu dis et voici deux lignes qui on apparu dans mes logs:

Jan 21 11:41:03 srvprod postfix/master[89980]: terminating on signal 15
Jan 21 11:41:03 srvprod postfix[101640]: Postfix is running with backwards-compatible default settings
Jan 21 11:41:03 srvprod postfix[101640]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jan 21 11:41:03 srvprod postfix[101640]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"

j'ai lancer la commande et voici le nouveau log:

tail -n 70 /var/log/mail.log  
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: 97B4D22C10B2: from=<www-data@srvprod@obierti.com>, size=3332, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/pickup[103223]: 9D2A922C10B8: uid=1000 from=<seb31t>
Jan 21 12:17:16 srvprod postfix/cleanup[103226]: 9D2A922C10B8: message-id=<20230121121716.9D2A922C10B8@srvprod.obierti.com>
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: 9D2A922C10B8: from=<seb31t@srvprod@obierti.com>, size=466, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/pickup[103223]: 9FE0722C10C2: uid=33 from=<www-data>
Jan 21 12:17:16 srvprod postfix/cleanup[103226]: 9FE0722C10C2: message-id=<M2wNydkzQq3JsMXOrtOfQuxvGxShi9wHZe6gejwac4@temoignageschretiens.fr>
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: 9FE0722C10C2: from=<www-data@srvprod@obierti.com>, size=3317, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/pickup[103223]: A0BDE22C0A43: uid=0 from=<root>
Jan 21 12:17:16 srvprod postfix/cleanup[103226]: A0BDE22C0A43: message-id=<20230121121716.A0BDE22C0A43@srvprod.obierti.com>
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A0BDE22C0A43: from=<root@srvprod@obierti.com>, size=1532, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/pickup[103223]: A2A5622C1194: uid=33 from=<www-data>
Jan 21 12:17:16 srvprod postfix/cleanup[103226]: A2A5622C1194: message-id=<0ugjj3KiZCTm1hTEyMKSM2hn2HpfXZON7uefAvCYoQ@www.temoignageschretiens.fr>
Jan 21 12:17:16 srvprod postfix/pipe[103235]: 97B4D22C10B2: to=<contact@obierti.com>, relay=dovecot, delay=63775, delays=63775/0.01/0/0.01, dsn=5.3.0, status=bounced (command line usage error. Command output: lda: Fatal: Invalid -f parameter: Invalid character in path )
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A2A5622C1194: from=<www-data@srvprod@obierti.com>, size=3333, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/pipe[103238]: 9FE0722C10C2: to=<contact@obierti.com>, relay=dovecot, delay=3038, delays=3038/0.01/0/0.01, dsn=5.3.0, status=bounced (command line usage error. Command output: lda: Fatal: Invalid -f parameter: Invalid character in path )
Jan 21 12:17:16 srvprod postfix/pipe[103236]: 9D2A922C10B8: to=<nepasrepondre@obierti.com>, relay=dovecot, delay=71943, delays=71943/0.01/0/0.01, dsn=5.3.0, status=bounced (command line usage error. Command output: lda: Fatal: Invalid -f parameter: Invalid character in path )
Jan 21 12:17:16 srvprod postfix/cleanup[103226]: A3DBB22C12A8: message-id=<20230121121716.A3DBB22C12A8@srvprod.obierti.com>
Jan 21 12:17:16 srvprod postfix/pipe[103235]: A0BDE22C0A43: to=<root@srvprod@obierti.com>, orig_to=<root>, relay=dovecot, delay=19353, delays=19353/0/0/0.01, dsn=5.3.0, status=bounced (command line usage error. Command output: lda: Fatal: Invalid -f parameter: Invalid character in path )
Jan 21 12:17:16 srvprod postfix/bounce[103240]: 97B4D22C10B2: sender non-delivery notification: A3DBB22C12A8
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A3DBB22C12A8: from=<>, size=5404, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: 97B4D22C10B2: removed
Jan 21 12:17:16 srvprod postfix/cleanup[103226]: A4C4122C12BB: message-id=<20230121121716.A4C4122C12BB@srvprod.obierti.com>
Jan 21 12:17:16 srvprod postfix/pipe[103243]: A2A5622C1194: to=<contact@obierti.com>, relay=dovecot, delay=30182, delays=30182/0/0/0.01, dsn=5.3.0, status=bounced (command line usage error. Command output: lda: Fatal: Invalid -f parameter: Invalid character in path )
Jan 21 12:17:16 srvprod postfix/bounce[103245]: 9FE0722C10C2: sender non-delivery notification: A4C4122C12BB
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A4C4122C12BB: from=<>, size=5389, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: 9FE0722C10C2: removed
Jan 21 12:17:16 srvprod postfix/cleanup[103226]: A5B3322C1197: message-id=<20230121121716.A5B3322C1197@srvprod.obierti.com>
Jan 21 12:17:16 srvprod postfix/bounce[103240]: A0BDE22C0A43: sender non-delivery notification: A5B3322C1197
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A5B3322C1197: from=<>, size=3634, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A0BDE22C0A43: removed
Jan 21 12:17:16 srvprod postfix/cleanup[103248]: A4F6B22C10B2: message-id=<20230121121716.A4F6B22C10B2@srvprod.obierti.com>
Jan 21 12:17:16 srvprod postfix/bounce[103242]: 9D2A922C10B8: sender non-delivery notification: A4F6B22C10B2
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A4F6B22C10B2: from=<>, size=2550, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: 9D2A922C10B8: removed
Jan 21 12:17:16 srvprod postfix/cleanup[103250]: A628122C10C2: message-id=<20230121121716.A628122C10C2@srvprod.obierti.com>
Jan 21 12:17:16 srvprod postfix/pipe[103238]: A3DBB22C12A8: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=0.02, delays=0/0/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:17:16 srvprod postfix/bounce[103247]: A2A5622C1194: sender non-delivery notification: A628122C10C2
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A628122C10C2: from=<>, size=5405, nrcpt=1 (queue active)
Jan 21 12:17:16 srvprod postfix/qmgr[103224]: A2A5622C1194: removed
Jan 21 12:17:16 srvprod postfix/pipe[103236]: A4C4122C12BB: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=0.02, delays=0.01/0/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:17:16 srvprod postfix/pipe[103235]: A5B3322C1197: to=<root@srvprod@obierti.com>, relay=dovecot, delay=0.02, delays=0.01/0/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:17:16 srvprod postfix/pipe[103243]: A4F6B22C10B2: to=<seb31t@srvprod@obierti.com>, relay=dovecot, delay=0.02, delays=0.01/0/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:17:16 srvprod postfix/pipe[103238]: A628122C10C2: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=0.02, delays=0.01/0/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:20:33 srvprod postfix/smtps/smtpd[103280]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Jan 21 12:20:33 srvprod postfix/smtps/smtpd[103280]: warning: hostname zg-1220d-114.stretchoid.com does not resolve to address 192.241.227.25
Jan 21 12:20:33 srvprod postfix/smtps/smtpd[103280]: connect from unknown[192.241.227.25]
Jan 21 12:20:33 srvprod postfix/smtps/smtpd[103280]: SSL_accept error from unknown[192.241.227.25]: -1
Jan 21 12:20:33 srvprod postfix/smtps/smtpd[103280]: warning: TLS library problem: error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:331:
Jan 21 12:20:33 srvprod postfix/smtps/smtpd[103280]: lost connection after CONNECT from unknown[192.241.227.25]
Jan 21 12:20:33 srvprod postfix/smtps/smtpd[103280]: disconnect from unknown[192.241.227.25] commands=0/0
Jan 21 12:22:16 srvprod postfix/qmgr[103224]: A5B3322C1197: from=<>, size=3634, nrcpt=1 (queue active)
Jan 21 12:22:16 srvprod postfix/qmgr[103224]: A4F6B22C10B2: from=<>, size=2550, nrcpt=1 (queue active)
Jan 21 12:22:16 srvprod postfix/qmgr[103224]: A3DBB22C12A8: from=<>, size=5404, nrcpt=1 (queue active)
Jan 21 12:22:16 srvprod postfix/qmgr[103224]: A4C4122C12BB: from=<>, size=5389, nrcpt=1 (queue active)
Jan 21 12:22:16 srvprod postfix/qmgr[103224]: A628122C10C2: from=<>, size=5405, nrcpt=1 (queue active)
Jan 21 12:22:16 srvprod postfix/pipe[103289]: A5B3322C1197: to=<root@srvprod@obierti.com>, relay=dovecot, delay=300, delays=300/0.02/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:22:16 srvprod postfix/pipe[103290]: A4F6B22C10B2: to=<seb31t@srvprod@obierti.com>, relay=dovecot, delay=300, delays=300/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:22:16 srvprod postfix/pipe[103292]: A3DBB22C12A8: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=300, delays=300/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:22:16 srvprod postfix/pipe[103294]: A4C4122C12BB: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=300, delays=300/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:22:16 srvprod postfix/pipe[103297]: A628122C10C2: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=300, delays=300/0.02/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:27:16 srvprod postfix/qmgr[103224]: A5B3322C1197: from=<>, size=3634, nrcpt=1 (queue active)
Jan 21 12:27:16 srvprod postfix/qmgr[103224]: A4F6B22C10B2: from=<>, size=2550, nrcpt=1 (queue active)
Jan 21 12:27:16 srvprod postfix/qmgr[103224]: A3DBB22C12A8: from=<>, size=5404, nrcpt=1 (queue active)
Jan 21 12:27:16 srvprod postfix/qmgr[103224]: A4C4122C12BB: from=<>, size=5389, nrcpt=1 (queue active)
Jan 21 12:27:16 srvprod postfix/qmgr[103224]: A628122C10C2: from=<>, size=5405, nrcpt=1 (queue active)
Jan 21 12:27:16 srvprod postfix/pipe[103318]: A5B3322C1197: to=<root@srvprod@obierti.com>, relay=dovecot, delay=600, delays=600/0.02/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:27:16 srvprod postfix/pipe[103319]: A4F6B22C10B2: to=<seb31t@srvprod@obierti.com>, relay=dovecot, delay=600, delays=600/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:27:16 srvprod postfix/pipe[103321]: A3DBB22C12A8: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=600, delays=600/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:27:16 srvprod postfix/pipe[103323]: A4C4122C12BB: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=600, delays=600/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )
Jan 21 12:27:16 srvprod postfix/pipe[103326]: A628122C10C2: to=<www-data@srvprod@obierti.com>, relay=dovecot, delay=600, delays=600/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 46: Unknown setting: auth_mecanisms )

Merci

Dernière modification par Sebastien31T (Le 21/01/2023, à 13:33)

Hors ligne

#7 Le 21/01/2023, à 17:48

Sebastien31T

Re : Serveur de mail virtuel

Le mieux serait de poster mes fichiers:
pour postfix:
main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name 
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_cert_file=/etc/dovecot/private/dovecot.pem 
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_key_file=/etc/dovecot/private/dovecot.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_auth_only=yes

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination

myhostname = srvprod.obierti.com
#alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases

# configuration virtuelle
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:997
virtual_gid_maps = static:8
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf, mysql:/etc/postfix/mysql_virtual_mailbox_domainalias_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf, mysql:/etc/postfix/mysql_virtual_domainalias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domain_maps.cf
dovecot_destination_recipient_limit = 1
virtual_transport = dovecot

myorigin = /etc/mailname
mydestination = localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

content_filter = smtp-amavis:[127.0.0.1]:10024
compatibility_level = 2

pour 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
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
#submission inet n       -       -       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -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
  -o content_filter=
  -o receive_override_options=no_header_body_checks
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}
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -d ${recipient}
smtp-amavis     unix    -       -       -       -       2       smtp
        -o smtp_data_done_timeout=1200
        -o smtp_send_xforward_command=yes
        -o disable_dns_lookups=yes
        -o max_use=20

127.0.0.1:10025 inet    n       -       -       -       -       smtpd
        -o content_filter=
        -o local_recipient_maps=
        -o relay_recipient_maps=
        -o smtpd_restriction_classes=
        -o smtpd_delay_reject=no
        -o smtpd_client_restrictions=permit_mynetworks,reject
        -o smtpd_helo_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o smtpd_data_restrictions=reject_unauth_pipelining
        -o smtpd_end_of_data_restrictions=
        -o mynetworks=127.0.0.0/8
        -o smtpd_error_sleep_time=0
        -o smtpd_soft_error_limit=1001
        -o smtpd_hard_error_limit=1000
        -o smtpd_client_connection_count_limit=0
        -o smtpd_client_connection_rate_limit=0
        -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

pour les connexion mysql:

user = postfixadmin
password = *********************
hosts = 127.0.0.1:5588
dbname = postfixadmin
table = alias
select_field = goto
where_field = address
additional_conditions = AND active = 1

Pour dovecot voici le fichier local.conf:

mail_location = maildir:/home/vmail/%d/%n

mail_uid=vmail
mail_gid=mail

first_valid_uid = 997
last_valid_uid = 997

first_valid_gid = 8
last_valid_gid = 8

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

userdb {
  driver = static
  args = uid=997 gid=8 home=/home/vmail/%d/%n
}

default_internal_user = dovecot

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

  # Postfix smtp-auth
  unix_listener /var/spool/postfix/private/auth {
   mode = 0660
   user = postfix
   group = postfix
  }

  # Auth process is run as this user.
  user = $default_internal_user
}

service auth-worker {
  user = $default_internal_user
}

dovecot sql:

cat  /etc/dovecot/local-sql.conf.ext 
# Database driver: mysql, pgsql, sqlite
driver = mysql

connect = host=localhost dbname=postfixadmin user=postfixadmin password=Bmwmpowerm3917=$*m
default_pass_scheme = MD5-CRYPT

# passdb query to retrieve the password. It can return fields:
#   password - The user's password. This field must be returned.
#   user - user@domain from the database. Needed with case-insensitive lookups.
#   username and domain - An alternative way to represent the "user" field.
#
# The "user" field is often necessary with case-insensitive lookups to avoid
# e.g. "name" and "nAme" logins creating two different mail directories. If
# your user and domain names are in separate fields, you can return "username"
# and "domain" fields instead of "user".
#
# The query can also return other fields which have a special meaning, see
# http://wiki2.dovecot.org/PasswordDatabase/ExtraFields
#
# Commonly used available substitutions (see http://wiki2.dovecot.org/Variables
# for full list):
#   %u = entire user@domain
#   %n = user part of user@domain
#   %d = domain part of user@domain
# 
# Note that these can be used only as input to SQL query. If the query outputs
# any of these substitutions, they're not touched. Otherwise it would be
# difficult to have eg. usernames containing '%' characters.
#
# Example:
#   password_query = SELECT userid AS user, pw AS password \
#     FROM users WHERE userid = '%u' AND active = 'Y'
#
password_query = \
  SELECT username as user , password \
  FROM mailbox WHERE username = '%u' AND active = 1

# userdb query to retrieve the user information. It can return fields:
#   uid - System UID (overrides mail_uid setting)
#   gid - System GID (overrides mail_gid setting)
#   home - Home directory
#   mail - Mail location (overrides mail_location setting)
#
# None of these are strictly required. If you use a single UID and GID, and
# home or mail directory fits to a template string, you could use userdb static
# instead. For a list of all fields that can be returned, see
# http://wiki2.dovecot.org/UserDatabase/ExtraFields
#
# Examples:
#   user_query = SELECT home, uid, gid FROM users WHERE userid = '%u'
#   user_query = SELECT dir AS home, user AS uid, group AS gid FROM users where userid = '%u'
#   user_query = SELECT home, 501 AS uid, 501 AS gid FROM users WHERE userid = '%u'
#
#user_query = \
#  SELECT home, uid, gid \
#  FROM users WHERE username = '%n' AND domain = '%d'

# If you wish to avoid two SQL lookups (passdb + userdb), you can use
# userdb prefetch instead of userdb sql in dovecot.conf. In that case you'll
# also have to return userdb fields in password_query prefixed with "userdb_"
# string. For example:
#password_query = \
#  SELECT userid AS user, password, \
#    home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
#  FROM users WHERE userid = '%u'

# Query to get a list of all usernames.
#iterate_query = SELECT username AS user FROM users

et voivi le log

Jan 21 16:47:23 srvprod postfix/postfix-script[123630]: stopping the Postfix mail system
Jan 21 16:47:23 srvprod postfix/master[121766]: terminating on signal 15
Jan 21 16:47:24 srvprod postfix/postfix-script[123760]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Jan 21 16:47:24 srvprod postfix/postfix-script[123925]: starting the Postfix mail system
Jan 21 16:47:24 srvprod postfix/master[123927]: daemon started -- version 3.4.13, configuration /etc/postfix
Jan 21 16:47:24 srvprod dovecot: master: Warning: Killed with signal 15 (by pid=123934 uid=0 code=kill)
Jan 21 16:47:25 srvprod dovecot: master: Dovecot v2.3.7.2 (3c910f64b) starting up for imap, lmtp, sieve, pop3 (core dumps disabled)

Merci pourlecture et votre aide.
Sébastien

Hors ligne

#8 Le 21/01/2023, à 18:20

bruno

Re : Serveur de mail virtuel

Dans la configuration de postfix :

  -o smtpd_client_restrictions=$mua_client_restrictions
  -o smtpd_helo_restrictions=$mua_helo_restrictions
  -o smtpd_sender_restrictions=$mua_sender_restrictions

mais je ne vois aucun endroit on sont définies les variables $mua_****

Dans la configuration de dovecot on voit aussi $default_internal_user mais on ne sait pas où elle est définie et dans le précédent extrait des logs il ya avit une erreur à la ligne 46 de ce fichier, qui entre temps a disparu…

Le fichier censé permettre d’interroger la base MySQL me semble étrange : port mysql exotique et une syntaxe pour de très vielle versions de Postfix… Lire http://www.postfix.org/MYSQL_README.html

Et on sait toujours pas ce qui fonctionne et ce qui ne fonctionne pas…

#9 Le 21/01/2023, à 19:02

Sebastien31T

Re : Serveur de mail virtuel

Merci bruno pour tes commentaires j'ai tenter de réppondre à touttes tres remarques et voici ce que ca donne:
postfif master:

cat 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
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
#submission inet n       -       -       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -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
  -o content_filter=
  -o receive_override_options=no_header_body_checks
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}
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -d ${recipient}
smtp-amavis     unix    -       -       -       -       2       smtp
        -o smtp_data_done_timeout=1200
        -o smtp_send_xforward_command=yes
        -o disable_dns_lookups=yes
        -o max_use=20

127.0.0.1:10025 inet    n       -       -       -       -       smtpd
        -o content_filter=
        -o local_recipient_maps=
        -o relay_recipient_maps=
        -o smtpd_restriction_classes=
        -o smtpd_delay_reject=no
        -o smtpd_client_restrictions=permit_mynetworks,reject
        -o smtpd_helo_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o smtpd_data_restrictions=reject_unauth_pipelining
        -o smtpd_end_of_data_restrictions=
        -o mynetworks=127.0.0.0/8
        -o smtpd_error_sleep_time=0
        -o smtpd_soft_error_limit=1001
        -o smtpd_hard_error_limit=1000
        -o smtpd_client_connection_count_limit=0
        -o smtpd_client_connection_rate_limit=0
        -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

pour  $default_internal_user:

cat /etc/dovecot/local.conf 
mail_location = maildir:/home/vmail/%d/%n

mail_uid=vmail
mail_gid=mail

first_valid_uid = 997
last_valid_uid = 997

first_valid_gid = 8
last_valid_gid = 8

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

userdb {
  driver = static
  args = uid=997 gid=8 home=/home/vmail/%d/%n
}

$default_internal_user = dovecot

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

  # Postfix smtp-auth
  unix_listener /var/spool/postfix/private/auth {
   mode = 0660
   user = postfix
   group = postfix
  }

  # Auth process is run as this user.
  user = $default_internal_user
}

service auth-worker {
  user = $default_internal_user
}

Pour la base de données j'ai remis 3306 par deffaut et modifier les fichiers de coonf mysql

cat mysql_virtual_alias_maps.cf 
user = postfixadmin
password = *************************
hosts = 127.0.0.1
dbname = postfixadmin
table = alias
select_field = goto
where_field = address
additional_conditions = AND active = 1

j'ai tout redemarer et voici le log:

Jan 21 18:01:45 srvprod postfix/postfix-script[129575]: stopping the Postfix mail system
Jan 21 18:01:45 srvprod postfix/master[128648]: terminating on signal 15
Jan 21 18:01:46 srvprod postfix/postfix-script[129705]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Jan 21 18:01:46 srvprod postfix/postfix-script[129870]: starting the Postfix mail system
Jan 21 18:01:46 srvprod postfix/master[129872]: daemon started -- version 3.4.13, configuration /etc/postfix
Jan 21 18:01:46 srvprod postfix/qmgr[129874]: 5BAE722C112A: from=<contact@obierti.com>, size=507, nrcpt=1 (queue active)
Jan 21 18:01:46 srvprod postfix/smtp[129876]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Jan 21 18:01:46 srvprod postfix/smtp[129876]: 5BAE722C112A: to=<obierti.sebastien@gmail.com>, relay=none, delay=8685, delays=8685/0/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

Merci pour votre lecture.
Sébastien

Hors ligne

#10 Le 21/01/2023, à 19:57

bruno

Re : Serveur de mail virtuel

Dans main.cf :

content_filter = smtp-amavis:[127.0.0.1]:10024

dans master.cf :

smtp-amavis     unix    -       -       -       -       2       smtp
[…]
127.0.0.1:10025 inet    n       -       -       -       -       smtpd

Essaie d'expliquer en détail a quoi servent ces lignes. En quoi est-ce incohérent ?

#11 Le 21/01/2023, à 20:24

Sebastien31T

Re : Serveur de mail virtuel

Tu peux le trouver dans le guide d'ubuntu
Doc ubuntu
J'ai suivi cette doc

Dernière modification par Sebastien31T (Le 21/01/2023, à 21:22)

Hors ligne

#12 Le 22/01/2023, à 08:24

bruno

Re : Serveur de mail virtuel

Ok je demandais une explication car je ne les comprenais pas et cela me paraissait incohérent. Apparemment le client (smtp) est bien en écoute sur le port 10024 par défaut.

Cela n'explique donc pas cette erreur :

connect to 127.0.0.1[127.0.0.1]:10024: Connection refused

Il faut vérifier si le démon amavis fonctionne avec quelque chose comme :

systemctl status amavis

et vérifier si il est bien en écoute avec quelque chose comme :

sudo ss -lnpt | grep amavis

#13 Le 22/01/2023, à 09:16

Sebastien31T

Re : Serveur de mail virtuel

Bonjour j'ai démara amavis:

sudo systemctl start amavis

Pour ta deuxieme commande j'ai enlever le grep car pas de résultat:

sudo ss -lnpt
State              Recv-Q             Send-Q                         Local Address:Port                          Peer Address:Port            Process                                                                                                                          
LISTEN             0                  100                                  0.0.0.0:25                                 0.0.0.0:*                users:(("master",pid=151810,fd=13))                                                                                             
LISTEN             0                  50                                   0.0.0.0:445                                0.0.0.0:*                users:(("smbd",pid=1120,fd=48))                                                                                                 
LISTEN             0                  70                                 127.0.0.1:33060                              0.0.0.0:*                users:(("mysqld",pid=127986,fd=21))                                                                                             
LISTEN             0                  4096                               127.0.0.1:10024                              0.0.0.0:*                users:(("/usr/sbin/amavi",pid=169702,fd=6),("/usr/sbin/amavi",pid=169701,fd=6),("/usr/sbin/amavi",pid=169700,fd=6))             
LISTEN             0                  100                                127.0.0.1:10025                              0.0.0.0:*                users:(("master",pid=151810,fd=117))                                                                                            
LISTEN             0                  151                                127.0.0.1:3306                               0.0.0.0:*                users:(("mysqld",pid=127986,fd=103))                                                                                            
LISTEN             0                  5                                  127.0.0.1:10026                              0.0.0.0:*                users:(("clamsmtpd",pid=19648,fd=3))                                                                                            
LISTEN             0                  50                                   0.0.0.0:139                                0.0.0.0:*                users:(("smbd",pid=1120,fd=49))                                                                                                 
LISTEN             0                  4096                               127.0.0.1:783                                0.0.0.0:*                users:(("spamd child",pid=168373,fd=6),("spamd child",pid=168372,fd=6),("spamd",pid=168371,fd=6))                               
LISTEN             0                  4096                                 0.0.0.0:10000                              0.0.0.0:*                users:(("miniserv.pl",pid=1735,fd=5))                                                                                           
LISTEN             0                  100                                  0.0.0.0:465                                0.0.0.0:*                users:(("master",pid=151810,fd=18))                                                                                             
LISTEN             0                  128                                  0.0.0.0:5589                               0.0.0.0:*                users:(("sshd",pid=944,fd=3))                                                                                                   
LISTEN             0                  4096                           127.0.0.53%lo:53                                 0.0.0.0:*                users:(("systemd-resolve",pid=830,fd=13))                                                                                       
LISTEN             0                  100                                     [::]:25                                    [::]:*                users:(("master",pid=151810,fd=14))                                                                                             
LISTEN             0                  511                                        *:443                                      *:*                users:(("apache2",pid=160342,fd=6),("apache2",pid=160341,fd=6),("apache2",pid=160340,fd=6),("apache2",pid=986,fd=6))            
LISTEN             0                  50                                      [::]:445                                   [::]:*                users:(("smbd",pid=1120,fd=46))                                                                                                 
LISTEN             0                  4096                                   [::1]:10024                                 [::]:*                users:(("/usr/sbin/amavi",pid=169702,fd=7),("/usr/sbin/amavi",pid=169701,fd=7),("/usr/sbin/amavi",pid=169700,fd=7))             
LISTEN             0                  50                                      [::]:139                                   [::]:*                users:(("smbd",pid=1120,fd=47))                                                                                                 
LISTEN             0                  4096                                   [::1]:783                                   [::]:*                users:(("spamd child",pid=168373,fd=5),("spamd child",pid=168372,fd=5),("spamd",pid=168371,fd=5))                               
LISTEN             0                  511                                        *:80                                       *:*                users:(("apache2",pid=160342,fd=4),("apache2",pid=160341,fd=4),("apache2",pid=160340,fd=4),("apache2",pid=986,fd=4))            
LISTEN             0                  100                                     [::]:465                                   [::]:*                users:(("master",pid=151810,fd=19))                                                                                             
LISTEN             0                  128                                     [::]:5589                                  [::]:*                users:(("sshd",pid=944,fd=4))     

et le log:

Jan 22 08:09:16 srvprod amavis[169691]: starting. /usr/sbin/amavisd-new at srvprod.obierti.com amavisd-new-2.11.0 (20160426), Unicode aware, LC_ALL="C", LANG="fr_FR.UTF-8"
Jan 22 08:09:16 srvprod amavis[169700]: Net::Server: Group Not Defined.  Defaulting to EGID '128 128'
Jan 22 08:09:16 srvprod amavis[169700]: Net::Server: User Not Defined.  Defaulting to EUID '120'
Jan 22 08:09:16 srvprod amavis[169700]: No $altermime,         not using it
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .lrz, tried: lrzip -q -k -d -o -, lrzcat -q -k
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .lzo, tried: lzop -d
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .rpm, tried: rpm2cpio.pl, rpm2cpio
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .rar, tried: unrar-free
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .arj, tried: arj, unarj
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .zoo, tried: zoo
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .doc, tried: ripole
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .cab, tried: cabextract
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .zip, tried: 7za, 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .kmz, tried: 7za, 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .jar, tried: 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .arj, tried: 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .rar, tried: 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .swf, tried: 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .lha, tried: 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .iso, tried: 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .cab, tried: 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .rpm, tried: 7z
Jan 22 08:09:16 srvprod amavis[169700]: No ext program for   .exe, tried: unrar-free; arj, unarj
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .F   
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .arj 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .cab 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .doc 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .exe 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .iso 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .jar 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .lha 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .lrz 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .lzo 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .rar 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .rpm 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .swf 
Jan 22 08:09:16 srvprod amavis[169700]: No decoder for       .zoo 
Jan 22 08:09:16 srvprod amavis[169700]: Using primary internal av scanner code for ClamAV-clamd
Jan 22 08:09:16 srvprod amavis[169700]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
Jan 22 08:13:52 srvprod postfix/qmgr[156285]: 3214F22C10B8: from=<www-data@obierti.com>, size=3329, nrcpt=1 (queue active)
Jan 22 08:13:52 srvprod postfix/pipe[169801]: 3214F22C10B8: to=<contact@obierti.com>, relay=dovecot, delay=50903, delays=50903/0.02/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/local.conf line 22: Unknown setting: $default_internal_user )

merciri Bruno

Dernière modification par Sebastien31T (Le 22/01/2023, à 09:20)

Hors ligne

#14 Le 22/01/2023, à 09:38

bruno

Re : Serveur de mail virtuel

Amavis semble bien en écoute sur les ports 10024 et 10025. Mais il y a de nouveau une erreur de configuration dovecot :

Error in configuration file /etc/dovecot/local.conf line 22: Unknown setting: $default_internal_user

#15 Le 22/01/2023, à 10:07

Sebastien31T

Re : Serveur de mail virtuel

Bonjour desole un  "$" en trop

voici le nouveau log:

Jan 22 09:23:26 srvprod postfix/postfix-script[172971]: stopping the Postfix mail system
Jan 22 09:23:26 srvprod postfix/master[172356]: terminating on signal 15
Jan 22 09:23:27 srvprod postfix/postfix-script[173101]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Jan 22 09:23:27 srvprod postfix/postfix-script[173266]: starting the Postfix mail system
Jan 22 09:23:27 srvprod postfix/master[173268]: daemon started -- version 3.4.13, configuration /etc/postfix
Jan 22 09:23:27 srvprod postfix/qmgr[173270]: 3214F22C10B8: from=<www-data@obierti.com>, size=3329, nrcpt=1 (queue active)
Jan 22 09:23:27 srvprod dovecot: master: Warning: Killed with signal 15 (by pid=173276 uid=0 code=kill)
Jan 22 09:23:28 srvprod dovecot: auth: Error: auth worker: Aborted USER request for contact@obierti.com: Worker process died unexpectedly
Jan 22 09:23:28 srvprod dovecot: log(172378): Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Jan 22 09:23:28 srvprod dovecot: log(172378): Warning: Shutting down logging for 'auth: ' with 1 clients
Jan 22 09:23:38 srvprod dovecot: lda(contact@obierti.com)<173278><>: Error: auth-master: userdb lookup(contact@obierti.com): Disconnected unexpectedly
Jan 22 09:23:38 srvprod dovecot: lda: Fatal: Internal error occurred. Refer to server log for more information.
Jan 22 09:23:38 srvprod postfix/pipe[173277]: 3214F22C10B8: to=<contact@obierti.com>, relay=dovecot, delay=55089, delays=55078/0.02/0/11, dsn=4.3.0, status=deferred (temporary failure. Command output: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:104: protocol { ssl_listen } has been replaced by service { inet_listener { address } } lda(contact@obierti.com): Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denied )
Jan 22 09:23:38 srvprod dovecot: master: Dovecot v2.3.7.2 (3c910f64b) starting up for imap, pop3, lmtp, sieve, pop3 (core dumps disabled)
Jan 22 09:23:38 srvprod dovecot: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf
Jan 22 09:23:38 srvprod dovecot: doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:104: protocol { ssl_listen } has been replaced by service { inet_listener { address } }
Jan 22 09:23:38 srvprod dovecot: config: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf
Jan 22 09:23:38 srvprod dovecot: config: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:104: protocol { ssl_listen } has been replaced by service { inet_listener { address } }
Jan 22 09:23:38 srvprod amavis[173308]: starting. /usr/sbin/amavisd-new at srvprod.obierti.com amavisd-new-2.11.0 (20160426), Unicode aware, LC_ALL="C", LANG="fr_FR.UTF-8"
Jan 22 09:23:39 srvprod amavis[173317]: Net::Server: Group Not Defined.  Defaulting to EGID '128 128'
Jan 22 09:23:39 srvprod amavis[173317]: Net::Server: User Not Defined.  Defaulting to EUID '120'
Jan 22 09:23:39 srvprod amavis[173317]: No $altermime,         not using it
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .lrz, tried: lrzip -q -k -d -o -, lrzcat -q -k
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .lzo, tried: lzop -d
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .rar, tried: unrar-free
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .zoo, tried: zoo
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .doc, tried: ripole
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .cab, tried: cabextract
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .zip, tried: 7za, 7z
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .kmz, tried: 7za, 7z
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .jar, tried: 7z
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .rar, tried: 7z
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .swf, tried: 7z
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .lha, tried: 7z
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .iso, tried: 7z
Jan 22 09:23:39 srvprod amavis[173317]: No ext program for   .cab, tried: 7z
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .F   
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .cab 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .doc 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .iso 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .jar 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .lha 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .lrz 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .lzo 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .rar 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .swf 
Jan 22 09:23:39 srvprod amavis[173317]: No decoder for       .zoo 
Jan 22 09:23:39 srvprod amavis[173317]: Using primary internal av scanner code for ClamAV-clamd
Jan 22 09:23:39 srvprod amavis[173317]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan

Dernière modification par Sebastien31T (Le 22/01/2023, à 10:26)

Hors ligne

#16 Le 22/01/2023, à 11:10

Sebastien31T

Re : Serveur de mail virtuel

Bonjour Bruno,
Je viens de tester avec mon client mail evolution  et je recoit bien les messages.
Mais quand je les écris un mail je n'arrive pas a l'envoyer

RCPT TO <obierti.sebastien@gmail.com> a échoué : <obierti.sebastien@gmail.com>: Recipient address rejected: Access denied

Merci pour ton aide

Dernière modification par Sebastien31T (Le 22/01/2023, à 11:46)

Hors ligne

#17 Le 22/01/2023, à 19:16

Sebastien31T

Re : Serveur de mail virtuel

Petite correction, je ne peux qu'envoyer des messages qu à d'autres messageries du serveur.
Hors de mon serveur, je reçois un mail de non délivery classique.
voici le mail de refus:

Reporting-MTA: dns; srvprod.obierti.com
X-Postfix-Queue-ID: 3762022C1474
X-Postfix-Sender: rfc822; contact@foyer-rural-aussonne.fr
Arrival-Date: Sun, 22 Jan 2023 19:02:58 +0000 (UTC)

Final-Recipient: rfc822; nawal.obierti@gmail.com
Original-Recipient: rfc822;nawal.obierti@gmail.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [78.117.238.81] The IP you're using to send
    mail is not authorized to 550-5.7.1 send email directly to our servers.
    Please use the SMTP relay at your 550-5.7.1 service provider instead. Learn
    more at 550 5.7.1  https://support.google.com/mail/?p=NotAuthorizedError
    z2-20020a7bc7c2000000b003d032f9ed3asi7519556wmk.132 - gsmtp

Comment faire pour que mon serveur communique avec d'autres adresses hors de mon serveur ?

Dernière modification par Sebastien31T (Le 22/01/2023, à 20:06)

Hors ligne

#18 Le 23/01/2023, à 09:33

bruno

Re : Serveur de mail virtuel

Je vois toujours des avertissements concernant dovecot et des éléments de configuration obsolètes… J'ai l'impression que tu as suivi un vieux tuto d'il y a au moins dix ans.

Je pense l'avoir déjà dit mais la configuration d'un serveur de courriel complet : MTA+ MDA + filtres antispam / antivirus et une tâche complexe qui demande de bonnes compétences en matière d'administration système. Il faut a minima être capable de comprendre les erreurs et avertissements dans les logs et de faire les corrections en conséquence avec les docs officielles (en anglais désolé) sous la main :

http://www.postfix.org/documentation.html
https://doc.dovecot.org/

Si tu suis des tutos sans les comprendre et être capable de les adapter tu n'y arrivera jamais.

Le retour d'erreur de la part de Gmail est assez clair ton IPv4 est « blacklistée » par les SMTP de Goggle.
Chercher un monter un serveur de courriel sur une connexion via un FAI grand public ajoute encore des difficultés et de la complexité. C'est mêmme parfois impossible avec certains FAI :

spamhaus.org a écrit :

Vous êtes listés par SPAMHAUS à la demande de NEUF-Cegetel. Votre adresse IP appartient à une plage dynamique et de ce fait ne doit pas envoyer de mail directement et nous vous conseillons d'envoyer vos mails via les serveur de NEUF-Cegetel (smtp.neuf.fr).

Vous trouverez toutes les informations nécessaires à la configuration de votre logiciel de messagerie en suivant ce lien http://assistance.neuf.fr.

Vous pouvez retirer vous même votre IP des listes de SPAMHAUS en cliquant sur le bouton "Remove an IP from PBL".

Si vous souhaitez des informations sur les raisons de cette politique vous pouvez adresser un mail à securiteinternet-abuse@info.sfr.com

Dernière modification par bruno (Le 23/01/2023, à 09:40)

#19 Le 09/02/2023, à 20:00

Sebastien31T

Re : Serveur de mail virtuel

Bonjour à tous, le port 25 était bien bloque par mon fai.
Et maintenant tout fonctionne.
Bonne soirée a tous.
Sébastien

Hors ligne