LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 12-17-2012, 02:28 AM   #1
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 866

Rep: Reputation: 110Reputation: 110
Changing Users Default Env variables at creation


Okay Thanks for helping me for starters. I just installed postfix and dovecot on my CentOS 6 Server and got it configured to use system users. Now I also got the default mail dir

$HOME/Maildir

So what I am trying to figure out is how would I stop the /var/spool/mail file from creating and changed the users default MAIL variable to $HOME/Maildir

Now I changed the MAIL variable by editing /etc/skel/.bash_profile and adding these 2 lines.

Quote:
MAIL=$HOME/Maildir
export MAIL
And I added another file to /etc/skel/Maildir with permissions 0700

Now I think there is another way to achieve this and would like some suggestions.

Thanks again
 
Old 01-13-2013, 12:36 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,693
Blog Entries: 54

Rep: Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961
Quote:
Originally Posted by jmc1987 View Post
(..) how would I stop the /var/spool/mail file from creating and changed the users default MAIL variable to $HOME/Maildir
I don't understand that unless you mean "changing from something else to $HOME/Maildir".


Quote:
Originally Posted by jmc1987 View Post
Now I changed the MAIL variable by editing /etc/skel/.bash_profile and adding these 2 lines.
And I added another file to /etc/skel/Maildir with permissions 0700
/etc/skel/ files are dumped in the users account on account creation which means they'll be subject to any change the user makes (also note ~/.bash_profile won't be read if BaSH is invoked as "/bin/sh" but instead ~/.profile). For BaSH and Bourne Shell variables are read from the /etc/profile.d/ directory (see /etc/profile) so you should be able to get away by setting
Code:
echo 'MAIL="${HOME}/Maildir"; export MAIL' > /etc/profile.d/maildir.sh
just once.



//NTLB
 
Old 12-09-2014, 08:16 PM   #3
rlj4214
LQ Newbie
 
Registered: Dec 2014
Distribution: Centos 7 Postfix Dovecot MySQL Webmin 1.720
Posts: 11

Rep: Reputation: Disabled
Question No ~/Maildir created with user automatically

System is Centos 7
Postfix
Dovecot
MySQL

Frankly I am more than a little surprised that creating a user is not creating the ~/Maildir with the correct permissions and any sub-folders that are needed. I would have thought that was a "gimmie" so to speak.

I would like to set up user creation so that it automatically adds the ~/Maildir with the correct permissions and I guess files structures.

I tried your command

" echo 'MAIL="${HOME}/Maildir"; export MAIL' > /etc/profile.d/maildir.sh "

and while it appears in /etc/profile.d it is not propagated to the users created. At least it didn't work for me.

I have read documents till I'm blue in the face for the past 2 days and have no answer. This thread was as close as I got and like I said, no go.

I'm still trying to figure out how to do this other than /etc/skel

Thanks for your help in advance.
 
Old 12-09-2014, 08:26 PM   #4
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,590

Rep: Reputation: 1228Reputation: 1228Reputation: 1228Reputation: 1228Reputation: 1228Reputation: 1228Reputation: 1228Reputation: 1228Reputation: 1228
Hi,

please start a new thread for your question. When you do, please include what method you are using to create new users.

Regards,

Evo2.
 
Old 12-09-2014, 08:52 PM   #5
rlj4214
LQ Newbie
 
Registered: Dec 2014
Distribution: Centos 7 Postfix Dovecot MySQL Webmin 1.720
Posts: 11

Rep: Reputation: Disabled
ok thanks

ok thanks
 
Old 12-09-2014, 08:55 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,693
Blog Entries: 54

Rep: Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961Reputation: 2961
Quote:
Originally Posted by evo2 View Post
please start a new thread for your question.
Instead please report, or have the member report, the posts for moving.
That's prolly less work than mods having to trawl fora for duplicates.
TIA
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing env variables of another sessions cepal Linux - General 3 06-28-2012 05:49 AM
changing env variables aceone Red Hat 7 06-25-2012 07:13 AM
changing default file permissions upon file creation ceci2 Linux - Newbie 7 10-01-2009 08:27 AM
Changing directory default creation mask for specific folder - NOT samba. maginotjr Linux - General 3 01-21-2009 10:36 AM
Changing default user creation BEBigBear Linux - Desktop 3 06-24-2007 04:39 PM


All times are GMT -5. The time now is 11:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration