How to blacklist a whole sender domain in postfix?

Discussion in 'General' started by Dehumanizer, Nov 29, 2012.

  1. Dehumanizer

    Dehumanizer New Member

    When I add "@domain.com" in the postfix blacklist configuration as a sender, it does not work, postfix is always searching the whole email in the database, the mysql query goes like this:
    SELECT access FROM mail_access WHERE source='[email protected]' and type = 'sender' and active = 'y' and server_id = 1

    and of course if the record in the database is just @domain.com, the above query does not match it.

    Is there any way how to completely blacklist the whole sender domain?

    Thanks.
     
  2. Dehumanizer

    Dehumanizer New Member

    Nobody? Hmm...
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

  4. Dehumanizer

    Dehumanizer New Member

    Yes, I tried domain.com and also .domain.com
    The problem is that the SQL query always includes the complete email address so no matter what I have in the database it will not match that unless there is a match for complete email address.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then it might be that the other access blocking types are not supported for mysql based access lists. You can en e.g. try to add a second file based access list in postfix for that domain.
     
  6. Dehumanizer

    Dehumanizer New Member

    Strange, I don't know what I've done but it works now (without the leading @, just the domain name has to be in the blacklist to blacklist whole domain)... Well, whatever, at least the problem is solved. Thanks.
     

Share This Page