Mail,SCO_OSR5,Sendmail
html

SCO Unix Sendmail Notes

Let me say first that unless this is just for local use, I do not
recommend this at all. It's going to be very difficult for you to keep
Sendmail up to date and secure on older SCO Unix.

Also, I don't recommend mixing a mailserver function with an application server. You can do free or inexpensive email on Linux systems with far more
ease and security.

That all noted, should you find yourself in the unfortunate position of needing to know something about this, here is a pile of stuff related to Sendmail on SCO Unix. There's also some Linux notes mixed in..

History

SCO and sendmail have an unfortunate history. Most SCO systems
were configured with MMDF - sendmail was available, but mmdf was
more often used.

When sendmail was used, it was often an older version, rife with
security problems, and troublesome to replace. That hasn't changed.
Compiling any app on SCO is likely to be difficult and sendmail is
of course no exception. Searching for pre-built sendmail binaries
is often the easiest path.

Sometimes SCO patches update sendmail somewhat
(for example, RS506A for SCO 5.0.6 updated sendmail to 8.11.0)
and checking
SCO Downloads might get you somewhere too.

Assuming you have a reasonably current binary, your next problem is getting a proper .mc file (see Sendmail Basics for an introduction to Sendmail).

While helping a customer with a sendmail issue I was reminded
that stock SCO doesn't include a suitable .mc file. This customer
wants to rewrite the user names so that when mail goes out it
appears to come from a completely different name. That appears to
be possible with the "genericstable" feature of 8.8 and up:

You'd add

FEATURE(`genericstable', `dbm /etc/mail/genericstable')dnl) to
your .mc file.

You'd create "yourlist" containing lines like: fred
fred_jones@wherever.com

and then

makemap dbm /etc/mail/genericstable < yourlist

then remake the cf as usual. But without a starting .cf, you
can't do much.

If you can't find anything better, start with this imperfect version:

Another generic .mc file

From a newsgroup post

Building sendmail 8.12 on osr507

Taken from a newsgroup post

Sendmail 8.12 submit.cf

From a newsgroup post

Replacing mmdf with sendmail

Basically, you remove mmdf and then install sendmail using custom. You
have to "drill down" to find MMDF inside your OS listing, and you need
your install cd to install sendmail (again drilling down to find it).

SCO TA 107593 covers the mechanics of that, but skips two important points:

1) Make a copy of your mmdf aliases files first, because
removing mmdf loses those.

2) You'll probably want to run "cnvtmbox" on usr mailboxes
during the switch

Also see this longer description: How to convert from mmdf to 8.11 sendmail osr5, which also includes a sco.generic.mc file.

Sendmail VRFY

In the process of doing some testing of a mail server, I noticed
a piece of spam mail delivered to an address that no one should
have known about. This disturbed me greatly, because the only place
that address appeared was in the mail alias file on my server. Had
my server been compromised?

Well, no, but as they say "mistakes had been made". After I had
checked everything I could, I was reasonably sure that I hadn't
been hacked, which meant that sendmail had to have coughed up that
information through a VRFY command. But I have VRFY turned off.. or
did I?

Well, no, I didn't. I THOUGHT I had, but I misunderstood the
configuration on my hosted server and had put the options in the
wrong file. Amazingly, that was a long, long time ago and I swear I
remember testing this, but when I tried it again, my sendmail
happily spit back alias addresses.

Ooops. Well, easily fixed. I replaced

in sendmail.cf with

"goaway" expands to "authwarnings, noexpn, novrfy, needmailhelo,
needexpnhelo,needvrfyhelo".

Test your server by telneting to it on port 25 and try "vrfy
yourname". If it doesn't reject you, you don't have these options
set.

Sendmail and /etc/service.switch

From a newsgroup post:

MMDF and Sendmail Control A's (SCO Unix)

Strangely enough, SCO's sendmail looks to MMDF's mmdftailor file
for its mail separator characters, and will surround messages with
Control-A's if these aren't set:

