Hi,
I've been trying different combinations in order to get dot-courier to work.
I originally had .courier-default calling up maildrop with a specific
filter file. But then I decided to try something different.
So now, I have this in .courier-default:
|| /usr/local/bin/check_default
In the check_default script (perl script), I perform some lookups and
determine whether $RECIPIENT is valid or not.
I'm following the guidelines provided in the dot-courier manpage, for the
dynamic delivery instructions.
Please correct me if I'm wrong... but this is what I'm doing:
If I find a match for $RECIPIENT, I output an email address and exit with
code 99 like this:
print "$fwd";
exit 99;
(where, of course, $fwd contains an email address)
If I find an error or $RECIPIENT doesn't match anything, I output this:
print "echo \"user $to unknown.\"";
exit 77;
(where, $to is equivalent to $RECIPIENT)
When I send a message to a non-existent address, the log file simply says
"status: failure", I'm not getting the effect of the "echo" statement.
The check_default script outputs debug to its own log file, and in the
log file I see the echo statement being output. But no sign of it in the
courier log.
But even besides that, the courier log file indicates failure, but the
server at the other end, which sent the mail message, indicates SUCCESS!
(it reports a 250 OK for the email address in question) :-(
I don't understand what I'm doing wrong. I've tried different things, but
I can't seem to get courier to properly reject unknown senders.
What confuses me the most is that courier says one thing (failure), but
the sending smtp server believes that the delivery was successful.
PLEASE Help! :-)
Thanks!
Ricardo