LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   procmail mail spool dir help (https://www.linuxquestions.org/questions/linux-newbie-8/procmail-mail-spool-dir-help-682905/)

n03x3c 11-12-2008 10:44 AM

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?

repo 11-12-2008 10:53 AM

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

MAILDIR=$HOME/maildir
or
MAILDIR=/maildir

n03x3c 11-12-2008 11:34 AM

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...

repo 11-12-2008 12:00 PM

Quote:

Originally Posted by n03x3c (Post 3339602)
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

n03x3c 11-12-2008 12:20 PM

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 :p

repo 11-12-2008 01:18 PM

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}

n03x3c 11-13-2008 05:17 AM

OK thx problem solved...

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

Thx again for solution repo!


All times are GMT -5. The time now is 10:20 PM.