Clear the delivery queue using script?

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
hellem
New user
New user
Posts: 1
Joined: 2020-08-16 20:54

Clear the delivery queue using script?

Post by hellem » 2020-08-16 21:14

We are using the hMailserver for our test environment and we want to administer it as "little" as possible. It should not be possible to send emails from the server, and most of the test cases won't do that, but some does which causes the delivery queue to grow. That means I do not need to worry about checking if they are legit or not, I can safely delete all.

Deleting the content of the data-directory (*.eml-files) was the solution before, but not now https://www.hmailserver.com/documentati ... ery_queue . Ok, the doc does not describe any other option, so it is likely to assume that it cannot be done using scripting.

But, then there is the event onDeliverryfailes - https://www.hmailserver.com/documentati ... veryfailed - it it possible to just clear/delete the message in that event?

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

Re: Clear the delivery queue using script?

Post by mattg » 2020-08-17 01:00

hellem wrote:
2020-08-16 21:14
Deleting the content of the data-directory (*.eml-files) was the solution before, but not now https://www.hmailserver.com/documentati ... ery_queue . Ok, the doc does not describe any other option, so it is likely to assume that it cannot be done using scripting.
https://www.hmailserver.com/documentati ... iveryqueue

You could certainly script it

Code: Select all

		dim oApp
		Set oApp = CreateObject("hMailServer.Application")
		Call oApp.Authenticate("Administrator", "topSecretPassword")
		Call oApp.GlobalObjects.DeliveryQueue.Clear()
hellem wrote:
2020-08-16 21:14
But, then there is the event onDeliverryfailes - https://www.hmailserver.com/documentati ... veryfailed - it it possible to just clear/delete the message in that event?
Message has already been removed from delivery queue at this stage
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply