[Warning... somewhat lenghty discussion follows]

Quoting Dhruba Bandopadhyay <[EMAIL PROTECTED]>:

> Hello,
>
> I have attached a procmail log which complains about errors of not
> being  able to write to folders and acquiring kernel locks.  Any help
>on  solving  these problems would be much appreciated.
>
> With regards.
>

Me thinks your procmail problem is probably a misconfigured .procmailrc
more than a procmail problem.  Try something like this. Change where
necessary to match your setup.

Note that on MAILDIR type setups, locks in the recipies are not
necessary.  You are creating unique files in a directory, the who
purpose of Maildir to begin with.  Locks are for files, not directories
in this case. Exception is spamassassin which needs locks.

>From your log file:

Procmail: Match on "^FROM:.*codewordt\.co\.uk"
procmail: Assigning "LASTFOLDER=.maildir/.flat"
                                        ^^^^^^
procmail: Opening ".maildir/.flat"
                            ^^^^^^
procmail: Error while writing to ".maildir/.flat"
                                          ^^^^^
Assigning "LASTFOLDER=/home/gentoo/.maildir/msg.AkD"
                                           ^^^^^^^^
Whats this? All your messages are going into a message file.
Your paths to your maildir folders are wrong.  First of all, forget
about using locks in Maildir folders. Locks serve no purpose there.
Indeed thats one of the reasons that Maildir folders exist.
Now,  First some common mistakes in procmail, while, they work, are not
really 100% correct:

# Dont use locks on Maildir folders as such...
:0:
* ^Subject:.*text
# Assumes my MUA puts a ':' in the Subject line.  What if it doesnt?

HINT:  use * ^Subject.*text   _NOT_  ^Subject:.   Ok?


# Escaping the '.' to detect a '.'
* ^List-Id.*cvs\.lists\.horde\.org
# ^List-Id headers dont need escaping the regex '.', it's redundant
# it complicates things, and it makes it harder to read.

# Ahh much better, and easier to read too :)
* ^List-Id.*cvs.lists.horde.org

I assume your MTA is properly configured to let procmail deliver the
mail.

Hint:  for postfix,
mailbox_command = /usr/bin/procmail -a "$EXTENSION"


Note:  in procmailrc *ALWAYS* give the file a shell.  Always
give it a path to any programs it may need.

Note 2:  I use Courier-imap.  Support about 1000 usrs.  And well your
procmail recipes are not working because you do not understand how
Maildirs are structured, and secondly you do not understand how Courier
sets up its folders in the maildir directory structure. Understanding
this is a necessary prerequsite to getting procmail to work.

I've included a short sample from one of my hundreds of .procmailrc
scripts.  It should contain enough info to help you get started, unless
you are just completely and utterly lost, in which case, you should
probably pay someone to set this up for you.

I go though great pains to define _all_ my IMAP folders at the start of
the script.  After trying to debug a procmail.log file with hundred of
thousands of entries, supporting hundreds of users, the extra
readability given to the script itself is well worth the effort.
Last, I've included a sample from my procmail.log to show how
procmail expands the directory names.

Hopefully this will be helpful to others as well.  I do not claim to be
an expert, this is stuff I have learned on my own and it's nothing
special trust me.

Feel free to ask questions, but be aware I will not do your project for
you.


SHELL=/bin/sh
PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin:/opt/f-prot/:/usr/local/anomy
UMASK=022
MAILDIR=${HOME}/.maildir
DEFAULT=${MAILDIR}/
USER=${LOGNAME}
DROPPRIVS=yes
#DEBUG_VERBOSE=YES
#VERBOSE=YES
#LOGFILE=${HOME}/procmail.log
LOGFILE=
#
#Go through the pain of setting up all the paths to IMAP folders first
#to make it simplier when we setup the recipe.
#
#Note I setup IMAP folders with a folder hierarchy, that is
#An empty folder (i.e. HORDEBASE) and then the actual folders
#that live under the BASEDIR where the actual mail goes.
#
# Horde, imp,Turba, CVS lists
HORDEBASE=${MAILDIR}/.Horde
HORDECVS=${HORDEBASE}.CVS/
HORDEIMP=${HORDEBASE}.IMP/
HORDETURBA=${HORDEBASE}.TURBA/
HORDE=${HORDEBASE}.HORDE/
#
#
# Gentoo lists
GENTOOBASE=${MAILDIR}/.Gentoo
GENTOODEV=${GENTOOBASE}.Dev/
GENTOOCVS=${GENTOOBASE}.CVS/
GENTOODESK=${GENTOOBASE}.Desktop/
GENTOOUSER=${GENTOOBASE}.User/

