If you want that, use the ACL feature.

Create both mailboxes for each user and subscribe them.
Set the acl so your spamreading user has access.
Use fetchmail to read them and feed the messages to your spam system's
learning mechanism.

A way to do the first step is demonstrated in attached shell script. Up
to you to make it fit your requirements.



Colin Wetherbee wrote:
> Matija Grabnar wrote:
>> As I remember, I created #Public/spam and #Public/ham, and gave them
>>  ACLs appropriate for public folders.
> 
> I'm really looking for per-user learning folders, so people don't get
> too worried about other people reading their email.
> 
> Making those folders write-only would be an obvious solution, but then I
> don't think an IMAP client would be able to retrieve a message that,
> perhaps, was placed in the wrong folder.
> 
> Colin
> _______________________________________________
> DBmail mailing list
> [email protected]
> https://mailman.fastxs.nl/mailman/listinfo/dbmail
> 


-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
#!/bin/sh

query() {
        echo "$@" | mysql -N --batch dbmail
}       


get_all_userids() {
        query "select user_idnr from dbmail_users where userid not in (\"[EMAIL 
PROTECTED]@!__\",\"__public__\",\"anyone\")"
}

get_user_idnr() {
        [ -n "$1" ] || return 1
        query "select user_idnr from dbmail_users where userid =\"$1\""
}

get_mailboxid() {
        [ -n "$1" ] || return 1
        [ -n "$2" ] || return 1
        mailbox="$1"
        owner="$2"
        query "select mailbox_idnr from dbmail_mailboxes where 
name=\"$mailbox\" and owner_idnr=\"$owner\""
}

subscribe() {
        user_idnr="$1"
        mailbox_idnr="$2"
        [ -n "$mailbox_idnr" ] || return 1
        query "insert into dbmail_subscription values 
($user_idnr,$mailbox_idnr)" &>/dev/null
}

unsubscribe() {
        user_idnr="$1"
        mailbox_idnr="$2"
        [ -n "$mailbox_idnr" ] || return 1
        query "delete from dbmail_subscription where user_id = $user_idnr and 
mailbox_id = $mailbox_idnr" &>/dev/null
}

main() {
        public_idnr=`get_user_idnr "__public__"`
        spambox_idnr=`get_mailboxid "Spam" $public_idnr`
        nospambox_idnr=`get_mailboxid "NoSpam" $public_idnr`
        for user_idnr in `get_all_userids`; do
                subscribe $user_idnr $spambox_idnr
                unsubscribe $user_idnr $nospambox_idnr
        done
}

main
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to