How to block some domain in ISPConfig???

Discussion in 'Server Operation' started by leeeonardo, Aug 23, 2007.

  1. leeeonardo

    leeeonardo New Member

    I recive lot of email that are trash it, I wannt to block them, for example *@domain.com, and this configuration is distributed to all the mail in my server. I use Centos 4.4 with ISPConfig.

    Thanks a lot.
     
  2. edge

    edge HowtoForge Supporter

    You can do this in /etc/postfix/restrictions

    1) add in the file restrictions (it's in /etc/postfix/) the following
    Code:
    domain.com		REJECT
    anotherdomain.com	REJECT
    2) Now run
    Code:
    postmap /etc/postfix/restrictions
    3) Now reload Postfix with
    Code:
    postfix reload
    After this any email from domain.com and anotherdomain.com will be rejected.

    Please note that everytime when you add, or remove a domain from restrictions, you WILL need to do step 2 and 3 again!
     
    Last edited: Aug 23, 2007
  3. leeeonardo

    leeeonardo New Member

    But this File RESTRICTIONS dont exist, can I create file???
     
  4. leeeonardo

    leeeonardo New Member

    But this file RESTRICTIONS don't exist in /etc/postfix, can I create file????
     
  5. edge

    edge HowtoForge Supporter

    yes you can, but in that case you will need to add the following to /etc/postfix/main.cf

    smtpd_sender_restrictions = hash:/etc/postfix/restrictions

    You will need to restart postfix again after this!
     
    Last edited: Aug 23, 2007
  6. leeeonardo

    leeeonardo New Member

    Ok, I do it. If i wannt to restrict a email, ex. user@domain.com. Can I add to file restrictions????.
     
  7. leeeonardo

    leeeonardo New Member

    I see that many email have diferent domine name, but in the body of the message have a many same words, how can I create a rule for restrict email with the same body and/or subject???. For example, subject: VIAGRA
     
  8. falko

    falko Super Moderator

  9. leeeonardo

    leeeonardo New Member

    I could already make work the Header_checks, but the Body_checks I have not been able to. They could help me giving me a simple example: For example, Body: "Sale of Software", thank you.
     
  10. falko

    falko Super Moderator

    body_checks work exactly the same way as the header_checks.
     
  11. leeeonardo

    leeeonardo New Member

    But in the header_checks, put for example: I write "/^Subject:.*viagra*/ REJECT", if you see "Subject". But how need to write for say "Body"???
    "/^Body:.*viagra*/ REJECT" ????
     
  12. edge

    edge HowtoForge Supporter

    The: "Email reporting spam detected" is only for a note. You can remove it if you like
     

Share This Page