[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Procmail | Maildrop ownership



On Fri, Mar 12, 2004 at 11:24:50AM -0300, Yves Junqueira wrote:
> Hi.
> 
> I am trying to set up a custom behaviour for a spam blocking mail server,
> where the mail get redirected to a custom Spam folder in the user's
> Maildir folder.
> 
> Everything is working fine, except that, when procmail delivers the
> message, the ownership is wrongly set to "root":

How is procmail invoked? What versions of what software is involved?
I use postfix 2.0.16, and /etc/postfix/main.cf contains this line:
mailbox_command = procmail -a "$EXTENSION"
Then procmail will run as the recipient.
I don't use global /etc/procmailrc , but .procmailrc in homedir instead.

> 
> # cat /etc/procmailrc
> PATH=/bin:/usr/bin
> LOGFILE=$HOME/procmaillog
> DEFAULT=$HOME/Maildir/
> 
> :0fw: spamassassin.lock
> * < 256000
> | spamc -f -u $LOGNAME

What version of spamassasin are you running?
I use 2.63, and have ommittef the -u flag, spamc runs as the same user as parent (procmail) 

> 
> :0:
> * ^X-Spam-Status: Yes
> $DEFAULT/.Spam/
> 
> EOF
> 
>  # ls -la ~user/Maildir/.Spam/new/
> 
> drwx------    2 user  user      4096 Mar 12 09:56 .
> drwx------    5 user  user     4096 Mar 12 09:56 ..
> -rw-------    1 root     mail         4460 Mar 12 09:37
> 1079095066.4158_2.ares
> -rw-------    1 root     mail         8619 Mar 12 09:56
> 1079096151.4216_2.ares
> 
> I suppose this ownership setting is ok for a mbox store, not for a Maildir
> format, since the user isnt able to read or modify that message.
> 
> So, how can I make procmail deliver that message correctly?  I could make
> a script to do that, instead of using the redirection to .Spam/, but is
> there a nicer way to do that?
> 
> I also had problems making an alternative maildrop sollution. The issue is
> that maildrop's xfilter command wont work if the recipient user doesnt
> have a valid shell:
> 
> # cat /etc/maildroprc
> DEFAULT="$HOME/Maildir"
> # exception commented so I could see the error log
> #exception {
> xfilter "/usr/bin/spamc -f -u $RECIPIENT"
> #}
> if (/^X-Spam-Flag: YES/)
>         {
>         to "Maildir/.Spam"
>         }
> 
> EOF
> 
> It would work fine, except that when the recipient user does not have a
> valid shell account, it exists with the following error (when I am not
> using the 'exception' block):
> 
> BAF555886: to=<user@goiano.com.br>, relay=local, delay=0, status=deferred
> (temporary failure. Command output: maildrop: error writing to filter.
> /usr/bin/maildrop: Unable to filter message. )
> 
> 
> I suppose xfilter calls the user's shell. Is there any other way to filter
> messages without this requirement?
> 
> Is using an 'smtp' content filter in the MTA (postfix) a better option?
> The sollutions I've seen use 'spamassassin' instead of 'spamc', that is
> the method I prefer...
> 
> Thanks in advance,
> 
> Yves
> 

--
Frode Haugsgjerd
Norway



Reply to: