Some other people asked for my scripts, so I'm posting them to the list.

-- 
See complete headers for more info


On Thu, Jan 20, 2000 at 06:42:03AM -0500, [EMAIL PROTECTED] wrote:

> Yes. I'd like more details please.

OK. The basic idea is to allow relaying from a certain IP, after the
users POP their email. The way I do it on my system is this:

1. The POP server is wrapped in a shell script that captures the
user's IP address, and sends it to a special perl script on the
same machine; this perl script adds the IP address to a file used
by tcpserver and then rebuilds the CDB database. The perl script is
launched out of a tcpserver listening on port 50000 on IP 127.0.0.1, so
I don't really have to worry about arbitrary users adding IP addresses
to the file.

run the POP server like this:

tcpserver [options] 0 110 /var/qmail/bin/qmail-popup hostname
checkpassword /var/qmail/scripts/popb4smtp.sh &

run the other daemon like this:

tcpserver [options] 127.0.0.1 50000 /var/qmail/scripts/allow-relay.sh &

2. A second script running out of cron every 15 minutes, looks up the
file being written above, and removes old entries, where "old" is
configurable. The scripts are attached below: Look through them: If you
still have questions, let me know.

Some assumptions:

1. you have perl installed on your system. You'll have to look through
the scripts to make sure the path to perl is correct.
2. You have setlock installed on your system. You can get this from the
serialmail package. Alternatively, if you use FreeBSD, you can use the
lockf utility, which does a similar job. Read the man page of lockf for
more info (it might be easier to just compile and install setlock).
3. make a directory called scripts inside /var/qmail and put all the
scripts there. Also create a /var/qmail/etc directory, and put your
tcpserver.smtp file in there (this one has your normal IP's which allow
relaying - if you don't use this, you might want to just touch it
anyway, or edit the scripts not to use it - they're very simple).

-- 
See complete headers for more info

allow-relay.sh

cleanup-dynamic-relays.sh

popb4smtp.sh



Reply via email to