LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-17-2009, 06:50 AM   #1
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 307

Rep: Reputation: 36
[SOLVED] Maildir & Full Disk


Hi all,

I have a bit of a problem with my mail server at home.

Over the weekend I have built a mail server on my Ubuntu machine in my cupboard.

This runs Fetchmail => Postfix => Spamassassin => dovecot = Thunderbird + squirrelmail using IMAP

All is working like a dream except for 1 thing I have noticed.... I only have 90MB left on my disk. Eventually it will start filling up rapidly as I have my new Maildir configured.

Can you advise if I can re-direct my Maildir to my raid storage partition (500GB) under /mnt/raid/Mail/Maildir

or am I stuffed and will have to re-install or clone using a new/larger disk because it only runs under my /home/fusion1275/Maildir directory??


I hope someone has a solution for me. This could end up quite a serious issue for me.

Many thanks in advance.

Last edited by fusion1275; 08-18-2009 at 04:24 PM.
 
Old 08-17-2009, 07:15 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Came across this one in my link archive: http://ubuntuforums.org/archive/index.php/t-147086.html. It should help you with your mailbox location.

Kind regards,

Eric
 
Old 08-17-2009, 07:47 AM   #3
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 307

Original Poster
Rep: Reputation: 36
Hi Eric,

Thanks again for your reply. Do you think if I add this to my /etc/postfix/main.cf file:

Quote:
MAILDIR=/mnt/raid/Mail/Maildir
and leave this to its default:

Quote:
home_mailbox = Maildir/
I might have some luck??

All the directories and permissions are already there. I just cannot get the mail to go its new destination.
 
Old 08-17-2009, 08:13 AM   #4
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 307

Original Poster
Rep: Reputation: 36
By the way this is what mailbox setting I have in my dovecot.conf file:

Quote:
mail_location = maildir:~/Maildir
 
Old 08-18-2009, 04:23 PM   #5
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 307

Original Poster
Rep: Reputation: 36
Hi all,

Just wanted to post an update and close off this topic as I have solved my own problem.

So here I will take you briefly through the task to solve my disk space issue on my Mail Server.
Quote:
MY 10 STEP SOLUTION

Step 1:

Used LVM to create a logical volume of 50GB for my home directory. This is situated on my raid set of 500GB.
Quote:
pvscan
fdisk -l
mount
pvcreate /dev/md0
pvdisplay
fdisk -l
vgcreate Sapphire-home /dev/md0
vgdisplay
lvcreate --name home --size 50G Sapphire-home
lvdisplay
Step 2:

Created the filesystem on the home partition as ext3
Quote:
mkfs.ext3 /dev/Sapphire-home/home
Step 3:

Made a temp home directory called /mnt/newhome and then mounted it on the new filesystem I created.

Quote:
mkdir /mnt/newhome
ll /mnt/
mount /dev/Sapphire-home/home /mnt/newhome/
mount
Step 4:

Copied everything from my old home directory to my temp newhome directory then did a word count and checked they tally up. Then had a brief look for any permission problems which there weren't any as my copy command preserved all perms.

Quote:
cd /home/
cp -Rp * /mnt/newhome/
find . -ls |wc -l
cd /mnt/newhome/
find . -ls |wc -l
Step5:

Unmounted newhome and stopped all my mail apps on the server.

Quote:
umount /mnt/newhome/
/etc/init.d/fetchmail stop
/etc/init.d/postfix stop
/etc/init.d/spamassassin stop
/etc/init.d/saslauthd stop
/etc/init.d/dovecot stop
Step 6:

Moved the original /home directory to /oldhome and then made a new directory called /home.

Quote:
mv /home /old_home
cd /
ll
mkdir /home
Step 7:

Mounted my new logical volume to the newly created /home using the logical volume name and path.

Quote:
mount /dev/Sapphire-home/home /home
ll /home/
df -ah /home/
Step 8:

Amended the /etc/fstab to incorporate the new mount point.

Quote:
view /etc/fstab
/dev/Sapphire-home/home /home ext3 defaults 1 2
Step 9:

Started the mail server apps up again. Sent a test mail to myself and looked at the logs to make sure all is well and happy.

Quote:
/etc/init.d/dovecot start
/etc/init.d/saslauthd start
/etc/init.d/spamassassin start
/etc/init.d/postfix start
/etc/init.d/fetchmail start
ps -ef
cd /var/log
ll
tail -f mail.log
cd /home/fusion/Maildir/

Here is a little loop I ran whilst opening a new terminal and running the email string:
while :
do
clear
ls -lrt
sleep 1
done

Now in the new terminal I ran this:

echo TESTING | mail -s "TESTER 1 2 3" <whatever your email address is>
Step 10:

Did a backup of the old home directory and archived it. Then removed the /oldhome dir and rebooted the system

Quote:
tar -cvf - /old_home/ | gzip -c > /home/OLDHOME.tgz
cd /
ll
rm -R /old_home/
df -ah
init 6
If anyone would like a command list of the above tasks please drop me a msg as I still have all of them in my bash_history file.

I hope this will help many others who might of fallen in the same trap as me to building a mail server without checking the disk space first.

Cheers!!

Last edited by fusion1275; 08-19-2009 at 12:30 PM.
 
Old 08-18-2009, 05:51 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,174

Rep: Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681Reputation: 2681
If you could add the cmds to this thread, we'd all benefit, now and in the future.

 
Old 08-19-2009, 12:31 PM   #7
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 307

Original Poster
Rep: Reputation: 36
Commands added above as requested.

I hope they help others as they did me
 
  


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
.procmailrc MAILDIR=$HOME/Maildir not working? paulclark Linux - Newbie 4 01-28-2009 07:56 AM
Maildir problems... imapd cant see the maildir of user vargadanis Linux - Networking 2 04-20-2008 08:57 AM
Disk full... cactusface Linux - Newbie 5 08-02-2007 03:48 PM
disk stats not updating after deletion of file.. disk full joecool118 Linux - General 2 04-10-2006 12:23 PM
IMAP (Dovecot) & MySQL - Maildir path error ronkymac Linux - Software 0 03-24-2006 03:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:38 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
Open Source Consulting | Domain Registration