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 17/04/2021, à 04:44

kfcsogood

Postfix : relay access denied

Bonsoir,

J'ai récemment fait face a des problèmes tel qu'ajouté une authentification sasl + tls.
cependant mon problème est lorsque j'essaye d'envoyer un mail à un destinataire via externe je reçois ce message:

/var/log/mail.log:

postfix/smtpd[21677]: Anonymous TLS connection established from X: TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)
postfix/smtpd[21677]: warning: X: SASL ntlm authentication failed: authentication failure
vps-66934 postfix/smtpd[21677]: warning: SASL authentication problem: unknown password verifier(s) saslauthd?#saslauthd_path: /var/run/saslauthd/mux?mech_list: PLAIN LOGIN
vps-66934 postfix/smtpd[21677]: warning: X: SASL login authentication failed: no mechanism available
postfix/smtpd[21677]: NOQUEUE: reject: RCPT from X: 554 5.7.1 <utilisateurX@yahoo.com>: Relay access denied; from=<user@mondomaine.net> to=<utilisateurX@yahoo.com> proto=ESMTP helo=<Test>
postfix/smtpd[21677]: lost connection after RCPT from X

je n'ai pas d'idée ou de solution a ce problème j'ai essayé de chercher des topic lié au problème mais sa ne résolue toujours pas le mien hmm


Voici mes configuration liée a 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 (Ubuntu)
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

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

smtpd_tls_key_file = /etc/letsencrypt/live/mondomain.net/privkey.pem
smtpd_tls_cert_file = /etc/letsencrypt/mondomain.net/fullchain.pem

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

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.


#smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
#smtpd_recipient_restrictions = permit_sasl_authenticated,
# permit_mynetworks,
# reject_unauth_destination,
# reject_unknown_sender_domain,
# reject_unknown_client,
# reject_rbl_client zen.spamhaus.org,
# reject_rbl_client bl.spamcop.net,
# reject_rbl_client cbl.abuseat.org,
# permit
myhostname = mondomain.net
#canonical_maps = hash:/etc/postfix/canonical
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
#relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
smtpd_sasl_type = cyrus
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
cyrus_sasl_config_path = /etc/postfix/sasl
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtp_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtputf8_enable=no
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

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)   (no)    (never) (100)
# ==========================================================================
smtp      inet  n       -       y       -       -       smtpd
#smtp      inet  n       -       y       -       -       smtpd
#smtp      inet  n       -       y       -       1       postscreen
#smtpd     pass  -       -       y       -       -       smtpd
#dnsblog   unix  -       -       y       -       0       dnsblog
#tlsproxy  unix  -       -       y       -       0       tlsproxy
submission inet n       -       y       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_tls_auth_only=yes
  -o smtpd_sasl_security_options=noanonymous
#  -o broken_sasl_auth_clients=yes
#  -o content_filter=dksign:[127.0.0.1]:12028
#  -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       -       y       -       -       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       -       y       -       -       qmqpd
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
        -o syslog_name=postfix/$service_name
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       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}

/etc/default/saslauthd

#
# Settings for saslauthd daemon
# Please read /usr/share/doc/sasl2-bin/README.Debian for details.
#

# Should saslauthd run automatically on startup? (default: no)
START=yes

# Description of this saslauthd instance. Recommended.
# (suggestion: SASL Authentication Daemon)
DESC="SASL Authentication Daemon"

# Short name of this saslauthd instance. Strongly recommended.
# (suggestion: saslauthd)
NAME="saslauthd"

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent  -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam       -- use PAM
# rimap     -- use a remote IMAP server
# shadow    -- use the local shadow password file
# sasldb    -- use the local sasldb database file
# ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
#MECHANISMS="pam"
MECHANISMS="pam"
# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5

# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# WARNING: DO NOT SPECIFY THE -d OPTION.
# The -d option will cause saslauthd to run in the foreground instead of as
# a daemon. This will PREVENT YOUR SYSTEM FROM BOOTING PROPERLY. If you wish
# to run saslauthd in debug mode, please run it by hand to be safe.
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page and the output of 'saslauthd -h' for general
# information about these options.
#
# Example for chroot Postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
# Example for non-chroot Postfix users: "-c -m /var/run/saslauthd"
#
# To know if your Postfix is running chroot, check /etc/postfix/master.cf.
# If it has the line "smtp inet n - y - - smtpd" or "smtp inet n - - - - smtpd"
# then your Postfix is running in a chroot.
# If it has the line "smtp inet n - n - - smtpd" then your Postfix is NOT
# running in a chroot.

