LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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, 01: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, 11:36 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,470
Blog Entries: 54

Rep: Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901
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
 
  


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 04:49 AM
changing env variables aceone Red Hat 7 06-25-2012 06:13 AM
changing default file permissions upon file creation ceci2 Linux - Newbie 7 10-01-2009 07:27 AM
Changing directory default creation mask for specific folder - NOT samba. maginotjr Linux - General 3 01-21-2009 09:36 AM
Changing default user creation BEBigBear Linux - Desktop 3 06-24-2007 03:39 PM


All times are GMT -5. The time now is 08:06 PM.

Main Menu
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