-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday, 2014-08-19 at 13:50 +0200, Carlos E. R. wrote:
On 2014-08-19 07:52, Charles Philip Chan wrote:
Here is where we differ. I prefer using dovecot for final deliver. Here
is the relevant lines from my .procmailrc:
,----
| VERBOSE=off
| DELIVER="/usr/lib/dovecot/dovecot-lda"
| LOGFILE=$HOME/.procmail.log
| LOCKEXT=.lock
| MAILDIR=$HOME/Maildir
| LOG="
| "
`----
To deliver to the default inbox, all you need is a rule like this:
,----
| # Default
| :0 w
| | $DELIVER
`----
This is very interesting!
I finished up with the following recipes:
# http://pm-doc.sourceforge.net/doc/#variables_used_in_recipes
# Pure newline
NL = "
"
TODAYISO = `date '+%Y-%m-%d %H:%M:%S.%N%:z'`
DELIVER = "/usr/lib/dovecot/dovecot-lda"
FORMAIL = "/usr/bin/formail"
:0 h
* ^Message-ID:
MESSAGEID=| $FORMAIL -c -xMessage-ID:
LOG="$NL+++----> Log start - $TODAYISO (msgid: $MESSAGEID) $NL"
# This combo produces a useful timestamp in the logs, with the
# corresponding msgid to identify and track each single email.
...
# :0f
# * ^List-Id.....
# | $FORMAIL ....
# :0 aw: $HOME/Mail/.D-locks/SOMETHING.lock
# | $DELIVER -m _Lists/SOMETHING
ie:
:0 w: $HOME/Mail/.D-locks/_Lists/os-announce.lock
* ^X-Mailinglist: opensuse-announce
| $DELIVER -m _Lists/os-announce
or:
:0f
* ^X-Mailinglist: opensuse-factory
| $FORMAIL -bfi 'Reply-To: "OS-fctry" '
:0 aw: $HOME/Mail/.D-locks/_Lists/os-factory.lock
| $DELIVER -m _Lists/os-factory
Two important details. One, that the lock file has to be explicitly
expressed, not left to automatics, because if not, this happens, see log:
procmail: Couldn't determine implicit lockfile from "/usr/lib/dovecot/dovecot-lda"
procmail: Locking ".lock"
(procmail doesn't know what deliver is, and doesn't use folder
name at the end of the line)
Meaning that all recipes lock on ".lock", and parall delivery doesn't
happen.
The other detail is that the lock file has to be specified just before the
deliver rule. Otherwise:
# wrong:
# :0fw: $HOME/Mail/.D-locks/SOMETHING.lock
# * ^List-Id.....
# | $FORMAIL ....
# :0 a
# | $DELIVER -m _Lists/SOMETHING
produces these log entries:
# procmail: Locking "/home/cer/Mail/.D-locks/SOMETHING.lock"
# procmail: Executing " $FORMAIL ..."
# procmail: Unlocking "/home/cer/Mail/.D-locks/SOMETHING.lock"
# procmail: Couldn't determine implicit lockfile from "/usr/lib/dovecot/dovecot-lda"
# procmail: Locking ".lock" <==========
# procmail: Executing "/usr/lib/dovecot/dovecot-lda,-m,_Lists/SOMETHING"
# procmail: [2455] Sat Nov 22 00:17:13 2014
# procmail: Assigning "LASTFOLDER=/usr/lib/dovecot/dovecot-lda -m _Lists/SOMETHING"
# procmail: Unlocking ".lock"
It first locks with the intended file, then unlocks (and formail does not
need locking), then locks the delivery using ".lock", which blocks any
other rule being processed in parallel.
Similarly,
:0fw: $HOME/Mail/.D-locks/zap_spam_tesa_lists.lock
| /usr/bin/spamc -s 25000000
:0 a
* ^X-Spam-Status: Yes
| $DELIVER -m zap_spam_tesa_lists
Causes a huge delay. Spamc is locking, needlessly, and it can sometimes be
very slow (several seconds per mail). Instead, the correct rule is:
:0f
| /usr/bin/spamc -s 25000000
:0 aw: $HOME/Mail/.D-locks/zap_spam_tesa_lists.lock
* ^X-Spam-Status: Yes
| $DELIVER -m zap_spam_tesa_lists
which locks on deliver, and only if the mail is spam.
I have been trying to locate why procmail was so slow on my system for
some days, and it was this wrong spamc rule...
- --
Cheers,
Carlos E. R.
(from 13.1 x86_64 "Bottle" at Telcontar)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iEYEARECAAYFAlR15tAACgkQtTMYHG2NR9V8qgCfUXFu+E6uBluTFkzyRZUNDL1Y
M/8An3tZyjfKbI0ueJEK3Cif2DEQBImi
=qWlB
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse+owner@opensuse.org