#OPTIONS="-c -m /var/run/saslauthd"
#OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"
#OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
OPTIONS="-m /var/spool/postfix/var/run/saslauthd"

Pour la partie authentification j'ai suivi ce tuto

Ce que je voudrais c'est pouvoir m'authentifié en externe et que je puisse me connecté a mon propre serveur smtp pour pouvoir envoyé des mails. sans passé par mon serveur en utilisant des commande tel que : echo "..." | mail -s "Sujet" destinataire.

Merci,
d'avoir eu le temps de lire et j'espère avoir une réponse concernant mon problème.

Hors ligne

#2 Le 17/04/2021, à 05:45

iznobe

Re : Postfix : relay access denied

Bonjour , je n' y comprends rien a tout ca mais d' apres les lignes :

postfix/smtpd[21677]: warning: X: SASL ntlm authentication failed: authentication failure
vps-66934 postfix/smtpd[21677]: warning: SASL authentication problem: unknown password verifier(s) saslauthd?#saslauthd_path: /var/run/saslauthd/mux?mech_list: PLAIN LOGIN
vps-66934 postfix/smtpd[21677]: warning: X: SASL login authentication failed: no mechanism available

on dirait que le mechanisme de transmission du mot de passe est en clair et qu ' il attend quelquechose qui devrait etre crypté / chiffré et du coup il ne fait rien .

apres je vois en regardant vite fait , 2 possibilités , soit le mechanism choisi n ' est pas le bon , soit le chemin vers l' executable n ' est pas bon dans " /etc/default/saslauthd " .

dans le tuto partie test pour autentification et paragraphe precedent il y a une autre option de config dans laquelle il est precisé d ' utiliser adduser ???
https://doc.ubuntu-fr.org/postfix#les_tests

il y a une option verbeuse pour la commande : testsaslauthd ? a verifier avec le man si -v correspond a verbeux , ca en dira peut etre plus sur l' origine du probleme d' autentification .

Dernière modification par iznobe (Le 17/04/2021, à 06:00)


retour utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#3 Le 17/04/2021, à 07:40

bruno

Re : Postfix : relay access denied

Bonjour,

Attention la doc postfix n'est vraiment pas à jour, et globalement d'assez mauvaise qualité…

Quoi qu'il en soit il faut se référer à la documentation officielle : http://www.postfix.org/SASL_README.html

Si tu as suivi la doc du wiki ubuntu-fr il faut examiner le contenu du fichier /etc/postfix/sasl/smtpd.conf pour voir la configuration de l’authentification.

Hors ligne

#4 Le 17/04/2021, à 21:39

kfcsogood

Re : Postfix : relay access denied

iznobe a écrit :

Bonjour , je n' y comprends rien a tout ca mais d' apres les lignes :

postfix/smtpd[21677]: warning: X: SASL ntlm authentication failed: authentication failure
vps-66934 postfix/smtpd[21677]: warning: SASL authentication problem: unknown password verifier(s) saslauthd?#saslauthd_path: /var/run/saslauthd/mux?mech_list: PLAIN LOGIN
vps-66934 postfix/smtpd[21677]: warning: X: SASL login authentication failed: no mechanism available

on dirait que le mechanisme de transmission du mot de passe est en clair et qu ' il attend quelquechose qui devrait etre crypté / chiffré et du coup il ne fait rien .

apres je vois en regardant vite fait , 2 possibilités , soit le mechanism choisi n ' est pas le bon , soit le chemin vers l' executable n ' est pas bon dans " /etc/default/saslauthd " .

dans le tuto partie test pour autentification et paragraphe precedent il y a une autre option de config dans laquelle il est precisé d ' utiliser adduser ???
https://doc.ubuntu-fr.org/postfix#les_tests

il y a une option verbeuse pour la commande : testsaslauthd ? a verifier avec le man si -v correspond a verbeux , ca en dira peut etre plus sur l' origine du probleme d' autentification .

J'ai testé l'authentification du saslauthd

root@vps:/etc/postfix# testsaslauthd -s smtp -u utilisateur -p monmondepasse
0: OK "Success."

