Maildir not created for new user

Postfix, Dovecot running on Opensuse 12.2 authenticating with pam

My initial user on the server is able to send and receive mail. However new users do not get the Maildir directory added to them automatically. How do I do that?

Thanks in advance for any help.

Do you mean on creation of new users by YaST > Security and users > User and group management?

Yes, I did add the new user via YaST > Security and users > User and group management

The initial files created by YaST for a new user in his/her home directory are a copy of what is in /etc/skel as this is defined in the Defaults for New Users tab in the User and Group Administration.

You could either
. add a directory Maildir in /etc/skel (but I would not prefer changing manualy these sort of files. The changce that they are restored to the original state due to a reinstall of the package that contains them, e.g. for an update, are great andd allways happen when one does not expect it);
. create a copy /etc/skel in e.g. the home directory ofroot (do not forget to bakup things there before you reinstall the system, change that one to your needs and then point to it from the tab mentioned above.

Thanks for your answer. I just want to clarify before I try this.

So if I just make a Maildir directory in /etc/skel the potential problem is that in the future if postfix or dovecot (and possibly other packages) get reinstalled then all of my users could potentially get their Maildir emptied. So it is better to copy all files/folders from /etc/skel to /root/skel and add a Maildir into /root/etc/skel. Then go into Yast and point to the new skel folder.

If I add new packages in the future, is there the potential that /etc/skel will get altered? Therefore, I need to be aware of the potential of needing to backup /root/skel, copying /etc/skel to root/skel, then adding Maildir to /root/skel again, right?

Needs more study I guess.

First is that /etc/skel is installed with the package “filesystem”. In fact this package installs (amongst other files):

/etc/skel
/etc/skel/.config
/etc/skel/.fonts
/etc/skel/.local
/etc/skel/bin


As my /etc/skel looks like this

boven:/etc/skel # l
total 60
drwxr-xr-x   7 root root  4096 Dec 11 12:54 ./
drwxr-xr-x 124 root root 12288 Dec 29 11:43 ../
-rw-------   1 root root     0 May 18  1996 .bash_history
-rw-r--r--   1 root root  1177 Aug  4 09:15 .bashrc
drwx------   2 root root  4096 Jul 15 08:19 .config/
-rw-r--r--   1 root root  1637 Aug  7 09:21 .emacs
drwxr-xr-x   2 root root  4096 Jul 15 08:19 .fonts/
-rw-r--r--   1 root root   861 Aug  7 09:21 .inputrc
drwx------   2 root root  4096 Jul 15 08:19 .local/
-rw-r--r--   1 root root  1028 Aug  4 09:15 .profile
-rw-r--r--   1 root root  1940 Jun 22  2012 .xim.template
-rwxr-xr-x   1 root root  1602 Jul 16 16:20 .xinitrc.template*
drwxr-xr-x   2 root root  4096 Jul 15 08:19 bin/
drwxr-xr-x   2 root root  4096 Aug 24 22:22 public_html/
boven:/etc/skel #

There are definitely more packages involved in adding to this. I tried a quick search, but could not find them. In any case the “postscript” package does not install a file there. I do not know for “dovecot” as I have not installed it (but you can check in YaST > Sofware > Software management, search for it, select it and use the Files tab below).

Now you report that one user has the Maildir directory. As I read it, you suggest there that this must be done at creation of the user. Are you 100% sure that it wasn’t created later?

I am not sure that Dovecot should create that Maildir in /etc/skel and I guess that you don’t know either, but you thought it would do it because of the one user that has it (and you can not explain why, except at creation).

In any case as it is now, I start doubting if my first remark was correct. In general, it is. Because changing something that will be overwritten when the package were it belongs to is reinstalled is not clever. But in this case it seems that some packages simply add files in /etc/skel as needed. Thus when you add Maildir there, only a fresh installation will loose it (and while you made extensive documentation about what to do in case of … you will duly recreate it immedialtly).

What is definitely not true is that any of your users Maildir directories will be emtied or removed on an installation that changes something in /etc/skel. /etc/skel is only consulted at new user creation to create a skeleton inside his/her home directory. No dynamics afterwards. If you e.g. decide that your users should have a directory called messed-up in their home directory, you must create those files in all users home directories (using a script or just manualy, as root), but you can spare that extra action for any new, later to be created users by adding it in /etc/skel.

To be honest, no I am not sure when the Maildir directory gets created. And I am not sure if Postfix or dovecot creates it, i think it is postfix. My initial user did not have the Maildir on it as I had not installed Postfix or Dovecot before creating that user. now I am trying to add a second user to my email server and getting issues with the second user not authenticating and there is no Maildir in that user. So to sum up, I have one user that is able to send and recieve mail, but when trying to create new users, they are not able to use the mail

It could be that it is created when the user starts hsi mail program for the first time. After all many applications do this. KDE creates a mass of them, Firefox does, and many more.
I suggest that your authentication problem should be addresses first. And that, when the user can run normaly, his Maildir will then be created autimagicaly.

Thanks for all your help. I will keep looking into this

Don’t know if applicable here, but I do know for some mail systems the individual User directories are not created unless and until a message is sent to that mail account so as part of the setup as the Mail Admin you should <always> send a test or welcoming message.

Until that message is sent to the User the User may not be able to send (if SMTP is integated with the mailserver) or open a mail client configured for that account.

HTH,
TSU

Thanks tsu2, this is applicable in this situation. The user gets created, then the Maildir files show up once a message is sent to that user.

Now I’m just having an authentication problem. But I think that is a Dovecot configuration issue.

So to sum up for others in the future, create the new user and then send that user an email, all should be good

Excelent summing up! Thanks.

And a pleasure to try to help you.