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?
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?
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.
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.