Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/var/spool/mail vs .maildir setup questions?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cayenne
l33t
l33t


Joined: 17 Oct 2002
Posts: 945
Location: New Orleans

PostPosted: Mon Sep 08, 2003 12:40 am    Post subject: /var/spool/mail vs .maildir setup questions? Reply with quote

Hello all,
Still trying to set up email on a new box. I'm wanting to have it replace another box with
RH on it while I redo that box. That box had sendmail, and the mail boxes were all in
/var/spool/mail/$USER

I tracked down, and found the MAIL environment variable set in /etc/profile so that everyones email would go there. I want to bring the existing mailboxes over to the new Gentoo box. I'm guessing ont he RH box, with MAIL set to point to /var/spool/mail...that fetchmail used this to know to drop the mail there.

I looked...and Gentoo seems to be set up different. I found a /etc/profile on it..but, it appears to work with a /etc/profile.env file. I looked at it, and it appears that there are a bunch of env variables set here...but, a banner at the top said not to set this by hand, and to use the env-update command.

As root, I tried export MAIL=/var/spoo/mail/$USER and then did env-update. When I did echo $MAIL as root...it spits out the proper /var/spool/mail/root. However, when I exited out of my su'ed root session....and as a normal user I echo $MAIL...it shows no setting.

1. Am I on the right track here that for Mutt to see my mail in /var/spool/mail/<username> I need to have this $MAIL set to point to it?

2. If so, where to I put this so that it is universal for all users...I want all the mailboxes here.

3. I'm working on setting up postfix...in the main.cf for postfix, I did find where to set it to look at /var/spool/mail...so, guessing that should work.

4. I'm working with the email 'howto' from the forums, and am also setting up procmail, it seems to want to look at ~/.maildir too....I need to have it put things in the /var/spool/mail dir too...I guess I set MAILDIR= to point there?

5. To have this work with postfix, procmail, and fetchmail...what permissions do I need to put on /var/spool/mail? Root owns this...can the processes write/read there..? I really don't want users to be able to get at each others email...

This is really a temp. setup, till I re-work the RH box into a Gentoo box, at which point, I'll most likely do everything like the howto says and use ~/.maildir for all users, but, the last question I'd like to know in case I come across a /var/spool/mail set up in the future.

Also, will things work if I eventually move the mailbox from the spool to a new system with .maildir? I don't want to lose that backlog of saved messages.

I'm trying to learn all this...but, moving from one style to another while preserving messages is proving a little confusing to me as I learn how email works.

Thanks in advance!!

cayenne
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Mon Sep 08, 2003 3:50 am    Post subject: Reply with quote

As someone is who currently working on moving from mbox to maildir, let me share somethings I found out. :) I use Postfix and procmail for delivery

1. I setup the following in Postfix's mail.cf
Code:
home_mailbox = .maildir/
mailbox_command = /usr/bin/procmail -a $DOMAIN

2. I edited /etc/procmailrc to be
Code:
DEFAULT=$HOME/.maildir/

3. I found a script at Freshmeat to convert from mbox -> maildir, but I haven't fully used it yet.

When I sent a test email to a user with no ~/.maildir folder, Postfix and/or procmail made one and it seemed okay. Procmail filtering seems okay too.
Back to top
View user's profile Send private message
Pasketti
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 109
Location: Austin, Texas

PostPosted: Mon Sep 08, 2003 4:20 pm    Post subject: Reply with quote

How did you get the MAIL environment variable to point to /home/user/.maildir instead of /var/spool/mail/user? Setting it in env.d just blanked it out for me.
Back to top
View user's profile Send private message
cayenne
l33t
l33t


Joined: 17 Oct 2002
Posts: 945
Location: New Orleans

PostPosted: Mon Sep 08, 2003 8:01 pm    Post subject: Close, but, I'm wanting to do the opposite... Reply with quote

devon wrote:
As someone is who currently working on moving from mbox to maildir, let me share somethings I found out. :) I use Postfix and procmail for delivery

1. I setup the following in Postfix's mail.cf
Code:
home_mailbox = .maildir/
mailbox_command = /usr/bin/procmail -a $DOMAIN

2. I edited /etc/procmailrc to be
Code:
DEFAULT=$HOME/.maildir/

3. I found a script at Freshmeat to convert from mbox -> maildir, but I haven't fully used it yet.

When I sent a test email to a user with no ~/.maildir folder, Postfix and/or procmail made one and it seemed okay. Procmail filtering seems okay too.


Thanks for the reply, but, I'm wanting to do the opposite...I want to set my MAIL variable to /var/spool/mail/$USER .....I want to use procmail, postfix and fetchmail using /var/spool/mail/$USER....NOT using /maildir

How do I set this up....I want to do this so I can just transfer my mailboxes from another box using this set up....

I can't figure out (like the post above this) how to set the MAIL variable globally for each user that logs in...I'm hoping by setting this, mutt will know where to look, as will procmail know where to put mail, and postfix will know where to get/send mail from...

Thanks in advance...

c
Back to top
View user's profile Send private message
cayenne
l33t
l33t


Joined: 17 Oct 2002
Posts: 945
Location: New Orleans