Il marche parfaitement mais je vois pas le probleme


Voici la conf du smtpd : /etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd
mech_list: plain login cram-md5 digest-md5

/etc/default/saslauthd

#
# Settings for saslauthd daemon
# Please read /usr/share/doc/sasl2-bin/README.Debian for details.
#

# Should saslauthd run automatically on startup? (default: no)
START=yes

# Description of this saslauthd instance. Recommended.
# (suggestion: SASL Authentication Daemon)
DESC="SASL Authentication Daemon"

# Short name of this saslauthd instance. Strongly recommended.
# (suggestion: saslauthd)
NAME="saslauthd"

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent  -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam       -- use PAM
# rimap     -- use a remote IMAP server
# shadow    -- use the local shadow password file
# sasldb    -- use the local sasldb database file
# ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
#MECHANISMS="pam"
MECHANISMS="pam"
# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5

# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# WARNING: DO NOT SPECIFY THE -d OPTION.
# The -d option will cause saslauthd to run in the foreground instead of as
# a daemon. This will PREVENT YOUR SYSTEM FROM BOOTING PROPERLY. If you wish
# to run saslauthd in debug mode, please run it by hand to be safe.
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page and the output of 'saslauthd -h' for general
# information about these options.
#
# Example for chroot Postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
# Example for non-chroot Postfix users: "-c -m /var/run/saslauthd"
#
# To know if your Postfix is running chroot, check /etc/postfix/master.cf.
# If it has the line "smtp inet n - y - - smtpd" or "smtp inet n - - - - smtpd"
# then your Postfix is running in a chroot.
# If it has the line "smtp inet n - n - - smtpd" then your Postfix is NOT
# running in a chroot.

OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

Je sais pas d'où le problème viens.
j'ai essayé de le topic ci-dessus mais sa ne marche toujours pas..

Dernière modification par kfcsogood (Le 17/04/2021, à 21:40)

Hors ligne

#5 Le 18/04/2021, à 06:26

bruno

Re : Postfix : relay access denied

Pour /etc/postfix/sasl/smtpd.conf, il ne faut mettre que PLAIN et LOGIN
voir de la doc donnée en lien en #3 :

doc postfix a écrit :

Do not specify any other mechanisms in mech_list than PLAIN or LOGIN when using saslauthd! It can only handle these two mechanisms, and authentication will fail if clients are allowed to choose other mechanisms.

Si cela ne résout pas le problème, il y peut-être un problème de chroot. Le socket saslauthd est censé être dans l'environnement chroot de postfix mais il ne semble pas accessible d'après l'erreur obtenue.

Je ne vois pas cette commande dans la doc du wiki pour créer et attribuer les bon droits d'accès au socket saslauthd (cf. /usr/share/doc/sasl2-bin/README.Debian.gz)

dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd

Il faut penser à redémarrer les services après toute modification :

sudo systemctl retstart saslauthd
sudo systemctl restart postfix

et à examiner leur état :

sudo systemctl status saslauthd
sudo systemctl status postfix

Hors ligne

#6 Le 18/04/2021, à 22:14

kfcsogood

Re : Postfix : relay access denied

bruno a écrit :

Pour /etc/postfix/sasl/smtpd.conf, il ne faut mettre que PLAIN et LOGIN
voir de la doc donnée en lien en #3 :

doc postfix a écrit :

Do not specify any other mechanisms in mech_list than PLAIN or LOGIN when using saslauthd! It can only handle these two mechanisms, and authentication will fail if clients are allowed to choose other mechanisms.

Si cela ne résout pas le problème, il y peut-être un problème de chroot. Le socket saslauthd est censé être dans l'environnement chroot de postfix mais il ne semble pas accessible d'après l'erreur obtenue.

Je ne vois pas cette commande dans la doc du wiki pour créer et attribuer les bon droits d'accès au socket saslauthd (cf. /usr/share/doc/sasl2-bin/README.Debian.gz)

dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd

Il faut penser à redémarrer les services après toute modification :

sudo systemctl retstart saslauthd
sudo systemctl restart postfix

et à examiner leur état :

sudo systemctl status saslauthd
sudo systemctl status postfix

voici le status du saslauthd

