[svlug] procmail (was: Some pretty serious parsing)
akkana at shallowsky.com
Mon Nov 16 13:10:46 PST 2015
Rick Moen writes:
> I'm guessing you mean it's _some_ messages not getting delivered, not
> all of them, right? (If it were all of them, you'd be in emergency
> debugging mode, not corresponding with mailing lists -- unless perhaps
Quite so! This is something that only happens sporadically: it
definitely happened twice within two days a couple of weeks ago (out
of hundreds of messages a day) but I don't know how many times, if
any, it's happened since then. The real problem here is, how do you
find out that you didn't receive something? Most of the time you
never know, unless someone asks you "Did you get my email?"
> Often, it turns out I've made an error on the first line of the recipe,
> the cryptic one that includes what's to be done with locking.
Yep, done that. Usually after a few hours I wonder why no mail at
all is coming in, and find out that it's all landed in a spambox or
something because of a typo I made in a rule.
> Anyway, one way to attempt debugging is to comment out whatever recipes
> you touched after the last time you're sure messages started silently
> not getting delivered.
Unfortunately I don't think this is a problem with a recipe. The
recipes all fire as expected, up to the recipe (which hasn't changed
in years) that's supposed to file the relevant message into a folder;
procmail's log says it locked the file and wrote the message, but the
message never actually shows up in the folder.
> Another, more painful way, is to temporarily set
> aside your existing .procmailrc and substitute a from-scratch, radically
> simplified one long enough to see if the symptom goes away. If it does
> go away, then reintroduce your standard recipes a few at a time, until
> you find the one causing trouble. If it doesn't, then you've at least
> isolated the problem to something other than a recipe.
That's probably what I would do if I could reproduce this at will,
or if I had a way of detecting for sure when it occurred. Same with
the strace approach: I'd love to see an strace after this happens,
but I'm not convinced I could find the right place in an strace from a
program that's been running all day (if I even have disk space for that).
For detecting that it's happened, the best I've been able to
come up with is to change all my procmail rules that append to
folders so that before they write, they log the last few
subject/date pairs in that folder, then log the subject and folder
it's trying to write to), then after writing, log the subject/date
pairs again, and if the pairs didn't change, alert me somehow. I
think that's possible, but it sounds daunting to set up.
More information about the svlug