This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to Block External Recipient to Specific user in Domain Pure Message in Linux

HI Guys, 

 

Does anyone know how to block external user eg  john@contoso.com emails going to the following users internal Domain user@domain.com.au and user1@domain.com.au but allow it to rest of domain users .. 

i had a play around under Puremessage Unix

under Linux Policy --> Policy Rules 

set Mail from external host --> contains --> john@contoso.com.au

execute acttion and ruels --> Reject the message 

Add recipients --> user@domain.com;user1@dmain.com 

save rule 

 

any feedback would be appreciated . cheers 



This thread was automatically locked due to age.
  • Hi,

    sounds like you are looking for a per user mapping, e.g. predefined blacklisted-senders-per-user, rather than a per recipient/sender policy modification (which is at least what I read from your description and steps).

    So, given your example you might put john@contoso.com to the blacklists of user@domain.com.au and user1@domain.com.au, either using the web interface or by looking into using e.g. pmx-list add and have a sender/recipient dependent outcome in some test as:

    address :all :memberof "From" "blacklisted-senders-per-user"
    envelope :memberof "From" "blacklisted-senders-per-user"

    Those tests wrapped up in if anyof (address,envelope) then reject 'blacklisted' at a proper spot in your policy should do the trick.

    Best regards
    Jens

  • Hello Zeljko, 

    Not sure to have understand well your request however please find below my understanding.

    You want to block every message come who from john@contoso.com.au to the following recipients user@domain.com / user1@dmain.com

    If it's what you want to do, the best things could be a rule as follwo: 

    If envelope from or header from is john@contoso.com.au

    if recipient is user@domain.com

    pmx_mark (add value into the log)
    reject the message
    stop

    if recipient is user1@domain.com

    pmx_mark (add value into the log)
    reject the message
    stop

     

    Of course you can create a custom list to add both email addresses, then the rule could be similar : 

    If envelope from or header from is john@contoso.com.au

    if recipient is member of MyCustomList
    pmx_mark (add value into the log)
    reject the message
    stop

    Best regards, 

    --

    Best regards,
    Florian (aka LEFBE)
    Sophos Technical Account Manager