Version 1.0 Stable Downloads
VK Mail™ consists of the following three components. You can choose to use just Mail Daemon only or Web Mailer only or Mail Parser and Web Mailer only but not Mail Parser alone. I recommend you to install all three, unless ofcourse you love spam and die for it everyday :)
Please download the following items also, if you want help in configuring this Mail System with Sendmail and use images instead of text form of email addresses on your web pages.
1. Use my mc file to generate sendmail.cf : sample.mc
2. Use my text2image page, click View Source to download on that page.
This system works on UNIX/Linux with any web server / mail server combination. Support for Windows is planned but not ready yet. (perlfork still does not work properly in Windows)
Mail Daemon allows one to specify who is authorized to send email and who is not in the filter.txt file. Also, one can specify "Block all except those listed" rules in the filter file.
All those mail filtering rules and procmail recipes to automatically delete junk mail you received are only helping us to delete the junk mail easily, not preventing the junk mail nor are we sending any message to spammers that we do not tolerate spam. Due to vague law controlling Spam, it is necessary to have an alternative solution and I attempt to provide such with this Mail System.
First, specify rules in filter.txt for the Mail Daemon either as "Allow All except those listed" or as "Block all except those listed". Next, customize Reject Mail message that will be sent to blocked users like this: "Your message to email@example.com is denied. Please send to firstname.lastname@example.org".
Now, tell your friends to email you simply by typing your email address email@example.com in a web browser. When the browser contacts abc.com web site, the web server calls Mail Parser which in turn calls Mailer form which can be filled to send email.
Moral: Start using web browser to send email by typing email address in the browser, instead of using mail clients (or shall I say, all those bulk mailers that bombard users with millions of junk mail everyday)
Ideally, User Joe Doe must not share his email address with general public or give out his email on web pages in text form etc. He should configure JoeDoe@abc.com such that only a few can send him email from email clients and all others will be asked to use web browser to send email, as explained above. Now, Joe Doe can give his other email JoeDoefirstname.lastname@example.org to only his Near and Dear who will add his email to their addressbook anyway.
Please dont get scared in this part, you are going to do this only once, if you do it right :)
First, if you are installing Mail System on the same machine as your mail server that is currently running a mail server, then you need to first configure your mail server to run on Port 26. Mail Daemon will act as a mail server to the Internet and only Mail Daemon will connect to your internal mail server directly. Please see download section for help on how to do this in the case of sendmail.
Ok, now you have port 25 available and you install Mail Daemon in /etc/Mmail as explained below.
Installing Mail Daemon:
Download the program into /etc/Mmail. Change HOSTNAME at the top of the script; also change iport (default 26) and ihost (your internal mail server). If necessary, change uid/gid numbers for user (default: nobody) this program should run as. Create a filter.txt file. Here is the sample: filter.txt. Next, create an empty file in /etc/Mmail as follows:
chown nobody:nobody log
chmod 644 log
chmod +x mmail
Now type nohup ./mmail & as root and that should start the Daemon.
NOTE: Make sure your internal mail server (eg. Sendmail) does not allow RELAY from localhost, localhost.localdomain and 127.0.0.1 if you have mmail installed on the same machine as your real mail server. (In the case of sendmail, you can do this by editing access file. See "Finishing Installation" below)
Installing Mail Parser:
Note that you cannot use Mail Parser alone; it needs Web Mailer too. Mail Parser should be installed for a specific domain, say, abc.com. That means Mail Parser must be installed in HTML Document Root directory of web server that hosts abc.com web site. Now, Web Mailer can be installed on the same web server as Mail Parser or a different machine but one that runs a web server with support for CGI Perl scripts. If you install Web Mailer on the same machine as Mail Parser (Recommended), then you dont have to change anything in mmailp.js file as long as your Web Mailer is installed on the same web server and accessible as http://abc.com/cgi-bin/mwmail.pl. But if you install Web Mailer on another web server, you have to edit mmailp.js as follows:
1. Edit "var upath" line at the top of the script.
2. Replace myarray at the bottom of the script by the domain name of your other web server that is hosting Web Mailer. (eg. replace myarray by 'xyz.com' including the single quotes)
Now, make sure that your web server hosting Mail Parser can be accessed with domain name only. i.e., by typing abc.com. If your web server can only be accessed by http://hostname.abc.com and not by http://abc.com then you have to fix it. Ask your DNS Administrator to assign Address ('A') record to SOA (abc.com).
Now, download Mail Parser script (mmailp.js) into your web servers HTML Document Root directory and edit it if necessary, as explained above. After that add the following line to your web server's default HTML document. Let us say, the default HTML document served is index.html. Now, insert the following line into index.html such that the following line appears just before <BODY> Tag.
If your index.html does not have a <BODY> tag at all, then insert the above line just before <FRAME> Tag or <FRAMESET> whichever comes earlier.
Make sure mmailp.js is readable (type: chmod 644 mmailp.ps)
Installing Web Mailer:
Download Web Mailer (mwmail.pl) into your Web server's CGI-BIN directory and edit @allowedto and @blockedfrom lines at the top of the script. In our above example of setting this up for domain abc.com, if joe and jane are authorized users to receive email using Web Mailer, then include email@example.com and firstname.lastname@example.org on the @allowedto line.
Make sure mwmail.pl has rights to be executed by your web server user (usually: nobody). You can do this by typing: chmod +x mwmail.pl. Make sure your web server hosting Web Mailer has Perl installed on it. Additionally you also need to install Net::SMTP and Net::DNS, which is faily easy. Go to www.cpan.org to download these two perl modules.
Define policies. In our example, we set up for domain abc.com and joe and jane are users at this domain. Lets say, joe hates spam and jane loves spam. Naturally, you put a rule in filter.txt for joe and not for jane. Jane continues to give her email to everybody and enjoys spam everyday. Everyone can send her email from email clients like Microsoft Outlook, Netscape, or whatever. Whereas, Joe, our spamhater, blocked email@example.com and firstname.lastname@example.org in filter.txt. After sometime, Joe decides to block everybody except Joeswife@faraway.com. Then, everyone except his wife must type email@example.com in a web browser to send him email.
Configure proper reject message in your mail server (eg. Sendmail). Put a line like below in your Sendmail's access file:
firstname.lastname@example.org 550 Invalid.Send to email@example.com
Also, you should edit /etc/mail/access (the access file) for Sendmail such that RELAYING is not permitted for localhost and 127.0.0.1. This is very important because mmail connects to your sendmail from 127.0.0.1 if you installed mmail on the same machine as your Sendmail server. When you have mmail and Sendmail on port 26 running on the same machine, your /etc/mail/access should have the localhost lines commented out as shown below:
#localhost.yourdomain.com RELAY #localhost RELAY #127.0.0.1 RELAY
If you are running mmail and your mail server such as Sendmail on two different machines, say A and B where your mail server (eg. Sendmail) runs on machine B and you installed mmail on machine A; then you should define policy on machine B such that relaying from machine A is not permitted when mmail tries to connect to mail server on machine B. If you do not disable relaying as explained, please note that your Anti-Spam mail system will be an open relay !!
Free for non-commercial use. For commercial use, please contact me first and I may grant you permission to use for free.
No warranty. Use at your own risk.