Bernd Wurst writes:

Am 09.05.2014 01:34, schrieb Sam Varshavchik:
> The shell script would get invoked in the manner described in the
> localmailfilter man apge:
>
> HOME=$HOME <pathname> -D uid/gid -M filter
>
> So, the nondeliverable account gets set up as a pseudo account with a
> home directory. The shell script needs to parse its command line
> arguments. If <filter> begins with 'rcptfilter', exit with status code 0
> unless $HOME is the pseudo account, in which case the exit code is 99.

Sorry, I don't get it. :/

I tried a lot but I cannot get the destination address. Neither in
running as rcptfilter nor as smtpfilter. The HOME is alright but how can
I get WHICH ONE was addressed?

Well, you know which one is addressed by the virtue of the fact that the script is being executed from the account's $HOME.

We use virtualdomains here, so all addresses come in with the same UID
and HOME. I did not find any way to guess which one was chosen.

UID is not important.

My current workaround is to set up a pseudo home-directory like this:
/tmp/reject/[id] so I can search the database for the message to return
for this recipient id. I don't really like this solution.

You're almost there. Put a rcptfilter and smtpfilter in each pseudo home directory, and use them to return an error message for each individual address. Or, you can use the email address as the directory's name, /tmp/reject/user@domain, and have the script take it out of $HOME.

And make sure nothing decides to clean up the contents of /tmp


Attachment: pgpiO2iNO5gWz.pgp
Description: PGP signature

------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to