OS/2 eZine

16 January 2001
 
Robert Basler is the president of Aurora Systems, Inc., as well as OS/2 eZine's new Editor in Chief. He doesn't really know what he's getting into, and the guy he's replacing doesn't want to scare him off by telling him. ;-)

If you have a comment about the content of this article, please feel free to vent in the OS/2 eZine discussion forums.


Previous Article
Home
Next Article



Your Own E-Mail Server with Weasel on OS/2

Recently I decided it was time to move my company's website to my own server so that I could offer some additional services to my customers without the hassle of dealing with various ISP's. One service I was really looking for was my own email address at my own domain. While domain hosting is available from most ISP's for a reasonable fee, and usually includes 5 email addresses plus some amount of web space, running my own web server I found it much more flexible and economical to run my own email server as well.


After some searching, I came across Peter Moylan's Weasel (http://eepjm.newcastle.edu.au/os2/weasel.html) POP3 and SMTP mail server. This easy to use software is capable of providing email for nearly any need, large or small. It is shareware, but it isn't crippled at all so you can thoroughly evaluate it before you pay the very reasonable U.S. $20 to register it (http://www.bmtmicro.com/BMTCatalog/os2/weasel.html). There are other registration options as well, see the Weasel documentation for details.

I have been running Weasel 1.0 the last couple months, but in December, Peter Moylan came out with Weasel 1.10. I have not upgraded our mail server yet, although I will be looking at version 1.10 here and an upgrade is probably in my near future.

Setup

Once you have your own domain name, the first thing you need to do is contact whoever is providing the DNS service for your domain and get them to add MX (Mail Exchanger) records to the DNS records for your domain. Although your server may work without MX records, you will find that some people have trouble sending you mail if you don't. If you are running all your servers on a single machine, it is also a good idea to add a DNS record for your server like mail.yourdomain.com in case any of the servers on your domain ever outgrow their current home.

Installing Weasel is a snap. Unzip it to the directory where you wish it to be installed, making sure to preserve the directory structure in the zip, create a directory where mail in-transit will be stored (like C:\MAIL) then run the included MAKEFOLDER.CMD if you want icons on your desktop.

Once Weasel is installed, you need to run the included SETUP.EXE to actually configure the mail server for use. Note that there are both VIO and PM versions of Setup included if you prefer character mode programs. To help you figure out the options in Setup, use the online help. The help here is simple and straightforward, offers helpful suggestions for configuration, and even spends time discussing the why's of things.

One feature that Setup offers that I have not tried is remote configuration which allows you to administer your email server from anywhere. This is particularly important if your mail server is offsite, perhaps at the offices of your ISP.


The most important information to enter is the directory for your email, the backup relay host (provided by your ISP) in case someone refuses mail coming directly from you, the name of the local domain (mail.yourdomain.com, yourdomain.com), and the acceptable sources for relay mail.

After you are satisfied with the operation of Weasel, you probably need to set it to start automatically when the computer is started. You can do this by adding a command to start Weasel to the TCPSTART.CMD file. You can also run it from INETD if you have very low traffic levels but the documentation doesn't recommend this. Once you are satisfied Weasel is working as you need, you can run Weasel detached, although you will not get a console so that you can see any status messages Weasel might generate. In any case, I would recommend running Weasel as a normal process at first.


Preventing Relaying

Relaying is the process where one email server asks another email server to deliver a message for it. While this is absolutely necessary for mail to transit the internet, in general, as a tiny postoffice, you do not want to provide this service for others. I was particularly concerned about this since I pay on a per-byte basis for my connection and had heard of one fellow who watched his email server grind through several gigabytes of spam mail overnight because he allowed unlimited relaying. Fortunately, Weasel is naturally inclined against relaying, you must explicitly enter either the senders or recipients who you are willing to relay mail for. If relaying is what you need, such as when your server is acting as a gateway to a private subnet, it is still straightforward to configure Weasel for this.

SPAM Prevention

One of the biggest problems of email today is spam. I receive an average of 10 per day. Fortunately, Post Road Mailer's filters take care of them for me so I don't usually have to see them. You can read about that in the May 2000 issue of the OS/2 e-Zine (http://www.os2ezine.com/20000516/spam.html). If you aren't using such a handy mail client, you can have Weasel take care of some of this for you.


Weasel includes optional spam prevention features which should satisfy even the most paranoid. Each time someone attempts to send mail through Weasel, it can be set to consult the MAPS RBL (Realtime Blackhole List) to see if the sending SMTP server is a known spammer and if it is, reject mail from there.

Weasel can also be set to reject email from email servers running on dialup connections through a consultation with the MAPS DUL. Often spammers will use throwaway dialup accounts to broadcast their messages.

A much more severe restriction Weasel supports is to reject mail from email servers that have open relays, that is, they will relay mail from anyone. The theory here is that it punishes ISP's who allow open relays by preventing anyone on their domain from sending email to you. The only ones I see it punishing is the users on that domain that you probably want to hear from.

Weasel also supports simple host blocking if you have someone consistently sending you spam as well as more advanced filtering and spam detection features such as automatic operation of an external program on each email Weasel processes.

As a non-spammer who has been on the receiving end of such facilities, I did not choose to enable any of these functions initially. I have had emails I have sent rejected as spam based simply on my email server, despite the fact that my ISP is the largest in Canada with several million users. Perhaps if the spam volume on my server goes up I will reconsider.

Setting up Accounts and Aliases

For each user you want to have on your server, you need to set up an account. Generally all that is needed is the account name and password. Once these are created, people will be able to send mail to yourname@yourdomain.com and you will be able to use a POP3 email client to retrieve that mail. Weasel will create a separate subdirectory under its main Mail directory to store each account's messages.

One big factor that made me choose Weasel over other available OS/2 mail servers I looked at was the unlimited number of accounts I could create with it. The other servers I looked at charged you by the number of email addresses you wanted. I could see 6 or so I would need just for myself, but I didn't want to pay a whole lot extra for them.

Aliases are a great feature for businesses and server administrators alike. An alias is basically a mailing list, you create an alias name like alias@yourdomain.com then you can enter as many email addresses as you like which will receive any notes sent to the alias email address. The email addresses on the list don't even have to be local, Weasel can send the alias messages to any email address, so you could use this feature to provide discussion lists.

Another extremely handy use for aliases is if you are the site administrator and you have an email address like yourname@yourdomain.com and you don't want to have to check different email accounts for all the standard administrative email addresses like abuse@yourdomain.com, webmaster@yourdomain.com, root@yourdomain.com etc. If you create an alias for each of those email addresses and point all of them to yourname@yourdomain.com, they will all be routed to a single mailbox.

You can do the same for your sales or technical support department, creating aliases like help@yourdomain.com, support@yourdomain.com, itsbroken@yourdomain.com and so on.

Troubleshooting

When I initially set up Weasel, I had some problems with some emails not getting sent. The error messages on the console indicated that the mail sessions to the remote mail servers were simply hanging. A quick email to Mr. Moylan offered up a likely reason for this problem and a solution.

The problem was that in an attempt to control SPAM, some of the larger ISP's like Yahoo do not accept mail from mail servers not meeting some unpublished criteria. Evidently my server met those criteria, however rather than returning an error message to Weasel, they simply hang the session in an attempt to slow spammers. I found this all particularly ironic considering that the bulk of the junk mail I get in a week comes from either Yahoo or Hotmail.

The solution was to use Weasel Setup, click on the Options tab, and enter my ISP's SMTP server in the Relay Host for Forwarding box and select the Use Relay Host as Backup radio button. This causes Weasel to first attempt to send mail itself directly to the destination, then if that fails, to try relaying the email through my ISP's SMTP server. Before you do this, you will have to contact your ISP to make sure that your ISP's SMTP server is configured to allow you to relay mail.

Another problem I had was that I could not immediately send mail, even from another computer on my LAN. I hadn't set the Trusted hosts entry in the Setup program. After entering the range of IP addresses used on my LAN (192.168.0.0-20) into the Acceptable Sources for Relay Mail, everything started working. See the online help for more information about specifying ranges and hosts.

Great Customer Service

I really have to commend Mr. Moylan on his email responses to my questions, they are prompt and courteous, something that I find very refreshing compared to the lackluster customer service I typically see in todays software marketplace.

Retrieving Mail

Retrieving mail is just like you do from a regular ISP, configure your mail client for POP3 mail retrieval with the name of the mail server (mail.yourdomain.com) as well as your user name and ID. Generally mail clients use POP3 to retrieve mail and SMTP to send it.

Sending Mail

Sending mail is also just like you do for a regular ISP, configure your mail client to send using SMTP with the name of the mail server (mail.yourdomain.com.) As I mentioned above, make sure you enter the IP range of all the computers on your LAN so that you can send mail from any of those computers.

Remote Access

If you ever use another computer, say from a dialup account provided by an ISP, to access your mail, you will likely find you can't send mail through Weasel. This is most likely because you have forbidden relaying (a really good idea.) To handle this case, Weasel includes a special feature called POP before SMTP Authorization. This allows a user who retrieves mail using POP3 to relay (send) mail using SMTP for a given number of minutes afterwards. I'd recommend setting this to 10 minutes or so, and then configuring your email client to always retrieve mail before sending it.

Summary

Is Weasel worth trying? Definitely! On my Pentium web server, Weasel simply runs. Week after week without a complaint. There isn't a much better recommendation than that. Do take the time to read through the documentation though, Weasel does quite a few more interesting things I haven't covered here.

Be sure to check out Mr. Moylan's website, it lists quite a bit of affordable, interesting software for OS/2 including an FTP server and a mailing list manager.

Previous Article
Home
Next Article