PostPosted: Mon Sep 08, 2003 8:27 pm    Post subject: Close, but, I'm wanting to do the opposite... Reply with quote

devon wrote:
As someone is who currently working on moving from mbox to maildir, let me share somethings I found out. :) I use Postfix and procmail for delivery

1. I setup the following in Postfix's mail.cf
Code:
home_mailbox = .maildir/
mailbox_command = /usr/bin/procmail -a $DOMAIN

2. I edited /etc/procmailrc to be
Code:
DEFAULT=$HOME/.maildir/

3. I found a script at Freshmeat to convert from mbox -> maildir, but I haven't fully used it yet.

When I sent a test email to a user with no ~/.maildir folder, Postfix and/or procmail made one and it seemed okay. Procmail filtering seems okay too.


Thanks for the reply, but, I'm wanting to do the opposite...I want to set my MAIL variable to /var/spool/mail/$USER .....I want to use procmail, postfix and fetchmail using /var/spool/mail/$USER....NOT using /maildir

How do I set this up....I want to do this so I can just transfer my mailboxes from another box using this set up....

I can't figure out (like the post above this) how to set the MAIL variable globally for each user that logs in...I'm hoping by setting this, mutt will know where to look, as will procmail know where to put mail, and postfix will know where to get/send mail from...

Thanks in advance...

c
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Mon Sep 08, 2003 10:09 pm    Post subject: Reply with quote

Pasketti wrote:
How did you get the MAIL environment variable to point to /home/user/.maildir instead of /var/spool/mail/user? Setting it in env.d just blanked it out for me.

cayenne wrote:
Thanks for the reply, but, I'm wanting to do the opposite...I want to set my MAIL variable to /var/spool/mail/$USER .....I want to use procmail, postfix and fetchmail using /var/spool/mail/$USER....NOT using /maildir

You all want this, right? (Or some variation)
Code:
$ env | egrep MAIL
MAIL=/home/devon/.maildir/

I added the following line to /etc/profile -- export MAIL=/home/$USER/.maildir/
Back to top
View user's profile Send private message
cayenne
l33t
l33t


Joined: 17 Oct 2002
Posts: 945
Location: New Orleans

PostPosted: Mon Sep 08, 2003 10:17 pm    Post subject: Reply with quote

devon wrote:
Pasketti wrote:
How did you get the MAIL environment variable to point to /home/user/.maildir instead of /var/spool/mail/user? Setting it in env.d just blanked it out for me.

cayenne wrote:
Thanks for the reply, but, I'm wanting to do the opposite...I want to set my MAIL variable to /var/spool/mail/$USER .....I want to use procmail, postfix and fetchmail using /var/spool/mail/$USER....NOT using /maildir

You all want this, right? (Or some variation)
Code:
$ env | egrep MAIL
MAIL=/home/devon/.maildir/

I added the following line to /etc/profile -- export MAIL=/home/$USER/.maildir/


No, I want

echo $MAIL=/var/spool/mail/<username here>

How do I set this? Where do I set this globally? I've seen others asking this, but, no answers.
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Mon Sep 08, 2003 10:24 pm    Post subject: Reply with quote

cayenne wrote:
No, I want

echo $MAIL=/var/spool/mail/<username here>

How do I set this? Where do I set this globally? I've seen others asking this, but, no answers.

If you add "export MAIL=/var/spool/mail/$USER" to /etc/profile and doing an env-update (forgot to mention that previous post. D'oh!), does it still not work?
Back to top
View user's profile Send private message
Pasketti
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 109
Location: Austin, Texas

PostPosted: Mon Sep 08, 2003 11:31 pm    Post subject: Reply with quote

devon wrote:
If you add "export MAIL=/var/spool/mail/$USER" to /etc/profile and doing an env-update (forgot to mention that previous post. D'oh!), does it still not work?


That got it. Thanks!

I was wanting to do something different from cayenne, but he should be able to use this to do what he wants.

I did some digging, and found that the MAIL variable is set by the login program, and it's hard-coded to do it as PATH_MAILDIR/username.

Adding it to etc/profile was much easier to fix.
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Mon Sep 08, 2003 11:48 pm    Post subject: Reply with quote

Just a warning, I don't know if upgrading anything will overwrite that settings. I guess not since /etc should be protected... Just keep that in mind. :)
Back to top
View user's profile Send private message
Pasketti
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 109
Location: Austin, Texas

PostPosted: Tue Sep 09, 2003 12:21 am    Post subject: Reply with quote

I ran env-update, and it didn't overwrite it, so I figure I'm ok.
Back to top
View user's profile Send private message
cayenne
l33t
l33t


Joined: 17 Oct 2002
Posts: 945
Location: New Orleans

PostPosted: Wed Sep 10, 2003 1:24 am    Post subject: It works...thanks!!! Reply with quote

Pasketti wrote:
I ran env-update, and it didn't overwrite it, so I figure I'm ok.


This worked for me too...thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!

Mutt is looking the right place (after correcting the 'gentoo' version of /etc/mail/Muttrc with my local ~/.muttrc)

Almost all there...just trying now to figure out why mutt can't write to the /var/spool/mail/$user dir when trying to delete a message...but, the $MAIL variable is set this way...

Thanks again.

C
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum