---
title: "Sender Policy Framework（SPF）マクロの解説 | AutoSPF"
description: "Sender Policy FrameworkマクロまたはSPFマクロは、SPFのTXTレコードを最適なメール認証とセキュリティのためにより動的で拡張性の高いものにするために使用されます。"
image: "https://autospf.com/images/og-default.png"
canonical: "https://autospf.com/ja/spf-makuro-no-kaisetsu/"
---

# Sender Policy Framework（SPF）マクロの解説

\[Sender Policy FrameworkマクロまたはSPFマクロ\](https://www.linkedin.com/advice/3/how-do-you-use-spf-macros-simplify-customize-your#:\~:text=SPF%20macros%20are%20a%20powerful,authorized%20IP%20addresses%20or%20hosts.)は、SPFのTXTレコードを最適なメール認証とセキュリティのために\*\*より動的で拡張性の高いもの\*\*にするために使用されます。\_SPFマクロは、SPF検証を受ける各メッセージのメタデータによって置き換えられる文字列を定義します。\_ この概念は、長く複雑な文字列を含まない、簡素化されたSender Policy Frameworkレコードを生成するという考え方を促進します。さまざまな\[SPFレコードの種類\](/blog/complete-guide-to-spf-record-types-6-variations-explained-simply/)を理解することで、マクロを使う価値があるかどうかを判断できます。状況によっては、メカニズム、修飾子、モディファイアだけでは不十分であり、あなたのドメインから送信される可能性のある\[不正なメール\](https://cionews.co.in/phishing-emails-using-adobe-indesign-barracuda/)の取り扱いを受信側サーバーに指示するためにSPFマクロを使わなければならないことがあります。![Sender Policy Framework](https://media.mailhop.org/autospf/images/2023/12/sender-policy-framework.jpg)\[画像の出典\](https://gulfsouthtech.com/phishing/phishing-facts-you-need-to-know-in-2022/)：gulfsouthtech.com これらは\*\*パーセント記号（%）\*\*で表され、2文字以上の文字、モディファイア、区切り文字で構成されます。Sender Policy Frameworkマクロは、受信側での\*\*メール認証の時点で\*\*評価され、対応する値に置き換えられます。 \_\*\*%sと%d\*\*は、それぞれチェック対象のIDに紐付く送信者のアドレスとドメイン名を表します\_。一方、r、l、oなどのモディファイアは、アドレスやドメインの特定の要素を取得するために使用されます。 ## Sender Policy Frameworkマクロの種類 SPFマクロは、\*\*波括弧 { } で囲まれ、パーセント（%）記号が前に付いた\*\*固有の1文字または記号で識別され、\[SPFレコード\](/explaining-sender-policy-framework-spf-macros/spf-record/)内の個別の構成要素を示します。以下が基本的なマクロです。 - \*\*%{s}\*\*：「s」マクロは、Sam@domain.comのように\*\*送信者のメールアドレス\*\*を示します。 - \*\*%{l}\*\*：送信者のローカル部分を示すために使用され、「Sam」のように表されます。 - \*\*%{o}\*\*：送信者のドメインを示し、「domain.com」のように表されます。 - \*\*%{d}\*\*：「o」と同様に、このマクロは\*\*正式な送信ドメイン\*\*を表します。通常は送信者のドメインと同じですが、例外もあります。 - \*\*%{i}\*\*：メッセージ送信者のIPアドレス（例：503.0.123.7）を抽出するために使用されます。 - \*\*%{h}\*\*：「h」マクロは\*\*HELP/EHLOドメイン\*\*を表します。 レコードに指定できるマクロは他にも多数ありますが、ここではよく使われるものをいくつか挙げました。![Spf Record Check 1](https://media.mailhop.org/autospf/images/2023/11/spf-record-check-1.jpg)\## Sender Policy Frameworkマクロのユースケース \[メールセキュリティプロトコル\](https://www.techtarget.com/searchsecurity/answer/What-are-the-most-important-email-security-protocols)に対するドメイン所有者の期待に応えて、SPFマクロはメール認証インフラを整理し、\*\*SPFのTXTレコードのサイズを短縮\*\*できます。ここでは、SPFレコードにマクロが導入される一般的なシナリオをいくつか紹介します。 ### 1\\. 複数ドメインのインフラを持つ企業 SPFマクロは複数のドメインを管理する\[エンタープライズレベルの組織\](https://www.erp-information.com/enterprise-level)に特に適していますが、あらゆる規模の組織にとって有用なツールです。\_マクロは、従来のフラット化技術と比較して、はるかに高い柔軟性を提供し、SPFレコードの効率を高めます。\_ これにより、複雑な\[複数ドメイン環境\](https://www.courier.com/guides/multiple-spf-records/)でも\*\*SPFの円滑な動作\*\*が確保され、複数のSPFレコードを作成する必要がなくなります。従来のフラット化と比べて、マクロは\[DNSルックアップが多すぎる\](/ja/spf-dns-rukkuappu-oosugi/)エラーを回避するのにも役立ちます。 ### 2\\. 大規模なメールインフラ 複雑なメールシステムを扱う組織では、複数のSPFメカニズムを組み込む必要が生じることがありますが、最も効率的な方法はSPFマクロを活用することです。これらのマクロによってメカニズムへの参照を確立でき、SPFレコードが過度に長くなるのを防ぎ、\*\*RFCで定められた512オクテットの制限内に\*\*収めることができます。これを手作業で管理したくないチームには、自動化された\[SPFフラット化サービス\](/ja/home/)がレコードをコンパクトに保ちます。

```json
{"@context":"https://schema.org","@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]},"sameAs":["https://www.wikidata.org/wiki/Q138897474","https://www.linkedin.com/company/autospf","https://x.com/autospf01","https://www.facebook.com/autospf","https://github.com/duocircle","https://www.g2.com/products/autospf/reviews"],"aggregateRating":{"@type":"AggregateRating","ratingValue":"5.0","reviewCount":"21","bestRating":"5","worstRating":"1","url":"https://www.g2.com/products/autospf/reviews"},"contactPoint":{"@type":"ContactPoint","contactType":"customer support","url":"https://autospf.com/contact-us/"},"knowsAbout":["SPF Record Flattening","Sender Policy Framework","Email Authentication","DNS Management","DMARC","DKIM","Email Deliverability","SPF Lookup Limits"]}
```

```json
{"@context":"https://schema.org","@type":"WebSite","name":"AutoSPF","url":"https://autospf.com","description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","publisher":{"@type":"Organization","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]}}}
```

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://autospf.com/"},{"@type":"ListItem","position":2,"name":"Sender Policy Framework（SPF）マクロの解説","item":"https://autospf.com/ja/spf-makuro-no-kaisetsu/"}]}
```
