Articles in this section

Outgoing mail does not work: local data error while talking to smtp.mailexample.com

kb: technical ABT: Group B

Symptoms

  • Emails are not sent from a server

  • Emails are kept at Tools&Settings > Mail Server Settings > Mail Queue

  • No error is shown in mail client interface.

  • Ports 25 and 587 are opened.

  • Trying to send an email the following messages are logged into /var/log/maillog:

    CONFIG_TEXT: example postfix/smtp[18437]: warning: hash:/etc/postfix/password is unavailable. open database /etc/postfix/password.db: No such file or directory
    example postfix/smtp[18437]: warning: hash:/etc/postfix/password lookup error for "smtp.mailexample.com"
    example postfix/smtp[18437]: warning: 61856222BB: smtp_sasl_passwd lookup error
    example postfix/smtp[18437]: 61856222BB: to=john.doe@example.com, relay=smtp.mailexample.com[203.0.113.2]:25, delay=524, delays=522/0.01/1.9/0, dsn=4.3.0, status=deferred (local data error while talking to smtp.mailexample.com[203.0.113.2])

    OR

    CONFIG_TEXT: (delivery temporarily suspended: Host or domain name not found. Name service error for name=domain.name.of.relay.server type=AAAA: Host not found)

  • There is an additional section in main.cf file:

    # cat /etc/postfix/main.cf
    ..
    #MAILCHANNELS
    relayhost = smtp.mailexample.com
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/password
    smtp_sasl_security_options = noanonymous
    smtpd_sasl_authenticated_header = yes
    smtp_tls_security_level = may
    #ENDMAILCHANNELS

  • Such relayhost is not accessible:

    # telnet relay.example.tld 25
    Trying 203.0.113.2...
    telnet: connect to address 203.0.113.2: Connection timed out

Cause

Postfix misconfiguration. Manually configured relayhost is not accessible from the server.

Resolution

  1. Login to the server via SSH.

  2. Open /etc/postfix/main.cf with any text editor, e.g.:

    # vi /etc/postfix/main.cf

  3. Comment MAILCHANNELS section:

    CONFIG_TEXT: #MAILCHANNELS
    #relayhost = smtp.mailexample.com
    #smtp_sasl_auth_enable = yes
    #smtp_sasl_password_maps = hash:/etc/postfix/password
    #smtp_sasl_security_options = noanonymous
    #smtpd_sasl_authenticated_header = yes
    #smtp_tls_security_level = may
    #ENDMAILCHANNELS

  4. Restart postfix service to apply changes:

    # systemctl restart postfix

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.