Sendmail: Mr. X

        My first encounter with Mr. X was a six years ago when for some reasons mails were bouncing like Ping-Pong balls. After a frantic long distance call, the support staff told me about the solaris sendmail bug, it won't talk to a mail exchanger. He told me just to rename the file /usr/lib/ to /usr/lib/sendmail and restart the sendmail daemon. Well I thought, that is easy anyone can administer a solaris box. Not so fast, the root mailbox were growing like a malignant tumor.  I was just lucky, I kept an a copy of the old brain dead /usr/lib/sendmail. I reverted to the old system, at least most of my mails were flowing without problems.

    So the hunt goes on for the mysterious Mr. X, which brought me to eric allman's ftp server ( As if conjured by some great magician things were working in place again. Ever since then, I stopped using mx hack from solaris. Years have passed and megabytes of mails were routed and rerouted, rumors were spreading that my gossip portal had an open window. A visit to the new sendmail site (, a cure was waiting. Until one day I got this email from someone with a header XXX, my customary attitude to spammers (btw I like the real SPAM) was to ignore and delete. I decided to read it, because the sender was someone with an EDU as an address. It happens to be an email from another sysad telling me, that I was hit a relay spammer. WHAT?? I was so astonished, how could they do it without my syslog knowing it. So my reaction was to block the originating site, but it was not enough another pervert were using my machine again. It's high time to close this gaping hole.

    By this time sendmail ( was already a commercial outfit and already on the 8.9.1 incarnation. Mr. 4 from macroland has been enlisted in the battle for ever increasing complexity of the regular expression hordes. To my relief, I dont have to fiddle  and have to cast some anarchic spell just for my mails to flow out unmolested.

    As every sysad would attest, your other feet is always on the edge of what you knew and what you don't. I was then trying to add some redundancy into our mail servers, trouble was always waiting in ambush for the unwary and naive. I went to the old veritable sendmail site ( the FAQ and links were aplently. But, I was just looking for a way to implement an MX or mail exchanger (a.k.a. Mail Hub, Relay or gateway, etc.). There was an inch long discussion of it, so I tried.

     IN    A        ; (Private IP network)
     IN    MX   10

     What an elegant way of solving your problem, let others do it for you. This time sendmail relegated the problem to the name server (BIND). I think the FAQ was written on april 1, my email to was bouncing with a very big error "Loop Back Error". The FAQ said if you get a loop back error, you should define Cw, but wait a minute I'm not trying to masquerade another server. I just wanted so receive the mail from the outside world and have it relayed it to for final delivery.  After the initial setback, I decided to use a linux server as my laboratory rat, the solaris box was just finicky. So after asking this question to, the response was, has relay no idea what to do once it receives the email, it had to be told before hand by the way of a mailertable. So its clearer now, after all you still have to tinker with your! Finally you have to create a mailertable with the following format:


    Then create your mailertable database with makemap hash mailertable <mailertable. Restart your sendmail daemon and is now ready to relay any messages for


Configuration for solaris servers.

VERSIONID(`@(#)    8.9.1  MSU-IIT 8/27/98')
define(`DATABASE_MAP_TYPE', `dbm')dnl
FEATURE(mailertable, dbm /etc/mail/mailertable)dnl
MAILER(local, /bin/mail)dnl

Configuration for Linux Servers:

VERSIONID(`@(#) 8.9.1 MSU-IIT 8/27/98 ')

Caveat for REDHAT Linux servers:

    This configuration would produce a local mailer pointing to /usr/local/bin/procmail, yet your procmail is at /usr/bin/procmail so you have to create a link to it. (ln -s /usr/bin/procmail /usr/local/bin/procmail).