LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-14-2008, 10:18 AM   #1
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Rep: Reputation: 15
sendmail question: how to move user mailboxes to /home


Hello. I am running a linux (Fedora Core 4) server running Sendmail with the following version info:
Code:
Version 8.13.6
 Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
                MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
                NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
                TCPWRAPPERS USERDB USE_LDAP_INIT
Email works fine, but all messages are placed in mailboxes in /var/mail (which is actually a symlink to /var/spool/mail), and this is filling up my /var partition. I want the email to be subject to users' quota settings, so I need to move their mailboxes inside their /home/[username] directories.

My question is as follows:
How can I move a user's mailbox to his own home directory (i.e. /home/username/mailbox/[mailbox name goes here]

I have tried the following sequence of steps:
1. Stop the sendmail daemon (service sendmail stop)
2. Move the mailbox file into a subdirectory of the user's /home directory.
3. Create a symlink in /var/spool/mail pointing to the mailbox file in the /home directory.
4. Restart sendmail (service sendmail start)

After doing this, sendmail creates a symlink in the /var/spool/mail directory called BOGUS.[username].[random characters] pointing to the symlink, then re-creates the standard mailbox as a file in /var/spool/mail

Also, I use OpenWebMail and when I attempt to log in for one of these users, I get the error "Couldn't get read lock on /var/spool/mail/[username]!"


Does anyone know the correct procedure for moving mailboxes to the users' directories? Possibly a sendmail.cf change?

Thank you very much!


Krasl
 
Old 03-14-2008, 10:37 AM   #2
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
Are you using procmail?
in /etc/mail/sendmail.mc
Code:
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
If so, add to /etc/procmailrc
Code:
DEFAULT=$HOME/mail
for mbox format

or

DEFAULT=$HOME/Maildir/
for Maildir format
 
Old 03-14-2008, 11:35 AM   #3
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Original Poster
Rep: Reputation: 15
Using Procmail can I keep existing mailboxes?

Thank you, frndrfoe, for your fast reply!

Yes, I am using procmail.

With your suggested setup, will I be able to keep my users' existing mailboxes with the mail that is in them?
If so, what is the best procedure for copying the mailbox files to the home directory to prevent loss of existing email messages and facilitate receiving new messages?

The way my server is set up, each unix account can have multiple email accounts. (I'm doing virtual hosting) For example, for domain website.com, a /home directory would be created (/home/website).
website.com may have multiple email addresses (joe@website.com, bill@website.com, etc...).
Right now, in /var/spool/mail, the mailbox files exist as joe.website and bill.website, etc..).

Will procmail be able to figure out where these files are, if I simply move them to /home/website/mail/joe.website and bill.website? Or is it necessary to create subdirectories inside /home/website/mail/ for each user, or rename the files, or do I need to add additional directives in the procmailrc file to handle this?

Thank you!
 
Old 03-14-2008, 08:31 PM   #4
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
I have not setup multiple domains in sendmail so I will not want to lead you down a bad path, but I found this: http://www.sendmail.org/tips/virtual-hosting.php
 
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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
spam_buttons move from /var/spool/mail/user to $HOME/mail/Junk paul_mat Linux - Software 0 05-25-2006 02:07 AM
Sendmail with LDAP-based mailboxes hockeystop Linux - Software 0 03-20-2005 03:40 AM
Corrupted User Mailboxes ctbeal Linux - Networking 0 02-02-2004 07:25 AM
How do you view which mailboxes are locked in sendmail and how do you remove the lock mikeyr Linux - Newbie 7 01-22-2004 03:43 PM
sendmail for a home user KidEvil Linux - Software 0 10-03-2003 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:13 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration