Cleaning the Data folder and old messages

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
mars_wilson
New user
New user
Posts: 7
Joined: 2020-01-22 18:13

Cleaning the Data folder and old messages

Post by mars_wilson » 2020-01-28 18:41

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

palinka
Senior user
Senior user
Posts: 1921
Joined: 2017-09-12 17:57

Re: Cleaning the Data folder and old messages

Post by palinka » 2020-01-28 18:51

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.

mars_wilson
New user
New user
Posts: 7
Joined: 2020-01-22 18:13

Re: Cleaning the Data folder and old messages

Post by mars_wilson » 2020-01-28 23:44

Thank you that was VERY helpful!

Post Reply