Hi everybody !
I have a setup running
Postfix+MySQL+Courier+Amavisd-new+NAI+ClamAV+Spamassassin+Maildrop
with Virtual Domains.
(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: to=mys...@somedomain.com, 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