I got an answer to this from the qmail mail list. This is the answer:
<
Thanks very much Charles.
I used relay-ctrl and it worked well once I got my head around Bruce Guenter's very brief notes at
http://untroubled.org/relay-ctrl/. (The debian qmail package I used doesn't need daemontools, thus envdir was a bit of a mystery at first).
References used:
http://www.palomine.net/qmail/relaying.html
http://untroubled.org/relay-ctrl/
- Chris Murphy
Charles Cazabon wrote:
Chris Murphy <cjmurphy@smartchat.net.au> wrote:
I have set up the qmail MTA on a server machine that is connected to the
internet. I want it to only accept emails where the "Sender:" is one of
a few email addresses. Is there a simple way to do this with qmail?
Apply one of the various "goodmailfrom" patches that have been implemented for
qmail, analogous to the built-in badmailfrom functionality. Put your list of
secret "good" addresses in the associated control file and you're done.
This server machine has a Debian distribution. No emails are delivered
locally. Insead they go to POP accounts on a client machines that have
broadband connections. The crux of the problem is that these client
machines have dynamically assigned IP address.
... ? That doesn't matter, unless by "accept emails" you actually mean "allow
senders to relay" ...
I have already implemented 'only from specific IP addresses' using
/etc/tcp.smtp. This sets a range of IP addresses as being valid. (The
dynamically assiged range). To protect the mail server from being used
as an open relay from addresses within that range I want qmail to have a
secret whitelist of valid senders.
You're talking about relaying, not accepting mail. There's a qmail relaying
FAQ, or you could simply use a POP-before-SMTP solution to grant relaying
privileges to your dynamically-addressed users. Bruce Guenter's relay-ctrl is
the most common one used with qmail.
Charles
>