LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 11-12-2008, 10:44 AM   #1
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Rep: Reputation: 17
procmail mail spool dir help


Hello Friends,

I am just n00b at procmail (don't temme juss do this and recompile, cause I dunno how to do it, and I tried Google also!). I found same question like me in LQ but I could not understand what ppl answered there.

My prob is simple.

I wanna make default spool dir /maildir/ or ~/maildir/

Can anyone help me in this?

PS: Can dovecot do anything with sendmail in this scene?
 
Old 11-12-2008, 10:53 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
In procmailrc change or add the maildir you want to use:

MAILDIR=$HOME/maildir
or
MAILDIR=/maildir
 
Old 11-12-2008, 11:34 AM   #3
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Original Poster
Rep: Reputation: 17
OK I edit /etc/procmailrc and put MAILDIR=/maildir

Restart sendmail and send one mail, but it still goes to /var/spool/mail/

I know I'm doin something wrong, I've Googled abt this and did what u said b4, but couldn't do it so I asked here... :P Can u explain me more... if I need to compile some files in procmail and how...
 
Old 11-12-2008, 12:00 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
Originally Posted by n03x3c View Post
OK I edit /etc/procmailrc and put MAILDIR=/maildir

Restart sendmail and send one mail, but it still goes to /var/spool/mail/

I know I'm doin something wrong, I've Googled abt this and did what u said b4, but couldn't do it so I asked here... :P Can u explain me more... if I need to compile some files in procmail and how...

Did you configured sendmail to use procmail?
Are you sending the testmail localy?
How do you retrieve mails? fetchmail or ...
Can you post your procmailrc file?

Add the following line to procmailrc
LOGFILE=$HOME/pm.log
VERBOSE = on

look at the logfile to see if something happens
 
Old 11-12-2008, 12:20 PM   #5
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Original Poster
Rep: Reputation: 17
Sendmail is configured to use procmail.
I am sending testmails locally.

Local mail delivery agent is procmail.

Code:
LOGFILE= /maildir/pm.log
VERBOSE= on
MAILDIR=/maildir
This was /etc/procmailrc file. I can't even see logfile, its not just created. /maildir owner user is root and group is mail and group has rwx perms. I am really fixed...

EDIT: When I saw maillog, I found procmail is giving error while writing log to /maildir/pm.log :-S

And finally I find its SELinux...

I setenforce 0 and set proper context of /maildir file now I can see the log and I identified problem. Here's it.

It assigns MAILDIR properly but LASTFOLDER again change it to old location, even I set LASTFOLDRE in procmailrc, it again change that variable and I can't get mail into /maildir folder.

Now I added new user and sent mail again. Log shows something diff. Even MAILDIR and LASTFOLDER are perfect, in the end its Folder: /var/mail/user

Ok I think its enough info for someone to identify my dumb prob

Last edited by n03x3c; 11-12-2008 at 12:42 PM.
 
Old 11-12-2008, 01:18 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Did you add a rule to deliver the mail?

MAILDIR=/maildir
DEFAULT=$MAILDIR/inbox
LOGFILE= /maildir/pm.log
VERBOSE= on

Then add a rule to send the mail to DEFAULT

:0 c
${DEFAULT}
 
Old 11-13-2008, 05:17 AM   #7
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Original Poster
Rep: Reputation: 17
OK thx problem solved...

I put this data in ~/.procmailrc file and it works perfect.

Thx again for solution repo!
 
  


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
owner of dir /var/spool/amavis is changed saavik Linux - Server 4 10-02-2007 08:27 AM
spam_buttons move from /var/spool/mail/user to $HOME/mail/Junk paul_mat Linux - Software 0 05-25-2006 03:07 AM
procmail: Couldn't create or rename temp file "/var/spool/mail/tmp/.... paul_mat Linux - Software 0 05-02-2006 07:16 PM
Import Mail from /var/spool/mail (sendmail) to a MailDir Format in Postfix shawnbishop Linux - Software 0 04-06-2006 11:44 AM
postfix error procmail: Couldn't create "/var/spool/mail/ bentman78 Linux - Software 4 05-26-2004 01:04 AM


All times are GMT -5. The time now is 08:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration