Hello;
Below is my configuration which is related to the smtp, actually I did not do any configuration for incoming mail because I am only caring to send, so that is why I did not post the configuration that is related to smtpd and I only paste the configuration that is related to smtp:
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_auth_enable = no
#smtpd_sasl_path = private/auth
#smtpd_sasl_type = dovecot
############################################################
# TLS stuff
############################################################
#tls_append_default_CA = no
relay_clientcerts =
#tls_random_source = dev:/dev/urandom
tls_random_source = dev:/dev/urandom
smtp_use_tls = yes
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
#smtp_tls_loglevel = 0
#smtp_enforce_tls = no
smtp_enforce_tls = yes
smtp_tls_CAfile =
#smtp_tls_CApath = /etc/postfix/ssl/cacerts
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_cert_file = /etc/ssl/smtp.cert
smtp_tls_key_file = /etc/ssl/smtp.key
#smtp_tls_session_cache_timeout = 3600s
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
But I am facing the following errors when doing restart for postfix service (service postfix restart) and when trying to send email as following:
When doing restart for postfix service:
Apr 14 03:48:28 vicibox81 systemd[1]: Stopping Postfix Mail Transport Agent...
Apr 14 03:48:28 vicibox81 postfix/postfix-script[24957]: stopping the Postfix mail system
Apr 14 03:48:28 vicibox81 systemd[1]: Stopped Postfix Mail Transport Agent.
Apr 14 03:48:28 vicibox81 systemd[1]: Starting Postfix Mail Transport Agent...
Apr 14 03:48:28 vicibox81 echo[24974]: Starting mail service (Postfix)
Apr 14 03:48:29 vicibox81 postfix/master[25072]: daemon started -- version 3.2.0, configuration /etc/postfix
Apr 14 03:48:29 vicibox81 postfix/qmgr[25074]: F30361049DED: from=<bilal@testdomain.com>, size=460, nrcpt=1 (queue active)
Apr 14 03:48:29 vicibox81 postfix/qmgr[25074]: 23D6E1049EC8: from=<bilal@testdomain.com>, size=460, nrcpt=1 (queue active)
Apr 14 03:48:29 vicibox81 postfix/smtp[25077]: looking for plugins in '/usr/lib64/sasl2', failed to open directory, error: No such file or directory
Apr 14 03:48:29 vicibox81 postfix/smtp[25083]: looking for plugins in '/usr/lib64/sasl2', failed to open directory, error: No such file or directory
Apr 14 03:48:29 vicibox81 systemd[1]: Started Postfix Mail Transport Agent.
Apr 14 03:48:30 vicibox81 postfix/smtp[25077]: warning: SASL authentication failure: No worthy mechs found
Apr 14 03:48:30 vicibox81 postfix/smtp[25077]: F30361049DED: to=<bilmar_gh@yahoo.com>, relay=smtp.testdomain.com[XX.XX.XXX.XXX]:465, delay=2247, delays=2246/0.02/1.4/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.testdomain.com[XX.XX.XXX.XXX]: no mechanism available)
Apr 14 03:48:30 vicibox81 postfix/smtp[25083]: warning: SASL authentication failure: No worthy mechs found
Apr 14 03:48:30 vicibox81 postfix/smtp[25083]: 23D6E1049EC8: to=<bilmar_gh@yahoo.com>, relay=smtp.testdomain.com[XX.XX.XXX.XXX]:465, delay=356, delays=355/0.02/1.5/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.testdomain.com[XX.XX.XXX.XXX]: no mechanism available)
And below log when I am sending the email from the command line using: date | mail -s test -r bilal@testdomain.com bilmar_gh@yahoo.com:
Apr 14 03:58:55 vicibox81 postfix/pickup[25073]: 533DB1049F34: uid=0 from=<bilal@testdomain.com>
Apr 14 03:58:55 vicibox81 postfix/cleanup[26138]: 533DB1049F34: message-id=<5e94fcbf.Jc4zRjEJg78aylAc%bilal@testdomain.com>
Apr 14 03:58:55 vicibox81 postfix/qmgr[25074]: 533DB1049F34: from=<bilal@testdomain.com>, size=460, nrcpt=1 (queue active)
Apr 14 03:58:55 vicibox81 postfix/smtp[26317]: looking for plugins in '/usr/lib64/sasl2', failed to open directory, error: No such file or directory
Apr 14 03:58:56 vicibox81 postfix/smtp[26317]: warning: SASL authentication failure: No worthy mechs found
Apr 14 03:58:56 vicibox81 postfix/smtp[26317]: 533DB1049F34: to=<bilmar_gh@yahoo.com>, relay=smtp.testdomain.com[XX.XX.XXX.XXX]:465, delay=1.3, delays=0.01/0.01/1.3/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.testdomain.com[XX.XX.XXX.XXX]: no mechanism available)
I created the certificates using the below command under the directory /etc/ssl:
sudo openssl req -new -outform PEM -out smtp.cert -newkey rsa:2048 -nodes -keyout smtp.key -keyform PEM -days 365 -x509
So what I am missing?
Regards
Bilal