Email uuencoded file

From a Newsgroup post

Sendmail spam

From a newsgroup post

sendmail gui installation configuration

From a newsgroup post

In the same thread, someone else made this suggestion:

Command line mail attachments printer to email sendmail mmdf

From a newsgroup post

UUCP and Sendmail

From a newsgroup post

Sendmail email worm management (SCO Unix)

From a newsgroup post

Spam alias

The days of being helpful in mail server dialogues are long behind us. Today, it's common not to give out any information - even taking it so far as to not
identify what software the mail server is running.

But back when this was written, mail servers were more trusting and a number of "features" helped other machines identify who they should be sending
mail to. Of course spammers latched on to that very quickly.

From a newsgroup post

Sending email from command line

I'd use Perl to do this today - either directly with opening "mail" or "sendmail" (see Why I love Perl for examples) or by using one of the many mail related Perl modules available from CPAN.

Simple scripts like this have no error trapping capability and (as Steve points out) can fall into unexpected traps themselves.

As to attachments specifically, see How can I send attachments from the command line? and also CleanCode Email.

.forward seen as spam

From a newsgroup post

logging outgoing email

We'd call this archiving today and because it is often a legal requirement now, most mailservers can optionally perform this - the Kerio mail server I sell has this, for example.

That logall.c source is
still available and there are milters and procmail recipes available.

From a newsgroup post

Exim smtp mail

I was pleasanly surprised that exim is still being worked on as late as 2011 (or so say the docs, anyway.)

Exim is free, apparently still supporting the developer by book sales.

From a newsgroup post

Vacation procmail mail

Virtual domain mail aliases

I suspect he was creating loops as described at Sendmail's forwarding docs. The leading "\" tells Sendmail not to expand any .forward at the specified address.

Though why it worked for the first makes no sense..

From a newsgroup post

Service.switch sendmail

From a newsgroup post

Sendmail DNS lookups

From a newsgroup post

Save log all mail messages

Before milters, the only choice for archiving sendmail mail messages was "-x", which (as noted below) created very large log files.

From a newsgroup post

Newsgroups: comp.unix.sco.misc
From: bill@wjv.com (Bill Vermillion)
Subject: Re: How to save ALL inbound and outbound mail
Date: Mon, 18 Sep 2000 16:40:29 GMT

In article <39C28972.6EC08990@aplawrence.com>,
Tony Lawrence <tony@aplawrence.com> wrote:
>Fabio Giannotti wrote:

>> Hello all,

>> Running 5.0.5 with sendmail 8.8.8.

>> Does anyone know how to do sendmail.cf "magic" to allow the
>> server to keep a copy of all inbound and outbound mail?

>> (Client needs this for legal CYA reasons...)

>When you start the daemon, add "-X
>/var//log/monster_maill_log". You'll need to stop sendmail
>fairly often to compress and rotate those logs; they will
>get monstrous.. I do this at several client sites probably
>for the same reasons your client wants to do it- we keep a
>few days on the server and the rest can be had from tape if
>ever needed..

Thanks for that pointer Tony. So many programs - so many flags.

I just tried it and I saw why it gets 'monstrous'. It logs the file
incoming and delivery too. That's all the handshake headers and 2
copies of the message. I just sent a 1 line email message
- plain text - 43 characters long. The log file is 3512.
Monstrous is almost an understatement.

Looking at it I had a small thought. Besides compressing and
rotating the logs, you could pre-process them by doing something as
grep "<<<" <logfile.name> > incoming.messages and
grep ">>>" <logfile.name> > outgoing.messages, of course
using part of the date command to give you dated message files.
That would make things a trifle bit more manageable.

Thanks for expanding my knowledge base.

Bill

--
Bill Vermillion - bv @ wjv . com

>
> >> I am trying to go with Tony's solution of -X logfile, but am
> >> having a little problem.
>
> >> On a test system with low volume, it works great. However, on the
> >> real system with fairly heavy volume, it does not log anything,
> >> and I keep getting the following error in syslog:
>
> >> NOQUEUE: SYSERR(root) opendaemon socket: server SMTP socket
> >> wedged: exiting
>
>
> >I've only used this on Linux systems with high volume..
>
> I have noticed while testing the -X you suggested, that mail
> delivery delay on a local station increases. Besides copying the
> message three times there is the overhead of inserting all the
> tracing information, process ID, etc., before each line in the
> log file.
>
> I guess what is needed is something like a simple tee function so
> the message is just copied to two places instead of processing the
> message on a line by line basis. Fabio didn't say just how large
> his mail volume was - just that it was large.
>
> I wonder what something such as sar would say on disk useage and
> CPU time during this. I suspect the mail handler just got too busy
> logging. The logfile is 7 times larger than the mail message in
> the user mailbox.
>
>
> --
> Bill Vermillion - bv @ wjv . com

Update to all who helped with this problem.

For safety (read: being afraid of new releases) reasons, I will probably go
with Roberto's script (Thanks Roberto!), but I also found out the following:

It turns out that Sendmail versions 8.10 and higher provide a hook that
allow you to write macros to do all sorts of things to mail as it passes
through the system.

The sample macro they give you, of course, is to save a copy of all email
going through the system!

So, my question NOW is: Has anyone compiled Sendmail 8.10 or better on
OpenServer 5.x, and if so, can I get a copy of it and how well does in work?

...

The command/macro/whatever is called "milter" and it has a related
"LIBMILTER" associated with it. Keep in mind I have no idea what I'm
talking about. ;-)
Fabio

1. I've been following this thread for some time and finally took the
bull by the horns and wrote a buncha scripts that get the job done. The end
result is that I have a copy of ALL outgoing/incoming mail in a single
repository this is fully mail "readable" in full mail format.

2. If any one is interested, drop me a line a aplcom@cyberway.com.sg and
I'll email you whichever of the scripts you need. Below is a description of
my problem, the environment I use and the solution that I came up with.

Enjoy. Rgds. Otto.

=======================================================

I'm contracted to a company that doesn't want to spend a whole load of cash
on maintaining a complex email system nor the cash to have a permenant ISP
link up. So I had to come up with a method to have full scale email but at a
very CHEAP price.

a/ We are using SCO 5.0.5, fetchmail 5.2.7, sendmail 8.8.8 (all as
originally bought/received from SCO)

b/ Basic hardware setup with a K7-650, 16Gb ultra scsi, 24 GB dat backup
(Microlite), 32 port Specialix RIO, 48 port ethernet 10/100 .

c/ We have a hosted web and email site. I have instructed our hosted web
site to capture ALL incoming mail into a single account (rootbag).

d/ On system boot, sendmail is started from /etc/rc2.d/P86sendmail with
the following params (-bd -X /usr/adm/log/mailogd) - I have found that this
setting will deliver ALL local mail but queue (/usr/spool/mgueue) all
outgoing mail not local to my server.

e/ Every 30 minutes cron wakes up a script called pppgo:

PPPGO - shell script that establishes and verifies ppp link via
modem to our ISP
performs fetchmail to retrieve the mailbag into
account rootbag
makes/stores a copy of the mailbag into account
(mailin)
runs a shell script called maildist to distribute
all mail in rootbag to all valid users
runs sendmail (-v -q -X /usr/adm/log/maillog)
runs a shell script to store ALL outgoing mail into
account (mailout)
closes the ppp link and goes to sleep
inits all the maillog files!!! (this way kept to a
VERY reasonable size - a few K)

MAILDIST - Shell script that reads all the mail in rootbag and
distributes to all valid users as defined in /etc/passwd. If not found in
/etc/passwd gets mailed to our accounts executive who then decides who the
mail is really for.

Show more