Is "Discard all mail" working as intended?

I have noticed that the “Discard all mail” option doesn’t seem to do much when it is ticked on its own. It only really has the desired effect of discarding all mail if you also tick the “Do not store forwarded mail” option as well. Is this how it is intended to be? If so, it is a little confusing that the “Do not store forwarded mail” option is hidden when the “Discard all mail” option is active, as you have to disable it to unhide the “Do not store…” option, to tick this, and then re-enable the “Discard…” option! Seems a little counter-intuitive? Is there any reason why the “Discard all mail” option cannot simply invoke the other option automatically? Thanks for reading.

When you select Discard all mail it automatically selects and hide Do not store forwarded mail

It makes sense that it should do that, but it’s certainly not doing that for me! If I select “Discard all mail” then hit save, I still receive mail. The “Do not store forwarded mail” certainly becomes hidden, but it has not been automatically selected behind the scenes as I still see mail being received.

If I select both “Discard all mail” and “Do not store forwarded mail” myself, then hit save, it does indeed work as expected. So I don’t see the behaviour you describe, where “Do not store forwarded mail” is automatically selected.

I have checked with both Firefox and Edge, and I am on Hestia v1.8.12 on Debian 12.4.

I don’t use any of those options but if I’ve time, tomorrow will check them to see whether I’ve the same issues on my server.

I’ve tested it right now (Hestia 1.8.12 and Debian 12.7) and when creating a new mail account ([email protected]), selecting Discard all mail and Saving, I don’t receive any mail, indeed Hestia does two things:

1.- Adds the mail account name to fwd_only file:

$ cat /home/user/conf/mail/example.net/fwd_only
test

2.- Adds an alias for the mail account pointing to :blackhole:

$ cat /home/user/conf/mail/example.net/aliases
[email protected]::blackhole:

Thanks for testing.

Could you also try enabling the “Discard all mail” setting on a pre-existing mail account and see if it works correctly, as this is where I am seeing the issue. Maybe there is an issue with processing the settings of an existing account vs no issue when selecting this option while creating a new account?

1 Like

No problem :wink:

I did and now I see the problem.

1.- When editing an existing mail account, selecting Discard all mail doesn’t select and hide the option Do not store forwarded mail causing that mails sent to that account reach the inbox.

2.- If you edit an existing mail account, select Discard all mail and don’t select option Do not store forwarded mail and Save. When you edit again the mail account, the option Do not store forwarded mail is not available so you need to unselect Discard all mail, Save and edit one more time the mail account to view both options again.

So, this is a bug.

Adding a new mail account works as expected and it uses this php file:

/usr/local/hestia/web/add/mail/index.php

Editing an existing account doesn’t work as expected and it uses this php file:

/usr/local/hestia/web/edit/mail/index.php

I know nothing about php so I can’t help here.

Could you please open an issue on Hestia’s GitHub https://github.com/hestiacp/hestiacp/issues?

Yes of course, I’ll take a quick look at the code on GitHub and see if I see anything obvious, but I’ll open an issue either way.

Thanks for checking and confirming the behaviour :slightly_smiling_face: