Zombie mail account in Nextcloud

NethServer Version: 7.9
Module: Roundcube, Nextcloud

Hello,
I have activated the mail app in Nextcloud and configured the mail accounts.
Additional to each personal mail account appears an additional mail account like <1234-5678-91011-...@mydonain.tld>


This account cannot be configured or deleted manually. It simply exists and every time the mail app is started, the mail query for this zombie account apparently times out, which slows down usage significantly.

Does anybody have an idea how to delete these zombies?

  1. These zombies are not existing within the user list of NextCloud. There are correctly only the real and administrative users.
  2. Nextcloud is connected to the Active directory provider. If I search the ID (or part of the ID like in the screenshot above) with phpLDAPadmin, nothing is found.

Best regards, MArko

Do you have a custom LDAP filter or group for nextcloud?
I assume that’s the objectGUID of the AD user account:

net ads search -P samaccountname=admin |grep GUID

How have you configured the Mail App? Did you use its Account provisioning?

occ mail:account:export admin
2 Likes

You need to change %USERID% to %EMAIL% in the groupware settings to avoid the zombie mail accounts with the UIDs and create right ones. Instead of localhost in the screenshot you need to set the FQDN like server.domain.tld.

To check account settings:

sudo -u apache /opt/rh/rh-php73/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ mail:account:export <UID>

For admin:

sudo -u apache /opt/rh/rh-php73/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ mail:account:export admin

See Mail app docs for more information.

See also:

2 Likes

Yes, this results the ID from the screenshot above:

[root@srv01 ~]# net ads search -P samaccountname=admin |grep GUID
objectGUID: b2b59d29-9244-41c0-b190-21031a342466

[root@srv01 ~]# occ mail:account:export admin

Account 16:

  • E-Mail: admin@mydomain.tld.de
  • Name: admin
  • IMAP user: admin
  • IMAP host: imap.mydomain.tld:143, security: tls
  • SMTP user: admin
  • SMTP host: smtp.mydomain.tld:587, security: tls
    [root@srv01 ~]#

Before any changes:

[root@srv01 ~]# sudo -u apache /opt/rh/rh-php73/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ mail:account:export admin
Account 16:

  • E-Mail: admin@mydomain.tld.de
  • Name: admin
  • IMAP user: admin
  • IMAP host: imap.mydomain.tld:143, security: tls
  • SMTP user: admin
  • SMTP host: smtp.mydomain.tld:587, security: tls
    [root@srv01 ~]#

    (the same result like occ mail:account:export admin above)

At the moment I have such configuration

I will change %USERID% against %EMAIL%

Is SIEVE mandatory/recommended? What is the right subdomain for the host parameter? My DNS provides me smtp.mydomaiin.tld, imap.mydomaiin.tld and mail.mydomaiin.tld

Sincerely, Marko

It worked well. Now I have two mail identical accounts within the mail app of each NC-account. One is deletable, one not. I deleted these one and it looks fine within NC mail app.

[root@srv01 ~]# sudo -u apache /opt/rh/rh-php73/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ mail:account:export admin

Account 16:

Thank you very much!

Last open question:

Is SIEVE mandatory/recommended? What is the right subdomain for the host parameter? My DNS provides me smtp.mydomaiin.tld, imap.mydomaiin.tld and mail.mydomaiin.tld

1 Like

Sieve is for setting up mail rules but I never tested with Nextcloud. All domain names should be ok as long as they point to your server.

1 Like

One issue after the changes…

When I send a mail from a user account (not admin) like max.musterman@mydomain.tld, it is actually sent from max_mustermann@mydomain.tld. The mail account don’t use the alias max.musterman (with the dot as separator).

Is that perhaps the problem?

With the admin account it was not recognizable. But the two existing mail accounts differ exactly in that. One of them is the systematic one (with underscore as separator), the other (deletable) one is the one for the alias (with dot as separator).
I had not noticed this before. So I am not allowed to delete this one.

Confusing:

[root@srv01 ~]# sudo -u apache /opt/rh/rh-php73/root/usr/bin/php -d memesory_limit=512M /usr/share/nextcloud/occ mail:account:export max_mustermann
[root@srv01 ~]#

that means without any result

The problem is that %EMAIL% doesn’t return the alias email you are using. I don’t have a solution yet, maybe it works to edit the AD mail field with phpldapadmin? I’m not in front of a pc now, going to test things later today…

Yes, indeed. Inside of NC mail app it worked and I can send and receive mail to this changed account.
But the mail prefix is not changed
image

For AD users the UID is needed:

sudo -u apache /opt/rh/rh-php73/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ mail:account:export <UID of max_mustermann>

It’s not a mail prefix in your screenshot, it’s the users full name and username.

1 Like

A side effect of the change is that the users cannot log in to the Dokuwiki with max_mustermann (but also not with max.mustermann).

Does it work when you login to dokuwiki with domain like max_mustermann@domain.tld ?

I guess that the account suffix in /etc/dokuwiki/local.protected.php is the server domain but that does not match the mail suffix in the AD mail field.

1 Like

No, I tried it too.

I assume you already tried to login with the mail address or the alias mail address?

Please check logs in /var/opt/rh/rh-php73/log/php-fpm/

Do the settings in /etc/dokuwiki/local.protected.php match your mail address/domain?