# Spam Assassin  Directories
SPAMBASE=${MAILDIR}/.SPAM
SPAMDIR=${SPAMBASE}/
MAYBESPAM=${SPAMBASE}/.MaybeSpam/
#
########STUFF FROM CRON DAEMONS OR FROM DSLOADIT ######
:0
* ^From.*Cron
${CRONMISC}

########## HORDE LISTS ###########################
:0
* ^List-Id.*cvs.lists.horde.org
${HORDECVS}
#
:0
* ^List-Id.*imp.lists.horde.org
${HORDEIMP}
#
:0
* ^List-Id.*turba.lists.horde.org
${HORDETURBA}
#
:0
* ^List-Id.*horde.lists.horde.org
${HORDE}
########## MOVE ALL GENTOO MAIL TO THE GENTOO FOLDERS #####
:0
* ^List-Id.*gentoo-cvs.gentoo.org
${GENTOOCVS}
#
:0
* ^List-Id.*gentoo-desktop.gentoo.org
${GENTOODESK}
#
:0
* ^List-Id.*gentoo-dev.gentoo.org
${GENTOODEV}
#
:0
* ^List-Id.*gentoo-user.gentoo.org
${GENTOOUSER}
#
#  Mail was not part of any mailing list so check it for spam last.
#
:0fw: spamassassin.lock
* < 256000
| /usr/bin/spamc -f

#Mails with a score of 15 or higher are almost certainly spam (with
0.05%
#false positives according to rules/STATISTICS.txt). Let's put them in a
#different mbox. (This one is optional.)
:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
${SPAMDIR}
#
#
#All mail tagged as spam (eg. with a score higher than the set
threshold)
# is moved to "probably-spam".
:0
* ^X-Spam-Status: Yes
${MAYBESPAM}
#
# Work around procmail bug: any output on stderr will cause the "F" in
"From"
# to be dropped.  This will re-add it.
#
:0
* ^^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "
  :0 fhw
  | sed -e '1s/^/F/'
}
#
# End of SpamAssassin rules.
#
#
----------------------------------------------------------------------

Last but not least a sample procmail.log that shows what it looks like
when properly configured:

procmail: Assigning "LOGFILE=/home/borg/procmail.log"
procmail: Opening "/home/borg/procmail.log"
procmail: Assigning "CRONBASE=/home/borg/.maildir/.Crons"
procmail: Assigning "CRONDSR=/home/borg/.maildir/.Crons.DSR/"
procmail: Assigning "CRONSMISC=/home/borg/.maildir/.Crons.MISC/"
procmail: Assigning "HORDEBASE=/home/borg/.maildir/.Horde"
procmail: Assigning "HORDECVS=/home/borg/.maildir/.Horde.CVS/"
procmail: Assigning "HORDEIMP=/home/borg/.maildir/.Horde.IMP/"
procmail: Assigning "HORDETURBA=/home/borg/.maildir/.Horde.TURBA/"
procmail: Assigning "HORDE=/home/borg/.maildir/.Horde.HORDE/"
procmail: Assigning "GENTOOBASE=/home/borg/.maildir/.Gentoo"
procmail: Assigning "GENTOODEV=/home/borg/.maildir/.Gentoo.Dev/"
procmail: Assigning "GENTOOCVS=/home/borg/.maildir/.Gentoo.CVS/"
procmail: Assigning "GENTOODESK=/home/borg/.maildir/.Gentoo.Desktop/"
procmail: Assigning "GENTOOUSER=/home/borg/.maildir/.Gentoo.User/"

procmail: Assigning "SPAMBASE=/home/rcooper/.maildir/.SPAM"
procmail: Assigning "SPAMDIR=/home/rcooper/.maildir/.SPAM/"
procmail: Assigning "MAYBESPAM=/home/rcooper/.maildir/.SPAM/.MaybeSpam/"
procmail: Assigning "MYSQL_DIR=/home/rcooper/.maildir/.mysql/"
procmail: No match on "^From.*Cron"
procmail: No match on "^List-Id.*cvs.lists.horde.org"
procmail: No match on "^List-Id.*imp.lists.horde.org"
procmail: No match on "^List-Id.*turba.lists.horde.org"
procmail: Match on "^List-Id.*horde.lists.horde.org"

procmail: Assigning
"LASTFOLDER=/home/borg/.maildir/.Horde.HORDE/new/1057525703.21268_1.mail4"
procmail: Notified comsat:
"[EMAIL PROTECTED]/home/borg/.maildir/.Horde.HORDE/new/1057525703.21268_1.mail4"
>From [EMAIL PROTECTED] Sun Jul  6 16:08:23 2003
Subject: Re: [horde] Configure horde
Folder: /home/borg/.maildir/.Horde.HORDE/new/1057525703.21268_1.m  3400


Thats all.  Hope this helps.



Attachment: bin00000.bin
Description: PGP Public Key

--
[EMAIL PROTECTED] mailing list

Reply via email to