Maildrop : Setting user Id from within maildroprc

"Manpreet Singh Nehra" <mnehra-HZ17+XJ4cqZWk0Htik3J/[email protected]>
Newsgroups gmane.linux.admin.managers
Message-ID <[email protected]>
Hi everybody !

I have a setup running
Postfix+MySQL+Courier+Amavisd-new+NAI+ClamAV+Spamassassin+Maildrop
with Virtual Domains. Every user has a unique uid:gid combination.
(I guess that's all)
The problem I am facing is:
I want that every mail that is delivered to the any user of a domain should be
copied
to the admin folder of that domain.

If I do not attempt to copy to the admin folder it works fine.

The following if my /etc/maildrop/maildroprc file
<File>
if(/^To:[:space:]*[a-zA-Z0-9_\.]*@!.*$/:h)
{
echo $MATCH2
        if(/^X-Spam-Flag: *YES/)
        {
                cc "/var/virtual/$MATCH2/admin/mail/.Recieved.Spam/"
                to "$HOME/mail/.Spam"
        }
        else
        {
                cc "/var/virtual/$MATCH2/admin/mail/.Recieved/"
                echo "$HOME/mail/"
        }
}
</File>

The error I get in my maillog is

postfix/pipe[1692]: 0FDSVSFG2E: [email protected], relay=maildrop,
delay=234, status=deferred (temporary failure. Command output:
/usr/bin/maildrop:
Unable to open mailbox. )

As far as I am able to infer it occurs because maildrop sets uid:gid to the
user to whom
the mail is being delivered. And since the admin has a different uid then the
user maildrop
is not able to deliver the mail.

What I am looking for is a workaround to change the uid of maildrop while
inseide the script[

The mail copying is very essential for the setup so it can't be eliminated.

Thanks in advance

Manpreet
_______________________________________________
LinuxManagers mailing list - http://www.linuxmanagers.org
submissions: LinuxManagers-35TzE1X9F6582KRnZfj+bdi2O/[email protected]
subscribe/unsubscribe: http://www.linuxmanagers.org/mailman/listinfo/linuxmanagers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.