Hi all!

I have a server with postfix with virtual users (using MySQL), it's working ok, let's call it A. I also have a secondary server, which I want to use to send mails even outside my local network, let's call it B. So I'm trying to configure B to relay through A to send e-mails. The problem is I have SMTP auth enabled on A and I'm missing something at the config of B because I get this error:

Jul 23 11:50:41 mail postfix/smtp[9912]: D7429100B65: to=<r...@socks.mydomain.es>, relay=mydomain.es[X.X.X.X.]:25, delay=0.39, delays=0.09/0/0.22/0.08, dsn=5.0.0, status=bounced (host mydomain.es[X.X.X.X.] said: 550-Please turn on SMTP Authentication in your mail client, or login to the 550-IMAP/POP3 server before sending your message. 550-85.155.X.X.X.X (mail.mydomain.es) [X.X.X.X]:60006 is 550 not permitted to relay through this server without authentication. (in reply to RCPT TO command))

1) Relevant A main.cf config:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_security_level = encrypt
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual_identities.cf proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps $smtpd_sender_login_maps
smtpd_error_sleep_time = 2s
smtpd_soft_error_limit = 10
smtpd_hard_error_limit = 20
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks

2) Whole B main.cf config:

config_directory = /etc/postfix
relayhost = 192.168.0.14
myhostname = socks.mydomain.es
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt

Note: 192.168.0.14 is A.

3) Content of /etc/postfix/sasl/passwd:

192.168.0.14 b...@domain.es:password

I'm using mailx command to send mails, for example:

# echo "Bar" | mailx -s "Foo" postfix-...@gmail.com --tls=true

Could someone tell me what am I doing wrong? I thought using 'smtp_sasl_auth_enable' at B would be enough to use SMTP authentication, but it's not happening.

Thank you so much!

Nicolás

Reply via email to