4 messages in net.sourceforge.lists.courier-maildrop[maildropl] Maildrop : Setting user I...
FromSent OnAttachments
Manpreet Singh NehraSep 19, 2003 4:29 pm 
Paul DlugSep 19, 2003 4:48 pm.patch
Petri RiihikallioSep 20, 2003 10:17 am 
Sam VarshavchikSep 20, 2003 7:13 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] Maildrop : Setting user Id from within maildroprcActions...
From:Manpreet Singh Nehra (mne@fcsindia.com)
Date:Sep 19, 2003 4:29:00 pm
List:net.sourceforge.lists.courier-maildrop

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