10 DNS-запросов для одной SPF-записи

10 DNS-запросов для одной SPF-записи 01Интересное ограничение существует в RFC 7208 относительно протокола SPF и заключается оно в выполнении максимум 10 DNS-запросов для одной записи. Иными словами, если внутри SPF-записи присутствует много DNS-зависимых директив, по которым проверяющий сервер должен делать дополнительные запросы, то после достижения 10 запросов вы получите ошибку.

В статье ниже проверим как это ограничение работает на практике.


Если вам интересна тематика почтовых серверов, рекомендую обратиться к соответствующей рубрике на моем блоге — Mail Servers.


10 DNS-запросов для одной SPF-записи

SPF-запись защищает нас от подделки адреса отправителя, позволяя авторизовать отправляющий сервер. То есть, определить разрешено ли данному серверу отправлять почту для домена, указанного в заголовке MAIL FROM или в приветствии HELO/EHLO. С точки зрения оценки спам-рейтинга сообщения функционал очень полезный, хоть он и не рассчитан на принятие однозначного решения о блокировке по результатам проверки.

Прочитать подробнее о SPF вы можете в основной статье — SPF-запись для почтового сервера. Также рекомендую к изучению:

А я перехожу к небольшой порции теории.

Теория

После получения SPF-записи для домена необходимо извлечь из неё список ip-адресов, с которых разрешена рассылка почты. Если вся запись состоит из директив ip4/ip6, то процесс на этом и заканчивается (ведь они уже содержат адреса/подсети в чистом виде). Если же внутри записи присутствуют DNS-зависимые директивы (include, a, mx, ptr, exists), то необходимо выполнить дополнительные запросы к сервису DNS.

Все бы ничего, но протокол явно ограничивает максимально допустимое количество DNS-запросов для одной записи SPF 1:

SPF implementations MUST limit the total number of those terms to 10 during SPF evaluation, to avoid unreasonable load on the DNS.

Разумеется это сделано во благо, но для администраторов почтовых сервисов (в особенности распределенных, со сложной топологией) это ограничение заставляет с умом подходить к процессу создания и поддержки SPF-записи.

Рекомендации

Исходя из ограничений протокола, большинство рекомендаций вполне очевидны, но есть и некоторые нюансы, которые заставляют быть более внимательными.

  • Первая и главная рекомендация — поддерживайте SPF-запись настолько короткой, насколько это возможно.
  • Располагайте директивы ip4/ip6 в начале записи, а остальное — в конце.
  • И последняя — если включаете в запись директиву mx, то примите во внимание, что А-записи, на которые указывает MX, тоже входят в лимит 10 запросов DNS на одну SPF.

Если говорить о лимитах, то не лишним будет напомнить, что для создания TXT-записей существует ограничение в 255 символов, в которое вы можете упереться раньше, чем в 10 DNS-зависимых директив. Тем не менее, оно легко обходится 2 путем создания составной записи.

Проверка

Лично мне захотелось проверить последнее ограничение на практике и я создал MX-запись, которая указывает на кучу А-записей.

Примечание: если быть более точным, то 16. Маловероятно, что у кого-то найдется в продакшене инфраструктура с таким количеством принимающих серверов, но моя цель в другом — проверить ограничение SPF.

MX выглядит вот так:

Из всех записей только mail.bq-srv.ru указывает на реальный сервер, а остальные вообще не существуют, но это неважно.

А это SPF:

Если попробовать отправить почту с этого сервера, то она будет успешно доставлена. Возможно попадет в спам, но принимающий сервер вероятнее всего её пропустит. Попробуем:

Почему spf=pass?!

Важно помнить, что DNS-сервер будет выдавать записи в разном порядке и именно в таком виде их будет обрабатывать проверяющий SPF-запись сервер. Если mail.bq-srv.ru окажется выше десятой позиции, то spf=pass, если ниже, то spf=fail. Повторим попытку и будем надеяться, что в этот раз «повезет»:

Вот теперь получили что ожидали — spf=permerror, как и написано в RFC:

SPF implementations MUST limit the total number of those terms to 10 during SPF evaluation, to avoid unreasonable load on the DNS. If this limit is exceeded, the implementation MUST return «permerror».

Если перед записью MX внутри SPF у вас будут любые другие DNS-зависимые директивы, то на лимит в 10 записей вы нарветесь быстрее. В любом случае, если вдруг будете попадать на spf=permerror, вспомните об этом ограничении (а если попросите у принимающей стороны логи, то увидите ошибку — Mechanisms used too many DNS lookups). Успехов!

comments powered by HyperComments
uf thesis and dissertation
2022-07-05 14:21:26
<strong>writing dissertation proposal https://professionaldissertationwriting.org/</strong>
writing acknowledgement dissertation
2022-07-05 17:32:19
<strong>best dissertation writing https://professionaldissertationwriting.com/</strong>
phd dissertation writing service
2022-07-05 21:31:43
<strong>electronic engineering dissertation ideas https://helpwithdissertationwritinglondon.com/</strong>
phd dissertation writing help
2022-07-05 23:26:41
<strong>writing a dissertation abstract https://dissertationwritingcenter.com/</strong>
average dissertation length
2022-07-06 02:40:54
<strong>bestdissertation https://dissertationhelpexpert.com/</strong>
writing a dissertation prospectus
2022-07-06 05:09:15
<strong>masters dissertation https://accountingdissertationhelp.com/</strong>
dissertation writing fellowships
2022-07-06 07:57:30
<strong>citing a dissertation https://examplesofdissertation.com/</strong>
english dissertation help
2022-07-06 13:06:40
<strong>cheap dissertation help https://bestdissertationwritingservice.net/</strong>
dissertation meaning
2022-07-06 15:03:42
<strong>professional writing service https://businessdissertationhelp.com/</strong>
dissertation service
2022-07-06 17:59:45
<strong>all but dissertation https://customdissertationwritinghelp.com/</strong>
writing an abstract for a dissertation
2022-07-06 21:18:13
<strong>writing a phd dissertation https://writingadissertationproposal.com/</strong>
dissertation help service
2022-07-06 23:24:55
<strong>dissertation uk help https://dissertationhelpspecialist.com/</strong>
write your dissertation
2022-07-07 03:03:05
<strong>dissertation writing help https://dissertationhelperhub.com/</strong>
party casino online nj
2022-07-25 18:33:28
<strong>online casino reviews #1 site for best online casinos https://download-casino-slots.com/</strong>
best online casino bonuses
2022-07-25 20:44:29
<strong>free online casino slots https://firstonlinecasino.org/</strong>
riversweeps online casino
2022-07-26 00:03:08
<strong>inferno casino online https://onlinecasinofortunes.com/</strong>
online casino canada real money
2022-07-26 02:34:22
<strong>online casino no deposit bonus keep what you win https://newlasvegascasinos.com/</strong>
online casino free play
2022-07-26 05:19:57
<strong>online free casino https://trust-online-casino.com/</strong>
best online casino deposit bonus
2022-07-26 06:52:24
<strong>casino online terpercaya https://onlinecasinosdirectory.org/</strong>
online casino no deposit bonus keep what you win
2022-07-26 09:42:03
<strong>gta online casino https://9lineslotscasino.com/</strong>
mgm grand online casino michigan
2022-07-26 12:08:45
<strong>online casino las vegas https://free-online-casinos.net/</strong>
parx casino online gambling
2022-07-26 14:06:03
<strong>online casino royal https://internet-casinos-online.net/</strong>
online casino suomi
2022-07-26 18:32:12
<strong>online casino that accepts echeck https://cybertimeonlinecasino.com/</strong>
free online casino
2022-07-26 19:31:43
<strong>online casino games real money https://1freeslotscasino.com/</strong>
caesar casino online nj
2022-07-26 22:06:20
<strong>casino games free online https://vrgamescasino.com/</strong>
betmgm online casino nj
2022-07-27 01:10:56
<strong>zone casino online https://casino-online-roulette.com/</strong>
best online casino fast payout
2022-07-27 05:09:49
<strong>winstar online social casino https://casino-online-jackpot.com/</strong>
meadows casino online
2022-07-27 07:34:10
<strong>san manuel online casino promo codes https://onlineplayerscasino.com/</strong>
empire city casino online
2022-07-27 10:32:29
<strong>online casino bonuses https://ownonlinecasino.com/</strong>
top online casino bonuses
2022-07-27 12:16:40
<strong>online casino free play https://all-online-casino-games.com/</strong>
online casino no deposit free spin
2022-07-27 16:00:15
<strong>vegas casino online $100 no deposit bonus codes 2021 https://casino8online.com/</strong>
vpn free mac
2022-08-07 17:06:36
<strong>free vpn usa https://shiva-vpn.com/</strong>
free mac vpn
2022-08-07 22:28:27
<strong>best and cheapest vpn https://ippowervpn.net/</strong>
hola vpn download free
2022-08-08 03:43:20
<strong>best vpn for business https://superfreevpn.net/</strong>
proton vpn free trial
2022-08-08 05:13:25
<strong>trust zone vpn https://free-vpn-proxy.com/</strong>
business class vpn
2022-08-08 07:25:45
<strong>free vpn for ipad https://rsvpnorthvalley.com/</strong>
gay dating virginia
2022-08-23 14:53:04
<strong>gay dating sites in nc https://gay-singles-dating.com/</strong>
gay white men dating black men
2022-08-23 16:17:10
<strong>black gay dating sites https://gayedating.com/</strong>
gay dating site
2022-08-23 18:11:59
<strong>gay man, straight man dating https://datinggayservices.com/</strong>
100% free dating sites no fees
2022-08-24 13:06:34
<strong>pof login online https://freephotodating.com/</strong>
skycouger gf
2022-08-24 14:44:01
<strong>free local singles login https://onlinedatingbabes.com/</strong>
international dating site usa
2022-08-24 17:09:29
<strong>online websites https://adult-singles-online-dating.com/</strong>
online dating sites free chatting
2022-08-24 20:45:43
<strong>free personals site https://adult-classifieds-online-dating.com/</strong>
online meeting sites
2022-08-25 00:02:01
<strong>lesbian mature https://speedatingwebsites.com/</strong>
free dating sites for men and women
2022-08-25 02:02:22
<strong>best online dating and chatrooms travel https://datingpersonalsonline.com/</strong>
our time dating website
2022-08-25 07:25:51
<strong>date internet site https://lavaonlinedating.com/</strong>
free singles
2022-08-25 09:55:57
<strong>connect singles https://freeadultdatingpasses.com/</strong>
erotic dating sites
2022-08-25 12:47:42
<strong>online dating sites free chatting https://virtual-online-dating-service.com/</strong>
meet singles online
2022-08-25 13:46:30
<strong>online site https://zonlinedating.com/</strong>
skip the games dating site free
2022-08-25 16:12:57
<strong>topchatsites chat https://onlinedatingservicesecrets.com/</strong>
online casino usa real money
2022-08-30 10:15:15
<strong>fastest payout online casino https://onlinecasinos4me.com/</strong>
mobile online casino
2022-08-30 11:35:15
<strong>casino gambling online https://online2casino.com/</strong>
sacramento gay chat
2022-09-03 00:08:34
<strong>gay chat phone line locker https://newgaychat.com/</strong>
free gay chat avenue #1
2022-09-03 06:35:23
<strong>gay universe chat https://gaychatcams.net/</strong>
free gay web cam chat rooms
2022-09-03 08:55:32
<strong>chat with gay stranger https://gaychatspots.com/</strong>
gay video cam chat
2022-09-03 16:51:37
<strong>easy gay chat https://gay-live-chat.net/</strong>
gay chat app for android
2022-09-03 21:18:16
<strong>google zoom gay chat room https://chatcongays.com/</strong>
free gay chat line live
2022-09-03 23:59:11
<strong>fcn free gay chat free chat network https://gayphillychat.com/</strong>
gay chat room
2022-09-04 08:15:35
<strong>gay chat room in my area https://gaychatnorules.com/</strong>
best free gay chat for curious
2022-09-04 09:53:24
<strong>gay masturbate chat https://gaymusclechatrooms.com/</strong>
gay teen chat room
2022-09-04 18:19:23
<strong>bbrt gay chat site https://free-gay-sex-chat.com/</strong>
ontario calif gay chat room
2022-09-05 00:03:57
<strong>nc gay free chat room https://gayinteracialchat.com/</strong>
help with writing paper
2022-10-20 18:13:43
<strong>do my paper for me https://term-paper-help.org/</strong>
paper writing services for college students
2022-10-20 19:10:11
<strong>paper writing services best https://sociologypapershelp.com/</strong>
write my biology paper
2022-10-20 22:42:16
<strong>pay someone to write a paper https://paperwritinghq.com/</strong>
help write my paper
2022-10-21 00:55:58
<strong>buy custom papers online https://write-my-paper-for-me.org/</strong>
help me with my paper
2022-10-21 04:09:34
<strong>buying college papers online https://top100custompapernapkins.com/</strong>
custom paper writing
2022-10-21 06:50:42
<strong>buy school papers online https://cheapcustompaper.org/</strong>
pay to write my paper
2022-10-21 07:33:43
<strong>how to write my paper https://writingpaperservice.net/</strong>
custom paper service
2022-10-21 09:26:30
<strong>buying college papers online https://buyessaypaperz.com/</strong>
writer paper
2022-10-21 10:20:36
<strong>where can you buy resume paper https://mypaperwritinghelp.com/</strong>
paper writers college
2022-10-21 12:08:54
<strong>writer paper https://writemypaperquick.com/</strong>
custom written college papers
2022-10-21 13:38:29
<strong>pay for someone to write your paper https://essaybuypaper.com/</strong>
buy college papers
2022-10-21 14:51:06
<strong>help writing paper https://papercranewritingservices.com/</strong>
order custom papers
2022-10-21 15:44:03
<strong>help me with my paper https://premiumpapershelp.com/</strong>
where to buy college papers
2022-10-21 18:39:36
<strong>custom written college papers https://studentpaperhelp.com/</strong>
2bloodhound
2023-01-26 19:37:04
<strong>2insoluble</strong>
coursework on a resume
2023-02-05 14:44:46
<strong>coursework plagiarism https://brainycoursework.com/</strong>
help with coursework
2023-02-05 16:27:40
<strong>online coursework https://courseworkninja.com/</strong>
coursework samples
2023-02-05 17:13:24
<strong>coursework service https://writingacoursework.com/</strong>
do my coursework for me
2023-02-05 19:15:41
<strong>coursework paper https://mycourseworkhelp.net/</strong>
courseworks help
2023-02-05 20:53:23
<strong>cpa coursework https://courseworkdownloads.com/</strong>
coursework samples
2023-02-05 23:17:06
<strong>coursework support https://coursework-expert.com/</strong>
design technology coursework
2023-02-06 00:12:33
<strong>do my coursework for me https://teachingcoursework.com/</strong>
hinge dating
2023-02-08 13:27:33
<strong>best free online dating websites https://freewebdating.net/</strong>
dating site online
2023-02-08 14:46:32
<strong>top dating online sites https://jewish-dating-online.net/</strong>
meet online
2023-02-08 16:33:48
<strong>new singles online https://free-dating-sites-free-personals.com/</strong>
online dating sites free chatting
2023-02-08 17:48:02
<strong>dating site asian https://sexanddatingonline.com/</strong>
best dating site usa
2023-02-08 20:05:30
<strong>local online dating https://onlinedatingsuccessguide.com/</strong>
best singles sites
2023-02-08 21:08:16
<strong>asian dating https://onlinedatinghunks.com/</strong>
dating service
2023-02-08 23:53:41
<strong>senior dating site https://allaboutdatingsites.com/</strong>
single senior dating sites
2023-02-09 01:22:47
<strong>free app for online meeting https://freedatinglive.com/</strong>
free chatting online dating sites
2023-02-09 02:10:50
<strong>single chat sites https://freewebdating.net/</strong>
Яндекс.Метрика