● saslauthd.service - LSB: saslauthd startup script
   Loaded: loaded (/etc/init.d/saslauthd; generated)
   Active: active (running) since Sun 2021-04-18 16:08:40 UTC; 5h 2min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4979 ExecStop=/etc/init.d/saslauthd stop (code=exited, status=0/SUCCESS)
  Process: 4020 ExecReload=/etc/init.d/saslauthd reload (code=exited, status=0/SUCCESS)
  Process: 5016 ExecStart=/etc/init.d/saslauthd start (code=exited, status=0/SUCCESS)
    Tasks: 5 (limit: 1128)
   CGroup: /system.slice/saslauthd.service
           ├─5061 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
           ├─5063 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
           ├─5064 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
           ├─5065 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
           └─5067 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5

Apr 18 16:08:40 vps saslauthd[5061]:                 : listening on socket: /var/spoo
Apr 18 16:08:40 vps saslauthd[5016]:    ...done.
Apr 18 16:08:40 vps saslauthd[5016]:  * Starting SASL Authentication Daemon saslauthd
Apr 18 16:08:40 vps saslauthd[5080]:                 : could not lock pid file /var/s
Apr 18 16:08:40 vps saslauthd[5016]: saslauthd[5079] :Cannot start saslauthd
Apr 18 16:08:40 vps saslauthd[5079]:                 : Cannot start saslauthd
Apr 18 16:08:40 vps saslauthd[5079]:                 : Another instance of saslauthd
Apr 18 16:08:40 vps saslauthd[5016]: saslauthd[5079] :Another instance of saslauthd i
Apr 18 16:08:40 vps saslauthd[5016]:    ...fail!
Apr 18 16:08:40 vps systemd[1]: Started LSB: saslauthd startup script.
lines 1-25/25 (END)

j'ai fait la modification du mechanism en changent par plain login ou login mais sa ne marche toujours pas hmm

Hors ligne

#7 Le 19/04/2021, à 05:15

kfcsogood

Re : Postfix : relay access denied

Voici le nouveau log :

Apr 19 03:XMR91) at Apr 19 03:42:05
Apr 19 03:45:26 vps postfix/anvil[8985]: statistics: max connection count 1 for (smtp:monip) at Apr 19 03:42:05
Apr 19 03:45:26 vps postfix/anvil[8985]: statistics: max cache size 1 at Apr 19 03:42:05
Apr 19 04:03:28 vps postfix/smtpd[8997]: connect from monip
Apr 19 04:03:29 vps postfix/smtpd[8997]: Anonymous TLS connection established from monip: TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)
Apr 19 04:03:29 vps postfix/smtpd[8997]: warning: monip: SASL login authentication failed: authentication failure
Apr 19 04:03:29 vps postfix/smtpd[8997]: NOQUEUE: reject: RCPTmonip: 554 5.7.1 <utilisateur2@yopmail.fr>: Relay access denied; from=<utilisateur@mondomain.net> to=<utilisateur2@yopmail.fr> proto=ESMTP helo=<Test>
Apr 19 04:03:29 vps postfix/smtpd[8997]: lost connection after RCPT from monip
Apr 19 04:03:29 vps postfix/smtpd[8997]: disconnect from monip ehlo=2 starttls=1 auth=0/1 mail=1 rcpt=0/1 commands=4/6

le main.cf:

append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 2
inet_interfaces = all
inet_protocols = ipv4
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = localhost
myhostname = mondomaine.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = cyrus
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/letsencrypt/live/mondomaine.net/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mondomaine.net/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom

le smtpd.conf

pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: PLAIN LOGIN

Je ne comprend toujours pas pourquoi je ne peux pas me connecté sur mon serveur smtp et envoyé.
J'ai attentivement suivi chaque étape de la nouvelle doc merci du lien bruno, Sauf que le problème persiste et je ne sais pas d'où il vient cette fois si.

PS: Je peux envoyé des courriers en local mais pas en extérieur et ce que je voudrais c'est pouvoir me connecté et envoyé aussi en extérieur.

Dernière modification par kfcsogood (Le 19/04/2021, à 05:31)

Hors ligne

#8 Le 19/04/2021, à 06:03

kfcsogood

Re : Postfix : relay access denied

D'accord maintenant j'ai réussi à m'authentifié en mettant mon adresse ip dans mynetworks maintenant je voudrais savoir si c'est possible de faire en sorte que tous le monde peux se connecté sans ajouté les ip sur mynetworks?

