Koozali.org: home of the SME Server

recreated user mailbox unable to received mail

Offline GadoF

  • *
  • 31
  • +0/-0
recreated user mailbox unable to received mail
« on: February 26, 2024, 12:48:28 AM »
hi,

 I have this issue , mailbox was deleted and then recreated it again. However i encounter this issue no email was found on the user mailbox. Checking the logs and found this:
   deferral: Unable_to_switch_to_/home/e-smith/files/users/abc_mailbox:_access_denied._(#4.3.0).

Does anyone encounter this issue ?

Offline Jean-Philippe Pialasse

  • *
  • 2,813
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: recreated user mailbox unable to received mail
« Reply #1 on: February 26, 2024, 02:50:00 AM »
if user deleted and recreated :
- content of /home/e-smith/files/user/username will be deleted then recreated from scratch
- uid and gid it will not be the same

hence if you have restored a backup of the user home folder, you need to do

chown username:username -R /home/e-smith/files/user/username

Offline GadoF

  • *
  • 31
  • +0/-0
Re: recreated user mailbox unable to received mail
« Reply #2 on: February 26, 2024, 03:06:47 AM »
i recreated the user account and did not restore from the backukp and encountered the issue, should I run the command you gave me ?
« Last Edit: February 26, 2024, 03:25:09 AM by GadoF »

Offline Jean-Philippe Pialasse

  • *
  • 2,813
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: recreated user mailbox unable to received mail
« Reply #3 on: February 26, 2024, 04:23:29 AM »
well it would be interesting to first know what says

ll -d /home/e-smith/files/user/username


Offline GadoF

  • *
  • 31
  • +0/-0
Re: recreated user mailbox unable to received mail
« Reply #4 on: February 26, 2024, 05:49:21 AM »
here's the result

drwx------ 5 abc_userfolder abc_userfolder 142 Feb 25 10:23 /home/e-smith/files/users/abc_userfolder

Offline bunkobugsy

  • *
  • 281
  • +4/-0
Re: recreated user mailbox unable to received mail
« Reply #5 on: February 26, 2024, 11:19:00 AM »
for me

drwx--x---+ 4 username           username           141 Feb  4 18:45 username

Offline bunkobugsy

  • *
  • 281
  • +4/-0
Re: recreated user mailbox unable to received mail
« Reply #6 on: February 26, 2024, 07:42:30 PM »
inside that

drwxr-xr-x   2 username username   10 Sep 19  2013 home
drwxrwsr-x+ 18 username username 4096 Feb 26 15:49 Maildir

in Maildir

drwxrwsr-x+ 2 username username  684032 Feb 26 15:49 cur
-rw-rw-r--+ 1 username username       0 Apr 22  2020 dovecot-acl-list

and in cur (mail) files are

-rw-r--r--+ 1 username username     7355 Feb 26 15:36 1708954581.28602

everything should be owned username:username

mailforders seem to be 775 and files 644 or 664

Offline GadoF

  • *
  • 31
  • +0/-0
Re: recreated user mailbox unable to received mail
« Reply #7 on: February 27, 2024, 12:48:15 AM »
yeah same level of rights , but i am just wondering the email i sent to the mailbox was denied or not being delivered.

Offline Jean-Philippe Pialasse

  • *
  • 2,813
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: recreated user mailbox unable to received mail
« Reply #8 on: February 27, 2024, 01:45:35 AM »
what about


ll -a /home/e-smith/files/user/username

and

ll /var/spool/username

Offline GadoF

  • *
  • 31
  • +0/-0
Re: recreated user mailbox unable to received mail
« Reply #9 on: February 27, 2024, 03:51:11 AM »
ll -a /home/e-smith/files/user/username

result :

total 52
drwx------    5 user user   142 Feb 25 10:23 .
drwxr-xr-x. 726 root    root    20480 Feb 27 08:48 ..
drwxr-xr-x    2 user user     6 Jan 31  2013 home
drwxr-xr-x    6 user user   167 Feb 25 10:17 Maildir
-rw-------    1 user user   675 Feb 25 09:50 .mailfilter
-rw-------    1 user user   806 Feb 25 09:50 .procmailrc
-rw-r--r--    1 user user   556 Feb 25 10:18 .qmail
lrwxrwxrwx    1 root    admin       6 Feb 25 09:50 .qmail-default -> .qmail
-rw-r--r--    1 user user   482 Feb 25 09:50 .qmail-junkmail
drwx------    2 user user     6 Jan 31  2013 .ssh

ll /var/spool/mail/username

-rw-rw---- 1 user mail 0 Feb 25 09:50 /var/spool/mail/user
 

Offline bunkobugsy

  • *
  • 281
  • +4/-0
Re: recreated user mailbox unable to received mail
« Reply #10 on: February 27, 2024, 06:02:42 AM »
You could do it by the book again:
-save all emails and files
-delete user
-create it again
-don't mess with emails/folders from console
From a work pc:
-rename every email to *.eml
-drop them into mail folders (inbox/sent/etc) via imap email client
-restore files

Offline bunkobugsy

  • *
  • 281
  • +4/-0
Re: recreated user mailbox unable to received mail
« Reply #11 on: February 27, 2024, 06:10:30 AM »
drwxr-xr-x    6 user user   167 Feb 25 10:17 Maildir

for me

drwxrwsr-x+ 18 username username 4096 Feb 26 15:49 Maildir

would explain " deferral: Unable_to_switch_to_/home/e-smith/files/users/abc_mailbox:_access_denied._(#4.3.0)."

Offline Jean-Philippe Pialasse

  • *
  • 2,813
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: recreated user mailbox unable to received mail
« Reply #12 on: February 27, 2024, 06:17:00 AM »
you have the default values. I see no evident cause.  Have you restarted qmail?

Offline GadoF

  • *
  • 31
  • +0/-0
Re: recreated user mailbox unable to received mail
« Reply #13 on: February 27, 2024, 06:48:59 AM »
I restarted the server multiple times. the mailbox is not able to receive the test mail I am sending.

you have the default values. I see no evident cause.  Have you restarted qmail?

Offline bunkobugsy

  • *
  • 281
  • +4/-0
Re: recreated user mailbox unable to received mail
« Reply #14 on: February 27, 2024, 08:00:48 AM »
Try saving the user from server-manager then running from reboot or shutdown > reconfigure.