To build on a Windows machine a real server for not only hosting your web sites, but also directly hosting your domain names, including e-mailboxes.
Thanks to have followed to Part 2 ;-)
In the First Part, we configured your Windows webserver to be also the DNS server for your domain names. We also did define "MX records" that specify which are the SMTP servers associated with those domains (for the purpose of receiving the emails written to your domain names' email addresses)
This won't work for the moment and it's normal. You won't receive any emails sent to your domains unless you follow this part ;-)
In fact, usually, when you don't use "full DNS" from your Registrar, they cease to "own" the domain ; they can't make web redirections any more. The same can be said of email redirections. You probably - althought I have doubts - can't have email redirections without at least partly "hosting" the domain name at the Registrar's.
So let's suppose your old email redirections are "broken" and see what we can do about it.
If you write to a previously-working address
email@example.com (taking again the sample data used in Part 1) chances are you will now receive this kind of email answer from your ISP :
Alternatively, you could receive "domain unknown" and this would be almost normal.
From: MAILER-DAEMON@smtp7-g19.your_isp.com (Mail Delivery System) Subject: Undelivered Mail Returned to Sender To: your_real_address@your_isp.com This is the Postfix program at host smtp7-g19.your_isp.com. [blah blah blah] <firstname.lastname@example.org>: host smtp-something [some IP address] said: 550 <email@example.com>: Recipient address rejected: User unknown (in reply to RCPT TO command)
mail1.domainname.com(same IP@ as DNS & Web server) as being one.
The solution is simple : let's find a free SMTP server and install it and voila.
Halas, the solution is not that simple : the good face of the medal of not receiving emails any more is that you don't receive spam any more :D
Too bad we need those email boxes ;-)
So first, as usual, let's find available third-party tools, free if possible, for fulfilling this "cahier des charges" :
I really checked a lot of tools offered for download all over the 'Net : in the middle of dozens of tools for would-be spammers (FreeSMTP Server, SimpleSMTP, SMTP4All, etc etc ad nauseam)- tools probably full of malwares and backdoors -, I found only a handful of tools I could consider either as small enough, or professional enough to trust them.
Quickly checking them, I discovered none fulfilled my constraints and a lot were really still oriented towards "sendind mass mailing" (in other words, spamming).
Amongst them, I gave a try to "602 LAN Suite". From the operations I conducted, I admit it does what I asked for, except that it is NOT free and will work only for 30 days ; it's not a shareware tariff, something I would have considered decent. It's 300 U$D with 1 year BitDefender updates and 60 days support. Given I had to strip it off almost all features to only keep what I needed (incoming SMTP only, addresses checking and filtering, local POP only) it's a lot for nothing. It's really a "suite", in fact probably a good "entreprise suite". Too big for me.
Back to point zero.
As you can imagine, I was left with but one option only : do it myself :D
Thanks God, and no I won't enter technical details, there is a marvelous development environment called "Borland Delphi" which contained - theoretically - all I needed.
What you need for this is :
If ever you want to have a look at the challenge, here are tips :
-NM* components won't work
-the Indy "SMTP Demo" is incomplete - that's right - but also misleading on occasions
-don't look at the "SMTP Relay" demo, it's useless
-beware of Indy differences depending on versions
-Indy components send messages in your back, and stupid ones ("+OK Welcome to Indy SMTP Server" : how discrete :/ ) that you can't get rid of unless you rebuild a new component
-Indy components source files are available at koders.com
-you will have to implement the filesystem part, and all the exchanges in both SMTP and POP3
-not two email clients behave the same in POP
-the documentation available on the 'Net is fragmented and either outdated, or the components are outdated, or the email client is not compliant ;-)
At the end, you may end up like me with a 700 lines of aerated & documented source code program producing a 800 KB executable (no optimisation, all debug info & symbols in, all checks in, strict bool eval etc, in short something which works as intended :D )
In fact, you understood that I built a small executable program for Win32 which does exactly what I wrote above as requirements ; nothing less, nothing more.
So let's see the results before I give you the link to that utility, called
MySMTPServer's configuration), we refuse the SMTP connection and that's all.
MySMTPServer's configuration, we simply refuse the SMTP connection and that's all.
26/02/2007 20:04:39 message de 18.104.22.168 pour firstname.lastname@example.org 26/02/2007 20:04:39 refusé
26/02/2007 19:33:09 message de 22.214.171.124 pour email@example.com 26/02/2007 19:33:09 accepté 26/02/2007 19:33:10 Message good urinat from Lorinda Rowland <firstname.lastname@example.org> for Huang Natale <email@example.com> 26/02/2007 19:33:10 SMTP-DEBUG MsgId ok 26/02/2007 19:33:10 SMTP-DEBUG Subject ok 26/02/2007 19:33:10 SMTP-DEBUG desti KO huang natale/My Name 26/02/2007 19:33:10 Message Refused. 26/02/2007 18:58:16 message de 126.96.36.199 pour firstname.lastname@example.org 26/02/2007 18:58:16 accepté 26/02/2007 18:58:17 Message cheap oem soft shipping //orldwide from Anthony White <email@example.com> for firstname.lastname@example.org 26/02/2007 18:58:17 SMTP-DEBUG MsgId ok 26/02/2007 18:58:17 SMTP-DEBUG Subject KO 26/02/2007 18:58:17 Message Refused.
MySMTPServer, in turn, will only accept POP3 connections from a single IP address, which is the one YOU defined in the configuration.
this is MySMTPServer's config file - do not modify while running @VGR 2007 http://www.edainworks.com/ - do not remove this line ------------------ separator below is TAB ---------------------- yourself First Lastname alias kw blacklist 7 OEM viagra moneyback earning money casino software 0EM nb dom.<11 1 domain domainname.com 2 webmaster contact rel.path.mbx ./mailbox/ all.IP@POP3 192.168.0.1:110
The file is pure plain ol' text, the first column of each line explains what the line is about. Values are separated by the TAB character (ASCII#9). alias is a new (0.91 RC1) feature : you may add a secondary "accepted name"
Disclaimer : No warranty is offered of any kind. This is touchy software which works for me, but could very well crash your system for an unknown reason (the joy of Windows use ;-).
I suspect a bug of some kind that affects some very few emails : they arrive with an empty body. I'm still searching what could be the cause.
TODO list by decreasing priority order : (due soon, ASAP in fact)
MySMTPServer is available here in version 1.0 (ZIP, 245 KB )
0.51 (ZIP, 380 KB ;-)
and here as a Win32 Service (version 1.1) (ZIP, 250 KB ) it's almost the same code, but you lose the visual window activity logging and the ability to turn SMTP receive off. You don't see the process in TaskManager, in the Task Bar nor in the SysTray (it's controllable in the SCM window)
Current Version and limitations (memory settings):
Update 09/03/2007 : the bug seems identified ; it's not a bug ; it's Indy being too strict on standards and choking on badly-coded attachments (theoretically, such an attachment has to have a size being an even number multiple of 4). More on this later.
Update 02/04/2007 : First official release 1.0
Update 10/03/2007 : I will upgrade Indy to latest 9.0 or 10.0 - which implies probably a lot of problems and code upgrades to do - and in the meantime I stabilized a version 0.51 useable by you.
Update 31/03/2007 : The bug is fixed (I patched an Indy component). Current verion 0.90 RC1 is under test - coming out soon ;-)
Update 02/04/2007 : It seems ok, give me some days more of running time. Things are ***perfect*** for the time being.
Update 03/04/2007 : Win32 Service version also available, version 1.1
Const globApp = 'MySMTPServer'; cVer =
'0.51 du 09/03/2007';'1.0 du 02/04/2007'; Const cMaxMsg = 100; // nbre maximal de messages de la maildrop à ressortir // max nbr msg out of the maildrop in one POP phase cMaxKW = 100; // nbre maximal de mots-clefs blacklistés ci-dessous // max number of blacklisted keywords (in subject) cMaxEmail = 20; // nbre maximal d'adresses e-mail pour un domaine // max nbr of email addresses per single domain name cMaxDomains = 12 10; //nbre maximal de noms de domaine à gérer // max nbr of domain names
Those settings can be changed by simply recompiling. I chose values that I thought were reasonable for the time being.
Theoretically, now you should have a fully functional Windows Web + DNS + SMTP server, able to host as many domain names as you bought (nevertheless, evaluate the bandwidth consumption beforehand ;-)
for European Experts Exchange and Experts Round Table and Edaìn Works back to list of articles
Last update 2021-03-15 16:05:35
Copyright(©)(c) the respective authors. Licensed under the Creative Commons Attribution Share Alike 3.0 License .
These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!