Dernière modification par kfcsogood (Le 19/04/2021, à 06:04)

Hors ligne

#9 Le 19/04/2021, à 12:01

bruno

Re : Postfix : relay access denied

Attention à l'ajout d'IP dans mynetworks. Les machines avec ces IP peuvent envoyer des courriels vers n'importe quelle destination sans s’authentifier.

L'erreur n'est plus la même et la configuration a changée, tu utilises maintenant l’authentification via sasldb.
Il semble qu'il s'agisse d'un problème d'utilisateur / mot de passe. Il faut donc tester à nouveau avec cet utilisateur et saslauthd et bien vérifier que ton utilisateur a été créé : cf. http://www.postfix.org/SASL_README.html#auxprop_sasldb

Hors ligne

#10 Le 21/04/2021, à 01:51

kfcsogood

Re : Postfix : relay access denied

bruno a écrit :

Attention à l'ajout d'IP dans mynetworks. Les machines avec ces IP peuvent envoyer des courriels vers n'importe quelle destination sans s’authentifier.

L'erreur n'est plus la même et la configuration a changée, tu utilises maintenant l’authentification via sasldb.
Il semble qu'il s'agisse d'un problème d'utilisateur / mot de passe. Il faut donc tester à nouveau avec cet utilisateur et saslauthd et bien vérifier que ton utilisateur a été créé : cf. http://www.postfix.org/SASL_README.html#auxprop_sasldb

Re, J'avais testé la commande testsaslauthd je reçois un truc du genre "Success Ok." mais lorsque je veux m'authentifié sa ne veux toujours pas puis j'ai utilisé une commandes pour savoir si mes utilisateurs sont bien crée et il y sont.
J'ai suivi le lien indiqué mais sa ne résolue pas mon problème hmm

Hors ligne

#11 Le 21/04/2021, à 06:11

bruno

Re : Postfix : relay access denied

Tu as bien vérifié avec :

sasldblistusers2

et tu vois tes utilisateurs et leur mots de passe ?
Comment essaies-tu d'envoyer ton courriel ? Dans les logs c'est smtpd qui répond alors que ce devrait être submission.
Pourquoi y-a-t-il une directive d’authentification du client Postfix ?

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

Hors ligne

#12 Le 21/04/2021, à 11:08

kfcsogood

Re : Postfix : relay access denied

bruno a écrit :

Tu as bien vérifié avec :

sasldblistusers2

et tu vois tes utilisateurs et leur mots de passe ?
Comment essaies-tu d'envoyer ton courriel ? Dans les logs c'est smtpd qui répond alors que ce devrait être submission.
Pourquoi y-a-t-il une directive d’authentification du client Postfix ?

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

J'utilise plus submission mais smtpd directement
car je rencontre des problèmes avec le port de submission lorsque je telnet il se ferme rapidement + erreur de ssl lorsque j'utilise la commande openssl
alors que le port smtp est configuré et je ne rencontre aucun problème après je sais pas si c'est déconseillé de l'utiliser.

on tapant la commande sasldblistusers2 je reçois :

utilisateur@mondomaine.net: userPassword

Je sais pas si c'est normal que sa m'affiche userPassword et non l'utilisateur et le mot de passe directement.
Pour la directive j'avais suivi un vieux tuto mais vous pensez que sa gêne l'authentification ?

Dernière modification par kfcsogood (Le 21/04/2021, à 11:09)

Hors ligne

#13 Le 21/04/2021, à 12:56

bruno

Re : Postfix : relay access denied

Si tu veux faire du smtp authentifié il faut utiliser submission (port 587) ou smtps (aka submissions port 465), le port 25 (smtp) ne devrait servir que pour la communication entre MTA. On peut faire du SMTP authentifié sur le port 25 mais cela pose plein de problèmes, en particulier le risque de faire circuler les identifiants en clair.

Pour salsdblistusers2, oui c'est normal. Les mots de passe ne sont jamais affichés. La base de données utilisateurs est dans /etc/sasldb2

J'ai l'impression que le problème vient de la méthode utilisée pour tes tests. Si tu utilises uniquement telnet cela va être compliqué…(utilisateur + mot de passe à encoder en base64 avant l'envoi). Essaie avec un client de courriel classique comme mutt ou thunderbird.

Hors ligne