How to configure hMailServer to delete a message after it is retrived?

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
grudnitzki
New user
New user
Posts: 3
Joined: 2021-04-08 01:38

How to configure hMailServer to delete a message after it is retrived?

Post by grudnitzki » 2021-04-08 01:56

I know how to mass delete messages that are X days old.

I would like to force hMailServer to automatically delete a message right after it is downloaded by the receiver.

Is it possible?
Can I use a script for that?

mikedibella
Senior user
Senior user
Posts: 435
Joined: 2016-12-08 02:21

Re: How to configure hMailServer to delete a message after it is retrived?

Post by mikedibella » 2021-04-08 02:30

I don't think the event handlers give you visibility into that level of detail. OnClientConnect will tell you that a client connected on a particular port; you don't get any detail into what the client is doing beyond that.

Why don't you have the mail client handle mailbox cleanup? Most clients have an option for POP3 retrieval to delete messages after download.

If there is something unique to your use case, provide more details.

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

Re: How to configure hMailServer to delete a message after it is retrived?

Post by palinka » 2021-04-08 04:07

grudnitzki wrote:
2021-04-08 01:56
I would like to force hMailServer to automatically delete a message right after it is downloaded by the receiver.
I think running a handler script that looks at flags could do what you want.

However, right after would mean as soon as the script runs looking for seen messages, run from task scheduler.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8960
Joined: 2011-09-08 17:48

Re: How to configure hMailServer to delete a message after it is retrived?

Post by jimimaseye » 2021-04-08 08:52

That's a dangerous thing to do. Just because a client requests a download it doesn't mean ory was received by the client to the point that the user can see the message. What you are asking is the same functionality of what a pop3 download (by the client) sores with the 'delete immediately' setting which at least leaves the control with the mail client which knows what you do with the message (the client remains in control) . So why not just use pop3?. By doing it with Imap you are defying the point of imap, and risk losing the message before a client has acknowledged receiving and happy with it.

[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

grudnitzki
New user
New user
Posts: 3
Joined: 2021-04-08 01:38

Re: How to configure hMailServer to delete a message after it is retrived?

Post by grudnitzki » 2021-04-16 01:15

The problem is that many people never delete their messages from the server, keeping it there forever.

I already delete old messages (read and unread), which is even more dangerous than deleting after downloading, as the customer may be away for a long time due to vacation or illness.

mikedibella
Senior user
Senior user
Posts: 435
Joined: 2016-12-08 02:21

Re: How to configure hMailServer to delete a message after it is retrived?

Post by mikedibella » 2021-04-16 01:23

I'd suggest you need to enforce Quotas. IMO, your customers will expect to be able to use all the storage they are entitled to. You, as the authority, are within your right police them if they exceed that. That might be to enforce deletion of older messages or some other consequence.

grudnitzki
New user
New user
Posts: 3
Joined: 2021-04-08 01:38

Re: How to configure hMailServer to delete a message after it is retrived?

Post by grudnitzki » 2021-04-16 22:10

Every user has a 100MB quota, which is very small but needed because of the backup size bug.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8960
Joined: 2011-09-08 17:48

Re: How to configure hMailServer to delete a message after it is retrived?

Post by jimimaseye » 2021-04-16 22:16

grudnitzki wrote:
2021-04-16 22:10
Every user has a 100MB quota, which is very small but needed because of the backup size bug.
There is no "bug".

Explain.
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

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

Re: How to configure hMailServer to delete a message after it is retrived?

Post by palinka » 2021-04-17 00:52

What Jimi means is that there is no bug where hmailserver/the documentation shows there is a limit of 1.5gb. Or 15gb or whatever it says. You must have an older version.

To get around that limitation, upgrade hmailserver -or- use a backup script.

My backup script (based on Jimi's): https://hmailserver.com/forum/viewtopic.php?f=9&t=35447

Jimi's backup script: https://hmailserver.com/forum/viewtopic ... 21&t=28139

Post Reply