Subject: RE: Simple mail sender?
To: Giles Lean <giles@nemeton.com.au>
From: Bruce Martin <brucem@cat.co.za>
List: netbsd-help
Date: 11/16/2001 11:25:44
Thanks Giles
Maybe I should mention: the mail doesn't have to be sent - the software will
be written with the philosophy: "if the mail goes through, that's an added
bonus, if not, no problem."
So is your suggestion my best bet? Any recommendations on what documentation
I should read on setting up sendmail, mailer.conf etc?
Thanks
Bruce
-----Original Message-----
From: netbsd-help-owner@netbsd.org
[mailto:netbsd-help-owner@netbsd.org]On Behalf Of Giles Lean
Sent: Friday, November 16, 2001 9:14 AM
To: brucem@cat.co.za
Cc: netbsd-help@netbsd.org
Subject: Re: Simple mail sender?
> 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