ispconfig 3.2.12p1 postfix mail relay without authentication not working on some relayhosts

Discussion in 'General' started by Dominik, Jan 9, 2025 at 6:30 PM.

  1. Dominik

    Dominik New Member

    Hello,
    i have a problem on some relay servers. They do not accept the mails from domains.
    at the moment we have set under Specific domains a relay to a outbound gateway:
    Email -> Domain ->Choose Domain
    Relayhost -> Relay Server DNS or IP
    Relayhost User -> Empty
    Relayhost Password -> Empty
    One Relay Server is working but another gateway does not
    warning: SASL authentication failure: All-whitespace username
    SASL authentication failed; cannot authenticate to server: generic failure
    We have entered the sql query in the mysql server:
    SELECT relay_host as relayhost FROM mail_domain WHERE domain = 'domain' AND active = 'y' AND concat(relay_host,relay_user,relay_pass) != '' AND server_id = 1
    If there is no PW and User set we get only the relay_host back.

    nano /etc/postfix/mysql-virtual_sender-relayhost.cf
    user = isp
    password = pw
    dbname = dbname
    hosts = 127.0.0.1
    query = SELECT relay_host as relayhost
    FROM mail_domain WHERE domain = '%d' AND active = 'y' AND concat(relay_host,relay_user,relay_pass) != '' AND server_id = 1

    This works.. but on one server we get the above error.
    Could anyone help?
    Regards
    Dominik
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You could try to change in mysql-virtual_sender-relayhost.cf

    AND concat(relay_host,relay_user,relay_pass) != ''

    to

    AND relay_host != ''

    and in mysql-virtual_sender-relayauth.cf

    AND concat(relay_host,relay_user,relay_pass) != ''

    to

    AND concat(relay_user,relay_pass) != ''

    Just a suggestion, I have not tested this. But this will not return a data set when there is neither a username nor password, which hopefully prevents Postfix from trying to do sasl auth at all in this case.
     
    ahrasis likes this.
  3. Dominik

    Dominik New Member

    Hi Till,
    thanks for the quick help this solved the issue, i think you should check this to implement it to your source.
    I use this to implement Cloud Security Gateway from other vendors for Customers who wants more protection than rspamd does.
    Regards

    Dominik
     
    ahrasis likes this.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

Share This Page