Force resync after message move

Hey All,

Trying out SpamSieve for the first time and so far I am liking it. However I’ve run into an issue I’m hoping someone can help me with. I have two exchange accounts in Entourage, I’ve setup SpamSieve and it’s filtering my spam just fine. Once the mail is identified as spam it’s instantly moved to my Delete Folder on my computer. The advantage to this is that it removes the email from my exchange account so it doesn’t get sync’d.

However I use my windows mobile PC to sync my email I have it sent to every 15 mins. However what seems to be happening is occasionally a spam message if identified and “moved” but shortly after it’s moved and before my next sync (done every minute) my windows mobile phone will check and download the spam even though it’s already in deleted items.

The problem appears to be the syncing of the moved spam message. Since SpamSieve doesn’t resync after the message is moved it has to wait till the next messsage cycle before the exchange server knows the email got moved.

I’m hoping someone might have a creative solution to force email to be resync’d for the exchange account in question. I’m guessing it could probably be done by reworking the applescript slightly.

Thanks for any help.

Even with Entourage syncing immediately, there’s a window of time in which the phone can download the spam message before Entourage and SpamSieve have seen and dealt with it. So you may have to wait until the next time the phone syncs in order for it to be removed.

I don’t have an Exchange account, but Entourage has an IMAP option for “Live Sync (stay connected with server).” Maybe there’s a similar option somewhere for Exchange?

Or, perhaps it would help to add an action to the “SpamSieve - Move Messages” rule that runs an AppleScript like this:

tell application "Microsoft Entourage"
    set _inbox to Exchange account "YourAccountName"
    sync _inbox
end tell

Thanks for the assistance unfortunately it doesn’t appear that works directly. I tried the code you suggested and it returns the error:

Microsoft Entourage got an error “Exchange Email” does not understand the sync message."

According tot he Dictionary on the Sync command you need to specific an “Exchange Folder” so I’m assuming I need to set the current folder for the Exchange account somehow.

I will keep playing with it. If anyone has an idea how to do this I’d appreciate the help.

Sorry about that. I intended to have it sync the inbox folder but left out a bit. Please try:

tell application "Microsoft Entourage"
    set _inbox to inbox folder of Exchange account "YourAccountName"
    sync _inbox
end tell

Ok I think I have it it figured out with a lot of guess work I believe the code should read:


tell application "Microsoft Entourage"
		-- Added to sync Account after spam is found.
		set _inbox to folder "Inbox" of Exchange account "Exchange Email"
		sync _inbox
End tell

This appears to be working but I’ll need to wait for another spam email to come in.

I don’t suppose there is a good way to “send a test email” that spamsieve will automatically treat as spam without messing up he corpus is there?

I also need to figure out how to make the SpamSieve - Move if Spam script give me the current “account name” I think i might be able to get it out of “m”.

Thanks for the help,

You could turn off auto-training and put a word in the message that is on your blocklist. Just don’t train SpamSieve with that message.

I don’t recommend touching the “SpamSieve - Move If Spam” script. I think you want to do the sync after the message has been moved from the inbox by the “SpamSieve - Move Messages” rule, which happens after the “Move If Spam” script.

I’m having a similar problem with Mac Mail and my iPhone. Is there a similar AppleScript that would force Mac Mail to sync after moving the message to the spam folder? Thanks!

Apple Mail should sync immediately, automatically. If that doesn’t seem to be working, maybe it’s your iPhone that hasn’t synced? However, a script such as this should also work:

tell application "Mail"
    synchronize with account "AccountName"
end tell

Thanks for the quick response and script, but it doesn’t work. Basically, whether I run this script (or not), the message is marked as read on the iPhone, but stays in the inbox on the iPhone (even if I manually sync the iPhone) until I open the spam folder on the Mac (at which point it disappears from the inbox on the iPhone). The same behavior occurred with the normal Mac OS junk mail. Any ideas?

It sounds like the problem is with Mail. Maybe its database is corrupted. You could try quitting it and deleting the file:

/Users/<username>/Library/Mail/Envelope Index

Thanks, but that didn’t work. I should say the mail account is an Exchange account (using IMAP on the Mac), but on the iPhone it is set as an Exchange account. This problem doesn’t occur if set up with IMAP on the iPhone, but then there is not the instant notification of e-mails. Any ideas? I may post on the Apple group also.

Yes, it sounds like this is a more general question for Apple.