Error checking "Spam" mailbox in Remote Training Script

Hi,
I’ve just set up a spam filtering drone on a mac-mini running MacOS 10.15.7 Catalina
Everything worked fine (used the AppleScript from within Apple Mail with the corresponding rules). Then I gave the compiled standalone version a try but changed back to the original method with AppleScript.
Suddenly the Script throws an error trying to read the Spam mailboxes either on my Yahoo, Gmail or iCloud Account:

SpamSieve [Apple Mail Remote Training] Error training from account “Yahoo”: „Mail“ hat einen Fehler erhalten: „mailbox “Spam” of account id “4F2E720D-AFC0-48DF-9469-1E6CAD3B55AF”“ kann nicht gelesen werden.

Any ideas?? This all worked perfect just before…
Help is highly appreciated…

Axel

This error seems to indicate that the Yahoo account does not have a mailbox named Spam at the top level. Do you see it there in the list? If it’s not at the top level, you may need to adjust the account’s IMAP path prefix in Mail’s preferences.

You can also use this script to see the mailbox names, as Mail reports them to SpamSieve.

Thanks for your fast reply… You are right, obviously - the result of the script shows, that NONE of my accounts have an Spam mailbox now??? How’s that possible?

Gmail
    Andrea
    Aon
    Archive
    Bestätigungen
    Drafts
    Later
    Mac-Server
    Mailspring
        Snoozed
    Postserver
    Privat
        Finanz
        Gitarre
        Golf
        Hausverwaltung
        Schule-Uni
        Strom
        Urlaub
        Versicherung
    Rechnungen
        A1
        Diners
        T-Mobile
        Visa
    Sent Messages
    Shopping Gmail
    TrainGood
    TrainSpam
    Work
    INBOX
iCloud
    [Airmail]
        Done
        Memo
        Send Later
        Snooze
        To Do
    Apple
    Later
    Mailspring
        Snoozed
    Shopping iCloud
    Starred
    TrainGood
    TrainSpam
    Trash
    Visa
    Archive
    Notes
    INBOX
    Drafts
    Sent Messages
    Deleted Messages
    Junk
Yahoo
    Archiv
    Auctions
    axman460-dream
    axman460-fu
    axman460-msdevelop
    axman460-shopper
    Bestätigungen
    Drafts
    Mailspring
        Snoozed
    Microsoft
    Newsletter
    PayPal
    Rechnungen
    Shopping Yahoo
    Starred
    TrainGood
    TrainSpam
    Work
    Xing
    Archive
    INBOX
    Draft
    Sent
    Trash
    Bulk Mail
Urma
    Blocked
    Journal
    Later
    RSS-Feeds
        MSN Nachrichten
    Starred
    Synchronisierungsprobleme
        Konflikte
        Lokale Fehler
        Serverfehler
    TrainGood
    TrainSpam
    Archive
    Aufgaben
    Notizen
    Posteingang
        Ablage
    Postausgang
    Entwürfe
    Gesendete Elemente
    Gelöschte Elemente
    Junk-E-Mail
On My Mac
    Outbox

So why does Apple Mail do show the Spam-mailbox of Gmail (IMAP)
gmail-imap

but it’s not recognized by SpamSieve or the list mailbox script:
list_mailbox

Maybe deleting all accounts from AppleMail and re-add them?

My guess is that you have designated the Spam mailbox to be used as the special Junk mailbox in the Mailbox Behaviors section of Mail’s Accounts preferences. That will make it appear in Mail as Junk (or whatever that localizes to on your Mac). So you could either use that name in the SpamSieve script or choose a different mailbox as the Junk mailbox so that Spam will show up as Spam.

No, I’m using the Spam mailboxes on the respective server accounts - also didn’t change that…

What I’ve noticed also now is, that for the iCloud-Account, following entry in Console-Debug-Log appears:

SpamSieve [Apple Mail Remote Training] Getting source of message in “iCloud” / “TrainSpam”: Aktion erforderlich: Konto bestätigen

But the account is working in Apple Mail, no need to verify the account?!?

I don’t know whether you changed it, but did you check Mailbox Behaviors to see how it’s set now? The screenshot that you posted above shows the Spam mailbox with the special junk icon, and the mailbox listing includes Junk, so this all points to Junk being set to Spam.

There may be a particular problem message in the TrainSpam mailbox that you need to train or move manually to work around the error that Mail is reporting.

What I did so far (yesterday night), I changed the name for the spam boxes on iCloud and Yahoo to
spamboxes

as it showed up in the account preferences - mailbox behaviours:
yahoo_account_detail

-> and it worked again!!

But when I look an the account info of the Yahoo-Spam box it (still) shows up “Spam”:

Same for iCloud-account, just that I changed the spamMailboxName accordingly to “Junk”

In Apple Mail, the spam boxes show up like that:

apple-mail_spamboxes

I’m confused… :thinking: :hot_face:

Now I changed also the Gmail spamMailboxName and now all accounts are working as expected again:

spamMailboxNames

I really would like to know what is/was the reason, as this was not necessary before…

sorry, forget about that post - it’s the topic of the message, not an log-message from SpamSieve to verify the account :man_facepalming: :grimacing:

I’m not sure why Mail shows the Yahoo mailbox as Bulk Mail in one place and Spam in another. Is this causing any behavioral problems or is it just a visual inconsistency?

Does the remote training script correctly move messages from the iCloud TrainSpam mailbox to the iCloud mailbox under Spam?

I’m skeptical that the Gmail mailbox should have [Gmail]/ in its name, as that is likely not part of the mailbox name. But I guess if it’s working you may as well leave it that way.

I don’t know. It seems like something else must have changed, because the script should behave the same way regardless of the file format used.

Anyway, thank’s for your fast response an tips!