Verificamos que myhostname sea igual al que configuramos
myhostname = PC-ABAJO
Comentamos las lineas
#smtp_tls_security_level=may
#relayhost =
#inet_interfaces = all
Agregamos al final
# Enable auth
smtp_sasl_auth_enable = yes
# Set username and password
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
# Turn on tls encryption
smtp_tls_security_level = may
header_size_limit = 4096000
# Set external SMTP relay host here IP or hostname accepted along with a port number.
relayhost = [smtp.office365.com]:587
# accept email from our web-server only
inet_interfaces = 127.0.0.1
sender_canonical_maps = regexp:/etc/postfix/sender_canonical
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
smtp_always_send_ehlo = yes
RESULTADO
# 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/mailnamesmtpd_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 = 4hreadme_directory = no# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on# fresh installs.compatibility_level = 3.6# TLS parameterssmtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pemsmtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.keysmtpd_tls_security_level=maysmtp_tls_CApath=/etc/ssl/certs#smtp_tls_security_level=maysmtp_tls_session_cache_database = btree:${data_directory}/smtp_scachesmtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destinationmyhostname = PC-ABAJOalias_maps = hash:/etc/aliasesalias_database = hash:/etc/aliasesmydestination = $myhostname, PC-ABAJO, localhost.localdomain, , localhost#relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128mailbox_size_limit = 0recipient_delimiter = +#inet_interfaces = allinet_protocols = ipv4# Enable authsmtp_sasl_auth_enable = yes
# Set username and password
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
# Turn on tls encryption
smtp_tls_security_level = may
header_size_limit = 4096000
# Set external SMTP relay host here IP or hostname accepted along with a port number.
relayhost = [smtp.office365.com]:587
# accept email from our web-server only
inet_interfaces = 127.0.0.1
sender_canonical_maps = regexp:/etc/postfix/sender_canonical
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
smtp_always_send_ehlo = yes
Reiniciamos el servicio
systemctl stop postfix
systemctl start postfix
systemctl status postfix
Verificamos que el servicio esta esperando en el puerto 25