LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 13.1, Sendmail-procmail MAILDIR for Dovecot Server (http://www.linuxquestions.org/questions/slackware-14/slackware-13-1-sendmail-procmail-maildir-for-dovecot-server-854018/)

Slackevo 01-03-2011 08:08 PM

Slackware 13.1, Sendmail-procmail MAILDIR for Dovecot Server
 
Built an MTA/LDA Slackware Server and seperate MDA (Dovecot 2.2) Slackware Server.

Used the slackwiki Sendmail TLS SMTP-AUTH guide for the MTA/LDA Server.
http://www.slackwiki.org/index.php?t...TH&redirect=no

The ../cf/cf/sendmail-slackware-tls-sasl.mc config file has Procmail sorting as:
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl

I don't understand the arguments ($), but know the -Y forces mbox. The /var/mail directory is hardlinked to where ever the spool directory is.

I want the Dovecot MDA server to use NFS or UNFS to grab user's mail from the MTA/LDA Server. Problem is the hardlink. Can't nfs share a hardlinked directory.

Is there a way to change the MTA sendmail mc config file above to have LDA promail send to /home/mail, so I can nfs that directory? And preferably in MAILDIR format?

BTW: I can't find any procmailrc config file on this Slackware Server. I should have all the settings in my /etc/mail/sendmail.cf config.

ChrisAbela 01-04-2011 02:23 AM

I never tried it myself, but you may try exporting /var/spool instead.


Quote:

BTW: I can't find any procmailrc config file on this Slackware Server. I should have all the settings in my /etc/mail/sendmail.cf config.
You have /etc/rc.d/rc.sendmail
and /etc/rc.d/rc.dovecot

bathory 01-04-2011 03:23 AM

Hi,

You can use procmail to deliver in ~/Maildir format. From dovecot wiki:
Code:

# file: /etc/procmailrc
# system-wide settings for procmail
SHELL="/bin/bash"
SENDMAIL="/usr/sbin/sendmail -oi -t"
LOGFILE="/var/log/procmail.log"
DROPPRIVS="yes"
DELIVER="/usr/lib/dovecot/deliver"
# fallback:
DEFAULT="$HOME/Maildir/"
MAILDIR="$HOME/Maildir/"
:0 w
* ^X-Spam-Status: Yes
| $DELIVER -m spam
:0 w
| $DELIVER

Regards

Slackevo 01-04-2011 11:37 AM

Yeah, I read that wiki for dovecot 2.x and think it's the wise way to go.

I'm assuming if I change my sendmail mc config file by eliminating
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
and only have FEATURE(local_procmail) with the /etc/procmmailrc global config, I should be good. I'll recompile the sendmail config with m4 to create the new /etc/mail/sendmail.cf

Since the /etc/procmailrc config file is global, I assume I don't need put a procmail receipe in each users mailbox.

Again, the purpose is just to have promail deliver in MAILDIR format, not MBOX to an nfs diretory, so my dovecot server can read the nfs share.

I'll test it out today and follow up here.

Thanks for your help. It's the direction I needed..

Slackevo 01-04-2011 12:45 PM

Quote:

Originally Posted by ChrisAbela (Post 4212329)
I never tried it myself, but you may try exporting /var/spool instead.

I don't know if that would be an actual spooling directory. I've read bad things in regards to indexing using nfs with spool directories.

I'll be using unfs3 (nfs v3) with my experiment today.

http://slackbuilds.org/repository/13.1/network/unfs3/

Slackevo 01-04-2011 09:05 PM

Quote:

Originally Posted by bathory (Post 4212374)
Hi,

You can use procmail to deliver in ~/Maildir format. From dovecot wiki:
Code:

# file: /etc/procmailrc
# system-wide settings for procmail
SHELL="/bin/bash"
SENDMAIL="/usr/sbin/sendmail -oi -t"
LOGFILE="/var/log/procmail.log"
DROPPRIVS="yes"
DELIVER="/usr/lib/dovecot/deliver"
# fallback:
DEFAULT="$HOME/Maildir/"
MAILDIR="$HOME/Maildir/"
:0 w
* ^X-Spam-Status: Yes
| $DELIVER -m spam
:0 w
| $DELIVER

Regards

Thanks! That worked perfectly along with rebuilding my sendmail.cf to include FEATURE('local_procmail') . My LDA Procmail is in MAILDIR !

It's only using the fallback part of my /etc/procmailrc:

Quote:

# file: /etc/procmailrc
# system-wide settings for procmail
SHELL="/bin/bash"
SENDMAIL="/usr/sbin/sendmail -oi -t"
LOGFILE="/procmail/log/procmail.log"
DELIVER="/procmail/dovecot/deliver"
# fallback:
DEFAULT="$HOME/Maildir/"
MAILDIR="$HOME/Maildir/"
:0 w
* ^X-Spam-Status: Yes
| $DELIVER -m spam
:0 w
| $DELIVER
When I check the /procmail/dovecot/deliver directory there is nothing there.

I created the same sub directory layout as in /home ($home) for /procmail/dovecot/deliver, but no email is being delivered. It's still being delivered to /home/$user/Maildir/new
All subdirectories in /procmail have root permissions for now.

Can you help me with procmailrc to point mail to my /procmail directories?

bathory 01-05-2011 12:49 AM

I guess you can use:
Code:

DEFAULT="/procmail/dovecot/deliver/$LOGNAME/Maildir/"
MAILDIR="/procmail/dovecot/deliver/$LOGNAME/Maildir/"

or
Code:

HOME="/procmail/dovecot/deliver/$LOGNAME"
DEFAULT="$HOME/Maildir/"
MAILDIR="$HOME/Maildir/"



All times are GMT -5. The time now is 03:29 AM.