Author Topic: postfix block mail จาก header_check  (Read 5196 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
postfix block mail จาก header_check
« on: กุมภาพันธ์ 04, 2014, 03:52:18 PM »
#main.cf

header_checks = regexp:/etc/postfix/header_checks

The syntax in the header_checks file is:
/regex_pattern/ ACTION

See a full list of possible actions here

I’m doing three things in the example.
– If the sender’s email address starts with “spammer”, then REJECT it.
– If an email is sent to bob on my server, forward it bob’s real email address
– If the subject contains “Viagra” then discard it.

#/etc/postfix/header_checks

/^From: "spammer/ REJECT
/^To: bob@here.com/ REDIRECT bob@there.com
/^Subject:.*viagra/ DISCARD

#postmap header_checks