Hello Pete,

thanks a lot for your reply! Auto-learning works so far, but I'd like to get more privacy for our users. Therefore public folders cannot be used, since everybody can look into them. So I setup to new accounts (spam/non-spam) and wanted to use them with your perl script. I set them to be seen and writeable for everyone, yet nobody (except the admin) can look into the contents of the folders. Now I'd like to know how I access the folders with the user spam, I mean "his" own folder and the folder of the user nonspam. Of course I allow "spam" to access the folders of "non-spam" in zarafa.

Loggin in wasn't a problem, but I get the first error while reading
"Read: 2 NO STATUS error finding folder" (all debug output at the end of this post)

I changed
my $spamcount = $imap->message_count('Public Folders/Spam');
to
my $spamcount = $imap->message_count('spam');

and
my $nonspamcount = $imap->message_count('Public Folders/Non-Spam');
to
my $nonspamcount = $imap->message_count('non-spam');

and
$imap->select('Public Folders/Spam');
to
$imap->select('spam');

and
$imap->select('Public Folders/Non-Spam');
to
$imap->select('non-spam');

Do you have any idea about what else I have to change to get this working with non-public IMAP accounts.
Thanks for your help!

This is the debug output of spamassassin_imap_learn.pl:
Started at Tue Oct 26 17:47:29 2010
Using Mail::IMAPClient version 3.08 on perl 5.010000
Connecting to 127.0.0.1:143 port 143
Connected to 127.0.0.1:143
Read: * OK Zarafa IMAP gateway ready
Sending: 1 LOGIN "spam" spam
Sent 21 bytes
Read: 1 OK LOGIN completed
Sending: 2 STATUS spam (MESSAGES)
Sent 26 bytes
Read: 2 NO STATUS error finding folder
ERROR: 2 NO STATUS error finding folder
Spam to process
Sending: 3 STATUS non-spam (MESSAGES)
Sent 30 bytes
Read: 3 NO STATUS error finding folder
ERROR: 3 NO STATUS error finding folder
Non-Spam to process
Sending: 4 SELECT spam
Sent 15 bytes
Read: 4 NO SELECT error getting mails in folder
ERROR: 4 NO SELECT error getting mails in folder
Sending: 5 UID SEARCH ALL
Sent 18 bytes
Read: * SEARCH

5 OK UID SEARCH completed
Search successfull but found no matching messages
Sending: 6 EXPUNGE
Sent 11 bytes
Read: 6 NO EXPUNGE error opening folder
ERROR: 6 NO EXPUNGE error opening folder
Sending: 7 SELECT
Sent 11 bytes
Read: 7 BAD SELECT must have 1 argument
ERROR: 7 BAD SELECT must have 1 argument
Sending: 8 CLOSE
Sent 9 bytes
Read: 8 NO CLOSE error opening folder
ERROR: 8 NO CLOSE error opening folder
Sending: 9 SELECT non-spam
Sent 19 bytes
Read: 9 NO SELECT error getting mails in folder
ERROR: 9 NO SELECT error getting mails in folder
Sending: 10 UID SEARCH ALL
Sent 19 bytes
Read: * SEARCH

10 OK UID SEARCH completed
Search successfull but found no matching messages
Sending: 11 CLOSE
Sent 10 bytes
Read: 11 NO CLOSE error opening folder
ERROR: 11 NO CLOSE error opening folder
Sending: 12 LOGOUT
Sent 11 bytes
Read: * BYE Zarafa server logging out

12 OK LOGOUT completed

CAPTCHA