Subject: Re: Simple mail sender?
To: None <brucem@cat.co.za>
From: Giles Lean <giles@nemeton.com.au>
List: netbsd-help
Date: 11/16/2001 20:13:43
> I am looking into adding simple functionality to a NetBSD system of ours.
> Under certain error conditions, I want the system to check if it has network
> access to a (SMTP?) mailer (i.e. is there some sort of config file on it to
> reach a mailer?), and then for it to generate a very simple text email, and
> send it to a fixed email address.

This is, in general, difficult.  There are several popular mail
transports used on NetBSD, and two (sendmail and postfix) are in the
base system.  In theory /etc/mailer.conf will tell you which mail
transport is being used, but even if this is correctly configured
programatically determining whether the MTA is likely to be able
to send SMTP mail would be difficult.

I recommend "suck it and see" -- send the mail with /usr/sbin/sendmail
(which should work with any correctly installed mail transport) and
see if it arrives.  If it arrives, you know you have working mail in
at least one direction. :-)

Regards,

Giles