This one time, at band camp, Jim Clark wrote:
>On Wednesday 16 January 2002 22:00, Jamie Wilkinson wrote:
>
>> Note that the *existing* mail appears in the client's shared mailboxes,
>> i.e. all mail that was in /home/shared/Maildir/.group1/cur/ appears in the
>> clients Share->Group1 mailbox.
>>
>> The problem is that Courier isn't picking up on *new* mail being delivered
>> to the shared mailboxes, i.e. mail in /home/shared/Maildir/.group1/new/
>> isn't appearing in the client's Share->Group1 mailbox.
>
>I have not played with shared folders myself, but I notice that both Evolution
>and Outlook Express (IIRC) have an option to check all mail folders for
>new mail (did not see an option in kmail for this tho').
>If your mail client has such a feature, maybe it will help?
We're using OE, and that wasn't the problem I described. I'm sure I
mentioned that existing mail appears in the client's shared mailboxes.
Anyway, I think that I've solved it now.
The problem was that Postfix was delivering (according to the maildir
specification) to the subdirectory new/ in each shared maildir folder,
whilst Courier *only* checks cur/ *in shared folders*. The URL I posted in
my last message doesn't explain why, but it at least explains the method.
I am including a small shell script that I am using as a local delivery
agent for the shared mailboxes. You add it to the Postfix aliases database,
like so:
group1: |"/usr/local/sbin/deliver-shared group1"
It takes one argument, the group name of the shared mailbox. The script
delivers to $SHAREDIR/.$1/cur/ using safecat (Postfix pipes the message
in via stdin) using the group name you gave on the command line in the
aliases file. Note you need to put the whole command in quotes so that
Postfix gives the script your arguments.
The script will also chmod 0660 and chown mail.$1 all the messages in the
directory $SHAREDIR/.$1/cur/. This is because at our site, all of the
members of the unix group 'group1' are subscribed to the 'group1' shared
mailbox, they need rw rights on the message.
You'll need sudo installed and the line
mail ALL=NOPASSWD: /bin/chown
in your /etc/sudoers to allow the script to do the chown mail.$1
--[start snip]--
#!/bin/sh
# Local delivery agent for Courier shared mailboxes from Postfix.
# Delivers to $SHAREDIR/.$1/cur/, and ensures that the mail is g+rw
# and owned by mail.$1
# (c) 2002 Jamie Wilkinson, in the public domain.
# requires safecat and sudo to be installed
SHAREDIR=/home/shared/Maildir/
if [ "$1" = "" ]; then
exit 64 # /usr/include/sysexits.h
fi
safecat $SHAREDIR/.$1/tmp/ $SHAREDIR/.$1/cur/
# this'll take a short while...
find $SHAREDIR/.$1/cur/ -type f -print0 | xargs -0 chmod 0660
find $SHAREDIR/.$1/cur/ -type f -print0 | xargs -0 sudo chown mail.$1
--[end snip]--
I'm not too happy about the duplicate find there, but it shouldn't take too
long, due to the structure of the Maildir format it should only have to look
in one directory.
--
[EMAIL PROTECTED] http://spacepants.org/jaq.gpg
Weaseling out of things is important to learn. It's what seperates us
from the animals. Except the weasel.
-- Homer Simpson, Boy-Scoutz In The Hood
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug