On 13.08.15 11:13, Ian Zimmerman wrote: > On 2015-08-13 20:24 +1000, Erik Christiansen wrote: > > > > A line buffer of length $LINEBUF is used when processing the > > > rcfile, any expansions that don't fit within this limit will be > > > truncated and PROCMAIL_OVERFLOW will be set. If the overflowing > > > line is a condition or an action line, then it will be considered > > > failed and procmail will continue processing. If it is a > > > variable assignment or recipe start line then procmail will abort > > > the entire rcfile. > > > You might like to read both recipe and manpage again. When "processing > > the rcfile", the line with $SUBJECT does not expand. The "SUBJECT=" line > > is a variable assignment, not a macro definition. > > And this (the assignment line) is what I'm worried about, not the later > line where $SUBJECT is used. According to the above paragraph, if _the > expansion_ doesn't fit in $LINEBUF, the panic mode is triggered. I > think substituting a shell command output counts as "expansion". Do you > not agree?
Nope, but on reflection¹, it is in the line using $SUBJECT, after all, that there is an opportunity for a harmless truncation in an unbelievably pathological case. Having run the (80 character unexpandable) assignment, procmail reads the second formail command, and finds a need to substitute $SUBJECT. Since that would be limited to $LINEBUF in length, procmail would truncate an enormous subject line to 2048 characters - IF we have not bothered to set LINEBUF to a couple of hundred K to cover that. Failure of that formail "action line" is non-fatal, and would leave us with the original incoming subject line, unbeautified, but only if it is possible to have a subject line longer than say 200K characters, if we're paranoid enough to set that limit. Given that the truncation (which never occurs in practice) is harmless, I see "panic mode" as a somewhat alarmist description. Procmail will abort only if the overflow is in "a variable assignment or recipe start line", AIUI, and that does not occur in the cited recipe. The recipe's only variable assignment contains nothing expandable, so no overflow can occur there. The limit then is the capacity of the receiving environment variable, not $LINEBUF. Therefore, I'm not even inclined to change from the default LINEBUF to give loonies a subject line longer than 2048 characters. What would be the point? My incoming email traffic has been about half a million posts over just the last 15 years, with not one exceeding a 2048 character subject line. How many such monsters have you received? ;-) If they ever did materialise in the real world, my response would probably be a recipe which sent them to /dev/null. Anyone who can't keep a subject line to two or three lines isn't worth reading, I suspect. (But then I'm over 60, and time isn't as endless as it used to be.) Erik ¹ More coffee also helps.