Page 1 of 1

Cleaning the Data folder and old messages

Posted: 2020-01-28 18:41
by mars_wilson
I'm using hMailServer as a local relay for outbound email for our organization. The server isn't configured for receiving messages at all. Additionally, users don't check email on the server.

* I've set up an account for each user (for authentication) so that they can send emails through the server. Works ok.

* I've set up mail rules for each user, so that if a message is undeliverable , it gets forwarded to them as a bounce notice. Works ok.

Problem is: the undeliverable messages are piling up in the "Data" folder. I want to automatically delete them.
I've added a "Delete" mail rule action after the "Forward" mail rule action, but the messages persist.

How do I keep the mail server clean of bounced messages?

Would this work - since I don't really care about these messages - is it safe to just delete the message files out of the Data folder (and leave the corresponding messages in the database hm_messages table even)?

Thank you,

Mars

Re: Cleaning the Data folder and old messages

Posted: 2020-01-28 18:51
by palinka
http://hmailserver.com/forum/viewtopic.php?f=21&t=28139

Look here for the Emailcleardown.vbs script. Run it daily or weekly from task scheduler.

I'm sure it could be greatly simplified since you probably don't care about keeping ANY message.

Re: Cleaning the Data folder and old messages

Posted: 2020-01-28 23:44
by mars_wilson
Thank you that was VERY helpful!