As follows

smtpd_recipient_restrictions =
        reject_invalid_hostname,
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        reject_unknown_sender_domain,
        reject_unknown_recipient_domain,
        reject_unauth_pipelining,
        check_recipient_access hash:/etc/postfix/access,
        permit_mynetworks,
    reject_authenticated_sender_login_mismatch 
mysql:/etc/postfix/mysql-sender-access.cf    
        reject_unauth_destination

mysql-sender-access.cf

hosts = localhost
user = USER
password = PASS
dbname = system

query = SELECT username FROM mailboxes WHERE email='%s' AND active='1'

The error returned is:

RECEIVER ADDRESS (The server responded: "5.7.1 <SENDER ADDRESS>: Sender 
address rejected: not owned by user SASL USER")

What;s going on? Running the query directly against the SQL database returns 
the desired result.

Reply via email to