<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SMTP on Nikita Chernyi: Principal Backend Engineer</title><link>https://rakshazi.me/blog/category/smtp/</link><description>Recent content in SMTP on Nikita Chernyi: Principal Backend Engineer</description><generator>Hugo</generator><language>en-us</language><managingEditor>cv@rakshazi.me (Nikita Chernyi)</managingEditor><webMaster>cv@rakshazi.me (Nikita Chernyi)</webMaster><lastBuildDate>Wed, 23 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://rakshazi.me/blog/category/smtp/index.xml" rel="self" type="application/rss+xml"/><item><title>Real-Time Blackhole List (RBL) and DNS Blocklists (DNSBL) for email antispam</title><link>https://rakshazi.me/blog/rbl-dnsbls/</link><pubDate>Tue, 30 Jul 2024 12:56:50 +0300</pubDate><author>cv@rakshazi.me (Nikita Chernyi)</author><guid>https://rakshazi.me/blog/rbl-dnsbls/</guid><description>&lt;p&gt;&lt;em&gt;First published on 2024-07-30.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Buna ziua, dragi cititori!
I continue my journey on building &lt;a href="https://github.com/etkecc/postmoogle"target="_blank" rel="noopener noreferrer"&gt;Postmoogle&lt;span class="sr-only"&gt; (opens in new tab)&lt;/span&gt;&lt;/a&gt; - an SMTP server with &lt;a href="https://matrix.org"target="_blank" rel="noopener noreferrer"&gt;Matrix&lt;span class="sr-only"&gt; (opens in new tab)&lt;/span&gt;&lt;/a&gt; interface we use at &lt;a href="https://etke.cc"target="_blank" rel="noopener noreferrer"&gt;etke.cc&lt;span class="sr-only"&gt; (opens in new tab)&lt;/span&gt;&lt;/a&gt; for email communications.
After discovering &lt;a href="https://rakshazi.me/blog/graylisting-nolisting-unlisting-and-other-annoyances/"&gt;Greylisting, Nolisting, Unlisting, and Other Annoyances&lt;/a&gt;,
and &lt;a href="https://rakshazi.me/blog/dns-rdns-fcrdns/"&gt;Forward Confirmed reverse DNS&lt;/a&gt;, I decided to dive further into the huge hole of email antispam techniques.&lt;/p&gt;
&lt;p&gt;Today&amp;rsquo;s topic is Real-Time Blackhole List (RBL) and DNS Blocklists (DNSBL).&lt;/p&gt;</description></item><item><title>The Definitive Send Email Guide</title><link>https://rakshazi.me/blog/the-definitive-send-email-guide/</link><pubDate>Wed, 15 Feb 2023 17:05:25 +0200</pubDate><author>cv@rakshazi.me (Nikita Chernyi)</author><guid>https://rakshazi.me/blog/the-definitive-send-email-guide/</guid><description>&lt;p&gt;&lt;em&gt;First published on 2023-02-15.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Yā, min&amp;rsquo;na.&lt;/p&gt;
&lt;p&gt;Today you gonna read my Magnum Opus of sending emails. Let&amp;rsquo;s assume you want to send an email from &lt;a href="mailto:sender@example.com"&gt;sender@example.com&lt;/a&gt; to &lt;a href="mailto:recipient@example.net"&gt;recipient@example.net&lt;/a&gt;, that guide will cover communication between SMTP servers (&lt;a href="https://rakshazi.me/blog/smtp-components/"&gt;MTA to MTA&lt;/a&gt;), moreover, for the sake of simplicity the examples will use generic tools instead of some specific programming language snippets.&lt;/p&gt;
&lt;p&gt;So, we&amp;rsquo;re gonna send the following message from &lt;code&gt;sender@example.com&lt;/code&gt; to &lt;code&gt;recipient@example.net&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Hi there,
Did it hit the Spam folder?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here is the high-level algorithm of all actions:&lt;/p&gt;</description></item><item><title>DNS, rDNS, FCrDNS</title><link>https://rakshazi.me/blog/dns-rdns-fcrdns/</link><pubDate>Thu, 24 Nov 2022 23:22:13 +0200</pubDate><author>cv@rakshazi.me (Nikita Chernyi)</author><guid>https://rakshazi.me/blog/dns-rdns-fcrdns/</guid><description>&lt;p&gt;&lt;em&gt;First published on 2022-11-24.&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Sup dawg,
I heard you like DNS, so I put DNS into your DNS so you can query DNS while you querying DNS.&lt;/p&gt;
&lt;p&gt;&amp;ndash; Tibizx&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;Yeah, memes from 2008 to explain &lt;a href="https://www.rfc-editor.org/rfc/rfc1912"target="_blank" rel="noopener noreferrer"&gt;things from 1996&lt;span class="sr-only"&gt; (opens in new tab)&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Anyway, to the topic: what does those acronyms stand for?&lt;/p&gt;
&lt;h2 id="dns"&gt;DNS&lt;/h2&gt;
&lt;p&gt;Domain Name System = convert website domain in the browser&amp;rsquo;s address bar to the actual server&amp;rsquo;s IP where that website hosted.
It&amp;rsquo;s a common thing, so let&amp;rsquo;s move to the next one.&lt;/p&gt;</description></item><item><title>The BCC Is a Lie</title><link>https://rakshazi.me/blog/the-bcc-is-a-lie/</link><pubDate>Sat, 19 Nov 2022 23:15:50 +0200</pubDate><author>cv@rakshazi.me (Nikita Chernyi)</author><guid>https://rakshazi.me/blog/the-bcc-is-a-lie/</guid><description>&lt;p&gt;&lt;em&gt;First published on 2022-11-19.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Hey,
&lt;a href="https://github.com/etkecc/postmoogle"target="_blank" rel="noopener noreferrer"&gt;Postmoogle&lt;span class="sr-only"&gt; (opens in new tab)&lt;/span&gt;&lt;/a&gt; gets new features and bug fixes, while I get new knowledge,
sometimes rather hilarious one. As you know, that whole blog is about &amp;ldquo;raskhazi finds out things and tries to tuck them into the head&amp;rdquo;, so today a new thing &amp;ldquo;clicked&amp;rdquo; in my mind - the BCC (blind carbon copy), the field in an email when you want to hide recipients, is not a header.&lt;/p&gt;</description></item><item><title>Graylisting, Nolisting, Unlisting, and Other Annoyances</title><link>https://rakshazi.me/blog/graylisting-nolisting-unlisting-and-other-annoyances/</link><pubDate>Sun, 13 Nov 2022 22:38:40 +0200</pubDate><author>cv@rakshazi.me (Nikita Chernyi)</author><guid>https://rakshazi.me/blog/graylisting-nolisting-unlisting-and-other-annoyances/</guid><description>&lt;p&gt;&lt;em&gt;First published on 2022-11-13.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;This post is a bit more about citations from other sources with my comments on the topic because the sources provide a pretty clear description of what each topic is and why it was implemented. From my side, I&amp;rsquo;d add why I hate each topic but have to reconcile with them.
Let&amp;rsquo;s roll!&lt;/p&gt;
&lt;h2 id="greylisting"&gt;greylisting&lt;/h2&gt;
&lt;blockquote&gt;&lt;p&gt;Greylisting is a new method of blocking significant amounts of spam at the mailserver level, but without resorting to heavyweight statistical analysis or other heuristical (and error-prone) approaches. Consequently, implementations are fairly lightweight, and may even decrease network traffic and processor load on your mailserver.&lt;/p&gt;</description></item><item><title>Mandatory Email Headers or How to Send Email (into Spam)</title><link>https://rakshazi.me/blog/how-to-send-email-into-spam/</link><pubDate>Sat, 12 Nov 2022 20:44:59 +0200</pubDate><author>cv@rakshazi.me (Nikita Chernyi)</author><guid>https://rakshazi.me/blog/how-to-send-email-into-spam/</guid><description>&lt;p&gt;&lt;em&gt;First published on 2022-11-12.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Hey,
It&amp;rsquo;s time to compose and send the first valid email message!&lt;/p&gt;
&lt;p&gt;First of all, there are several mandatory headers and without any of them your email will be rejected:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MIME-Version&lt;/code&gt; - defines &amp;ldquo;how to parse&amp;rdquo; the thing you sent. It has a hardcoded value of &lt;code&gt;1.0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Content-Type&lt;/code&gt; - defines &amp;ldquo;how to read&amp;rdquo; the email you sent. Usually, values are &lt;code&gt;text/html&lt;/code&gt; or &lt;code&gt;text/plain&lt;/code&gt; (and &lt;code&gt;charset=&amp;quot;UTF-8&amp;quot;&lt;/code&gt;, because we all ❤️ emojis)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Content-Transfer-Encoding&lt;/code&gt; - kinda duplicate of &lt;code&gt;Content-Type&lt;/code&gt;&amp;rsquo;s &lt;code&gt;charset&lt;/code&gt;, so value &lt;code&gt;7bit&lt;/code&gt; == ASCII and value &lt;code&gt;8bit&lt;/code&gt; == Unicode&lt;/li&gt;
&lt;li&gt;&lt;code&gt;From&lt;/code&gt; - defines the sender&amp;rsquo;s email&lt;/li&gt;
&lt;li&gt;&lt;code&gt;To&lt;/code&gt; - defines the recipient&amp;rsquo;s email&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Message-Id&lt;/code&gt; - defines unique identification of that specific email, usually some random string +&lt;code&gt;@your-server.com&lt;/code&gt;. Note the format: &lt;code&gt;&amp;lt;random-string@server-address&amp;gt;&lt;/code&gt; (the &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; are mandatory)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Date&lt;/code&gt; - defines &amp;ldquo;when it was sent&amp;rdquo; in RFC1123 with numeric zone format (go stdlib&amp;rsquo;s &lt;code&gt;time.RFC1123Z&lt;/code&gt; format: &lt;code&gt;Mon, 02 Jan 2006 15:04:05 -0700&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, there are some headers, mandatory only in case of email threads (if you don&amp;rsquo;t provide them an email will be valid, but an email thread - will not):&lt;/p&gt;</description></item><item><title>How to validate an email address</title><link>https://rakshazi.me/blog/how-to-validate-email-address/</link><pubDate>Sat, 12 Nov 2022 00:45:46 +0200</pubDate><author>cv@rakshazi.me (Nikita Chernyi)</author><guid>https://rakshazi.me/blog/how-to-validate-email-address/</guid><description>&lt;p&gt;&lt;em&gt;First published on 2022-11-12.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Hey,
Email validation is hard. Do you know how to validate an email address for sure?
Neither do I, but here is a report on what I found while working on &lt;a href="https://github.com/etkecc/postmoogle"target="_blank" rel="noopener noreferrer"&gt;postmoogle&lt;span class="sr-only"&gt; (opens in new tab)&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, what&amp;rsquo;s your wild guess? Regular expressions?
Well:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;only pretty simple cases - yes.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/Protocols/rfc822/#z10"target="_blank" rel="noopener noreferrer"&gt;RFC&lt;span class="sr-only"&gt; (opens in new tab)&lt;/span&gt;&lt;/a&gt;-compliant - no (RFC822 is only a &amp;ldquo;base&amp;rdquo; one, there are other RFCs that extend it).&lt;/li&gt;
&lt;li&gt;Be sure that email address is valid for sure - also no.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, how you can really do that?&lt;/p&gt;</description></item><item><title>SMTP components or Why sending emails is a rocket science</title><link>https://rakshazi.me/blog/smtp-components/</link><pubDate>Thu, 10 Nov 2022 15:39:41 +0200</pubDate><author>cv@rakshazi.me (Nikita Chernyi)</author><guid>https://rakshazi.me/blog/smtp-components/</guid><description>&lt;p&gt;&lt;em&gt;First published on 2022-11-10.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Hey,
Wanna know the biggest scam you can get in the email world (apart from &amp;ldquo;email is a decentralized communication protocol&amp;rdquo;)?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Simple&lt;/strong&gt; Mail Transfer Protocol.&lt;/p&gt;
&lt;p&gt;Simple, huh? They lied. It&amp;rsquo;s damn rocket science!&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m just trying to compile a note about what I found while working on &lt;a href="https://github.com/etkecc/postmoogle"target="_blank" rel="noopener noreferrer"&gt;postmoogle&lt;span class="sr-only"&gt; (opens in new tab)&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let me just throw some smtp-related tags and see if you can correctly handle at least one of them: MUA, MSA, MTA, MDA.&lt;/p&gt;</description></item></channel></rss>