Author Topic: apply DMARC ให้กับระบบ domain ที่ใช้ส่งเมล ของคุณ  (Read 10575 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Background

Email authentication technologies SPF and DKIM were developed over a decade ago in order to provide greater assurance on the identity of the sender of a message. Adoption of these technologies has steadily increased but the problem of fraudulent and deceptive emails has not abated. It would seem that if senders used these technologies, then email receivers would easily be able to differentiate the fraudulent messages from the ones that properly authenticated to the domain. Unfortunately, it has not worked out that way for a number of reasons.

    Many senders have a complex email environment with many systems sending email, often including 3rd party service providers. Ensuring that every message can be authenticated using SPF or DKIM is a complex task, particularly given that these environments are in a perpetual state of flux.
    If a domain owner sends a mix of messages, some of which can be authenticated and others that can’t, then email receivers are forced to discern between the legitimate messages that don’t authenticate and the fraudulent messages that also don’t authenticate. By nature, spam algorithms are error prone and need to constantly evolve to respond to the changing tactics of spammers. The result is that some fraudulent messages will inevitably make their way to the end user’s inbox.
    Senders get very poor feedback on their mail authentication deployments. Unless messages bounce back to the sender, there is no way to determine how many legitimate messages are being sent that can’t be authenticated or even the scope of the fraudulent emails that are spoofing the sender’s domain. This makes troubleshooting mail authentication issues very hard, particularly in complex mail environments.
    Even if a sender has buttoned down their mail authentication infrastructure and all of their legitimate messages can be authenticated, email receivers are wary to reject unauthenticated messages because they cannot be sure that there is not some stream of legitimate messages that are going unsigned.

The only way these problems can be addressed is when senders and receivers share information with each other. Receivers supply senders with information about their mail authentication infrastructure while senders tell receivers what to do when a message is received that does not authenticate.

In 2007, PayPal pioneered this approach and worked out a system with Yahoo! Mail and later Gmail to collaborate in this fashion. The results were extremely effective, leading to a significant decrease in suspected fraudulent email purported to be from PayPal being accepted by these receivers.

The goal of DMARC is to build on this system of senders and receivers collaborating to improve mail authentication practices of senders and enable receivers to reject unauthenticated messages.

Anatomy of a DMARC resource record in the DNS

DMARC policies are published in the DNS as text (TXT) resource records (RR) and announce what an email receiver should do with non-aligned mail it receives.

Consider an example DMARC TXT RR for the domain “sender.dmarcdomain.com” that reads:
"v=DMARC1;p=reject;pct=100;rua=mailto:postmaster@dmarcdomain.com"
In this example, the sender requests that the receiver outright reject all non-aligned messages and send a report, in a specified aggregate format, about the rejections to a specified address. If the sender was testing its configuration, it could replace “reject” with “quarantine” which would tell the receiver they shouldn’t necessarily reject the message, but consider quarantining it.

DMARC records follow the extensible “tag-value” syntax for DNS-based key records defined in DKIM.
The following chart illustrates some of the available tags:

Tag Name    Purpose    Sample
v    Protocol version    v=DMARC1
pct    Percentage of messages subjected to filtering    pct=20
ruf    Reporting URI for forensic reports    ruf=mailto:authfail@example.com
rua    Reporting URI of aggregate reports    rua=mailto:aggrep@example.com
p    Policy for organizational domain    p=quarantine
sp    Policy for subdomains of the OD    sp=reject
adkim    Alignment mode for DKIM    adkim=s
aspf    Alignment mode for SPF    aspf=r

NOTE: The examples in this chart are illustrative only and should not be relied upon in lieu of the specification. Please refer to the specification page for the most up-to-date and accurate version.
How Senders Deploy DMARC in 5-Easy Steps

DMARC has been designed based on real-world experience by some of the world’s largest email senders and receivers deploying SPF and DKIM. The specification takes into account the fact that it is nearly impossible for an organization to flip a switch to production. There are a number of built-in methods for “throttling” the DMARC processing so that all parties can ease into full deployment over time.

    Deploy DKIM & SPF. You have to cover the basics, first.
    Ensure that your mailers are correctly aligning the appropriate identifiers.
    Publish a DMARC record with the “none” flag set for the policies, which requests data reports.
    Analyze the data and modify your mail streams as appropriate.
    Modify your DMARC policy flags from “none” to “quarantine” to “reject” as you gain experience.


#reference
http://dmarc.org/overview/

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ต่อไปนี้เป็นตัวอย่างของระเบียน DMARC TXT (_dmarc.your_domain.com IN TXT) ที่คุณสามารถปรับเปลี่ยนเพื่อนำไปใช้งานได้ โปรดแทนที่ "your_domain.com" และ "postmaster@your_domain.com" ด้วยโดเมนและที่อยู่อีเมลจริงของคุณ

ในระเบียน TXT ตัวอย่างต่อไปนี้ ถ้ามีข้อความที่อ้างว่ามาจาก domain.com ของคุณและไม่ผ่านการตรวจสอบ DMARC จะไม่มีการดำเนินการใดๆ แต่ข้อความเหล่านี้ทั้งหมดจะปรากฏในรายงานสรุปรวมรายวันที่ส่งถึง "postmaster@your_domain.com"
"v=DMARC1; p=none; rua=mailto:postmaster@your_domain.com"

ในระเบียน TXT ตัวอย่างถัดไป ถ้าข้อความอ้างว่ามาจาก domain.com ของคุณและไม่ผ่านการตรวจสอบ DMARC จะมีการกักเก็บไว้ 5% ของทั้งหมด จากนั้นส่งอีเมลรายงานสรุปรวมรายวันไปที่ "postmaster@your_domain.com"
"v=DMARC1; p=quarantine; pct=5; rua=mailto:postmaster@your_domain.com"

ในตัวอย่างสุดท้าย ถ้าข้อความอ้างว่ามาจาก "your_domain.com" และไม่ผ่านการตรวจสอบ DMARC จะปฏิเสธ 100% ของทั้งหมด จากนั้นส่งอีเมลรายงานสรุปรวมรายวันไปที่ "postmaster@your_domain.com" และ "dmarc@your_domain.com"
"v=DMARC1; p=reject; rua=mailto:postmaster@your_domain.com, mailto:dmarc@your_domain.com"

##Special thank you content from Google App mail.
https://support.google.com/a/answer/2466563?hl=th
« Last Edit: พฤษภาคม 28, 2015, 12:10:39 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ทำให้ใช้งานได้ทีละน้อย

เราขอแนะนำให้เพิ่มการใช้งาน DMARC ช้าๆ โดยใช้นโยบายเหล่านี้ตามลำดับนี้ ขั้นแรก ติดตามการรับส่งและมองหาความผิดปกติในรายงาน เช่น ข้อความที่ยังไม่ได้ลงชื่อ หรืออาจมีการแอบอ้าง จากนั้นเมื่อคุณพอใจกับผลลัพธ์แล้ว ให้เปลี่ยนการตั้งค่านโยบายของระเบียน TXT จาก "none" เป็น "quarantine" แล้วตรวจทานผลลัพธ์อีกครั้ง ทั้งในที่เก็บสแปมและในรายงาน DMARC รายวัน ขั้นสุดท้าย เมื่อคุณมั่นใจว่าข้อความทั้งหมดของคุณมีการลงชื่อแล้ว ให้เปลี่ยนการตั้งค่านโยบายเป็น "reject" เพื่อใช้ประโยชน์จาก DMARC อย่างสมบูรณ์ ดูรายงานซ้ำเพื่อให้มั่นใจว่าผลลัพธ์เป็นที่ยอมรับได้

ในทำนองเดียวกัน คุณสามารถใช้แท็ก pct เพื่อเป็นพื้นที่ทำงานชั่วคราวและเก็บตัวอย่างสำหรับการทำให้ DMARC ใช้งานได้ เนื่องจากค่าเริ่มต้นคือ 100% การส่งค่า "pct=20" ในระเบียน DMARC TXT จะส่งผลให้ข้อความที่ได้รับผลกระทบจากนโยบายเพียงหนึ่งในห้าของทั้งหมดเท่านั้นที่จะได้รับการจัดการ แทนที่จะเป็นข้อความทั้งหมด การตั้งค่านี้มีประโยชน์มากเมื่อคุณเลือกที่จะกักเก็บและปฏิเสธอีเมล เริ่มต้นด้วยค่าเปอร์เซ็นต์ต่ำๆ และเพิ่มขึ้นทุก 2-3วัน

วัฏจักรการทำให้ใช้งานได้แบบช้าๆ จะมีลักษณะดังนี้:

    ตรวจติดตามทั้งหมด => p=none
    กักเก็บ or pct 1% => p=quarantine,pct=1
    กักเก็บ 5%
    กักเก็บ 10%
    กักเก็บ 25%
    กักเก็บ 50%
    กักเก็บทั้งหมด
    ปฏิเสธ 1%
    ปฏิเสธ 5%
    ปฏิเสธ 10%
    ปฏิเสธ 25%
    ปฏิเสธ 50% => p=reject,pct=50
    ปฏิเสธทั้งหมด => p=reject

พยายามนำค่าเปอร์เซ็นต์ออกโดยเร็วที่สุดเพื่อให้การทำให้ใช้งานได้สมบูรณ์
และตรวจทานรายงานรายวันเสมอ


##Special thank you content from Google App mail.
https://support.google.com/a/answer/2466563?hl=th
« Last Edit: พฤษภาคม 28, 2015, 12:10:51 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
#add spf then test confirm syntax
http://www.kitterman.com/getspf2.py

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: apply DMARC ให้กับระบบ domain ที่ใช้ส่งเมล ของคุณ
« Reply #4 on: กุมภาพันธ์ 09, 2018, 08:46:42 AM »
implement DMARC on directadmin
https://help.directadmin.com/item.php?id=596

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: apply DMARC ให้กับระบบ domain ที่ใช้ส่งเมล ของคุณ
« Reply #5 on: กุมภาพันธ์ 09, 2018, 08:53:36 PM »
การตั้งค่า โดเมนเพื่อให้ใช้งาน DMARC function ได้ใน zone file ของ domain ตอนแอด โดเมนใหม่
สมมติโดเมนใหม่ของเราเป็น packetlove.com ดังนั้นเราต้อง
ทำการสร้าง spam-reports@packetlove.com ก่อนนะครับ

#cd /usr/local/directadmin/data/templates/custom
#cp ../dns_txt.conf .

and then add the record you want to the bottom of the custom/dns_txt.conf by running this command:
#echo '_dmarc="v=DMARC1; p=none; sp=none; rua=mailto:spam-reports@|DOMAIN|"' >> dns_txt.conf

keeping in mind that this assumes you've got a spam-reports account created already.