Removing Mail Accounts

I have a somewhat similar issue that could be related to this. Itā€™s not about a disappearing account after an app password change, but rather about a deleted account that canā€™t quite be deleted. But the overall symptoms appear very similar and as with OP I feel the need to find a way to fully purge all mail data in some way (Unremovable Mail Fragments: Purge Nextcloud Mail and/or Specific Mail Accounts)

If losing literally everything mail related isnā€™t issue then running this in SQL should help.

  1. Remove Mail app using Web UI

  2. DELETE FROM oc_migrations WHERE app=ā€˜mailā€™;
    DELETE FROM oc_preferences WHERE appid=ā€˜mailā€™;
    DROP TABLE IF EXISTS oc_mail_accounts,oc_mail_aliases,oc_mail_attachments,oc_mail_classifiers,oc_mail_coll_addresses,oc_mail_mailboxes,oc_mail_messages,oc_mail_messages,oc_mail_recipients,oc_mail_trusted_senders;

  3. Install Mail app again

Super helpful! Thank you.

Thankfully, mine was the only mail account in use as I was trialing the mail app, so deleting it entirely was fine and reset everything.

1 Like

Thanks, Iā€™m going to try this out so I can at least get Mail functioning again while the Groupware Team looks into my OP.

I assume this would also purge calendars and tasks, as they are associated with the mail accounts?

Hello @jsb,

We figured out what is wrong and we already pushed a PR for that: Make first mailbox of navigation account optional by GretaD Ā· Pull Request #4419 Ā· nextcloud/mail Ā· GitHub

After the fix, the account will be shown like this: mail_nuuu

And the user can change the password, or delete the account from the action menu.

Thank you,
Greta

2 Likes

As a followup, today I tried uninstalling Mail, then installing Mail version 1.8, since I believe @Gretaā€™s PR was merged and backported into 1.8. I was still unable to see or edit settings for the mail account that was producing the ā€œauthentication errorā€ messages in my OP.

I then followed @Morelciaā€™s steps for removing mail data, and Iā€™m now unable to see the Mail app in the browser based app store. Also, running sudo -u apache php occ app:install mail results in ā€œError: Could not download app mailā€.

Iā€™m now running version 20.0.6 with PHP 7.14.4, and I wonder if my inability to install Mail is related to this: I can't download

It was backported, yes, but there was no release of 1.8.1 yet.

Yes it is. There is a regression in 20.0.6. https://github.com/nextcloud/server/pull/25335 fixes it and will be released with 20.0.7.

1 Like

will this commit make it possible to delete a single email-account without trashing all usersā€™ settings ?

or better : is the a valid way to just delete a single userā€™s mail account (1) or accounts (1+) ?

1 Like

yes.

Not yet, but it would make sense to offer this via occ. Mind opening a feature request for a occ mail:account:delete?

1 Like

thank you! :slight_smile:

1 Like

I am running 20.0.7 and have improperly configured email accounts that I cannot delete. I see the account listed, it has a stop sign with a ā€˜!ā€™ in it. When I select the ā€˜ā€¦ā€™ menu for the account, it displays briefly and then goes away and the ā€˜ā€¦ā€™ is no longer present. This occurs with Edge, Chrome, and Firefox.

mind sharing a screenshot?



It turns out that the email account that Iā€™m trying to attach to is hosted on NethServer and I may have read something about the Horde libraries not liking the fact that some ā€œpublicā€ mail folders arenā€™t shared in NethServer by default. Does that ring a bell?

I found a solution. I needed to make the ā€˜Publicā€™ folder readable on the NethServer installation.

doveadm acl set -A Public authenticated lookup read

Source:

https://community.nethserver.org/t/no-nethserver-email-via-nextcloud-mail-app/13394/40

This allowed me to connect to the email accounts. I was then able to delete the accounts. It still would have been nice to be able to delete the accounts when they were in their ā€œBadā€ state. Perhaps that is a followup on the Nextcloud side.

1 Like

It does. There are some other reports about this. Basically Horde chokes when it tries to read those :confused:

Did the Remove account action not work?

When I would click on the ā€˜ā€¦ā€™ menu, it would only show for less than a second - not enough time for me to make any selections. I just happened by luck to capture a screen shot of the menu being displayed! Once the menu automatically went away, the ā€˜ā€¦ā€™ menu button was hidden and I would have to refresh the page in order to get it to be displayed again.