Date: 2025-03-14
Last update: 2025-03-30

Send emails without SMTP server and mail client
-----------------------------------------------

Edit: Port 25 is currently closed.

All my subscribers, beloved followers, likers, share button spammers
and everyone who every morning wakes up early just to check if morena
does not have any new wisdom, already know that I am receiving emails
without a orthodox, conventional email server.

/bin/mail.pl MTA, Perl program to get emails over SMTP.

So this entry is especially for die hard morena fans, millions of
people around the globe.

I have to tell you that you don't need a mail server to have mail
server. This means, you don't need any special email software, SMTP
fuckery for sending your emails even into Big brother's inboxes.

Netcat is enough and few DNS entries. You setup DNS normally as you
would do with A, MX, SPF records. You point all that nonsense into
your IP address and hostname. To get into Big brother's garden
important point is to have a clean IP address/range, so not blocked by
some fake authorities, be in some mail blocklists. Then you need 
reverse DNS. From home, you probably need to contact your internet
provider. For VPS, there is usually some option or you have to request
it.

In the case of domestic IP, there is a risk that some corporate mail
server or very often some regular respectable lunatic blocks your IP
address, just for the reason, you are only a human. In this case your
email may not reach the destination of that idiot. This has nothing to
do with the way you send emails, but because of your IP address.
So no matter what software and setup you will use, the result will be
the same.

But back to the point after this pointless poetry. Using netcat, you
need to know the mail server hostname, not just the email address of
the recipient. This is MX record for the domain. For example
morena@morena.rip MX record is rat.morena.rip. This means that you
will contact rat.morena.rip server instead of morena.rip. In my case
it does not matter, you can contact directly morena.rip, but that's
not how regular respectable SMTP server of random lunatic is made.

So you spin up some tool or online service to get MX record for
morena.rip. Most UNIX systems have some utility like nslookup or host,
for this job. Then you just open netcat and send your message.

Note: You are sending email from hero@rip.invalid to morena@morena.rip
MX DNS record for morena.rip is rat.morena.rip. Your fully qualified
domain name with reverse DNS, hostname of your mail server is
mail.rip.invalid. Your email address is hero@rip.invalid.
Lines beginning with > are your commands inside of netcat.

$ nc rat.morena.rip 25 # connect to SMTP server over port 25
  220 morena.rip Perl SMTP Server # You often get something like this 
> HELO mail.rip.invalid
  250 Hello mail.rip.invalid, pleased to meet you hero
> MAIL FROM:<hero@rip.invalid> 
  250 Sender hero@rip.invalid OK
> RCPT TO:<morena@morena.rip>
  250 Recipient morena@morena.rip OK
> DATA
  354 Enter mail, end with . on a line by itself   
> Subject: testing email
>
> Your lovely message.
> Multiple lines if you need them are okay.
>
> Empty lines are okay too.
> .
>
  250 Message accepted for delivery
> QUIT
  221 Bye

Done. Please keep in mind, some corporate servers and very often some
servers of lunatics are setup too restrictive, that you may have
issues. They like too keep their dominance of software, standards and
stupidity, so they build high fences and barriers for humans to be
independend and free from their tyranny. Some servers may require
additional header fields in DATA like date or subject. They should
not.
Be careful if you testing something like this and dealing with other
servers. Always test with your server, email account. Otherwise you
may end in some local or global blocklist for making some mistakes.

That's all friends. You can send an email without any email software.
There is practically no any technical difference to use this way
netcat or using something like Postfix or OpenSMTPD with some stupid
email client like Mutt or Thunderbird. All that bloat ye?

For Spartans, Perl monks and heroes I made also minimal email client
in Perl.

/060/ Spartan email client in Perl

----------------------------------------------------------------------

Once you are simply alert, ready to respond, with no fixed idea, with
no prejudice, with no plan, you become true and authentic whatsoever
happens in the moment.