Client won't update to reflect message deletion on server

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
duhpuck
New user
New user
Posts: 3
Joined: 2010-11-03 04:31

Client won't update to reflect message deletion on server

Post by duhpuck » 2010-11-03 04:53

I run a script which calls message.Copy and messages.DeleteByDBID(message.ID) to move messages on the server from one IMAP folder to another, and it works fine.

However, I cannot figure out how to get the Outlook Client (OL 2007) to refresh to reflect the update. The copied messages show up correctly in the destination folder in Outlook, but the original messages, which have been deleted on the server, are still sitting in the Inbox on the client.

Of course I tried both "Send/Receive" and "Purge Marked Items", but neither removes the messages from the client's Inbox. Closing and restarting Outlook does the trick, but that's not a viable option. I really need to have the effect of the server-side script visible on the client so the user knows the script is doing its job.

Any suggestions?

User avatar
mattg
Moderator
Moderator
Posts: 19880
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Client won't update to reflect message deletion on serve

Post by mattg » 2010-11-03 07:04

Outlook + IMAP isn't very good unfortunately...

Which versions of hMailserver and Outlook do you use?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

duhpuck
New user
New user
Posts: 3
Joined: 2010-11-03 04:31

Re: Client won't update to reflect message deletion on serve

Post by duhpuck » 2010-11-03 07:17

The latest version of hMailServer (5.3.3, build 1879), and Outlook 2007.

User avatar
mattg
Moderator
Moderator
Posts: 19880
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Client won't update to reflect message deletion on serve

Post by mattg » 2010-11-03 07:28

What happens in thunderbird or any other mail client?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

duhpuck
New user
New user
Posts: 3
Joined: 2010-11-03 04:31

Re: Client won't update to reflect message deletion on serve

Post by duhpuck » 2010-11-04 23:31

I downloaded Thunderbird but was unable to quickly figure out how to connect to my local test hMailServer install. I would have spent more time on it but opted instead to try a completely different approach which doesn't involve using IMAP folders. Sorry that leaves the question unanswered. If I get a chance to try later I'll post the result.

Thanks for the assistance.

RubenT
New user
New user
Posts: 7
Joined: 2010-11-26 12:29

Re: Client won't update to reflect message deletion on serve

Post by RubenT » 2010-12-03 09:40

I have an account rule to run function that delete the email, the delete method don´t work (or I don´t know how to do it)

Code: Select all

Sub DeleteMessage(oMessage)
     oMessage.delete
     oMessage.save
end Sub
with this function can´t delete too

Code: Select all

Sub DeleteMessage(oMessage)
     address=oMessage.Recipients(0).Address
     vaddress=Split(address,"@")
     domainaddress=vaddress(1)
     Dim obApp
     Set obApp = CreateObject("hMailServer.Application")
     Call obApp.Authenticate("Administrator", "xxxxx")
     Set obCuenta = obApp.Domains.ItemByName(domainaddress).Accounts.ItemByAddress(address)
     obCuenta.Messages.itembydbid(oMessage.ID).DeleteByDBID(oMessage.ID)
     Set obCuenta=Nothing
     Set obApp = Nothing
end Sub
what is the problem?

In an account rule, can I delete the message with scriptting? the email don´t delete from db, if I set oMessage.ID manually in script, I can delete a old message, but don´t work with the real time email.

Post Reply