epg [Sun, 13 Oct 2002 16:32:26 +0000 (16:32 +0000)]
(store_message): Whoops, document that the for loop is a modified
version of the maildir delivery algorithm; now some of these other
comments make more sense.
(get_headers): Don't allow input from the message to break the
regex used to split headers.
Today i encountered a message with the following ilnes:
X-scanner: scanned by Inflex 1.0.12.3 -
(http: //www.gsm.com.my)
What we have is a broken pile of shit from gsm.com (unsurprisingly,
as i visit the URL they provide, i see that one of their frame
components spits out an HTML page with Content-Type: text/plain)
that doesn't know how to fold headers. At some point, some "helpful"
mail software (perhaps even my very own postfix installation; who
knows?) mangled what appeared to it to be an '(http' header; it
added a space after the colon.
Whether the mangling had happened or not, i'm sure minc would have
been confused. Doug Porter provided the fix (using perl's \Q and
\E in the split() regex to disable pattern meta-chars in $fieldname).
I was using EX_TEMPFAIL for nearly every failure case, as if this were
a delivery program. Comb the file for each incidence and use a better
exit code if appropriate.
(store_message): Handle not being able to run the mark command and
being able to run it but having it fail separately.
epg [Sat, 31 Aug 2002 23:58:52 +0000 (23:58 +0000)]
(%FOLDERS): Remove this global. Whether to print the folder's name is
now being subsumed into the marking unseen messages functionality
moving into filter_mail.
(store_message): Don't run mark messages unseen, and start returning
the stored message number for callers to use.
(filter_mail): Keep a hash of folders and message numbers, printing
each folder name only once and running one mark(1) command for each
folder to mark the new messages unseen.
epg [Sat, 31 Aug 2002 18:44:47 +0000 (18:44 +0000)]
use Errno and Fcntl qw(O_WRONLY O_EXCL O_CREAT) .
(get_highest_msgnum): Restructure to step through readdir itself
rather than go through getfiles, since we don't want full path names
like that returns, but only the base filenames readdir returns. Also
fix it to return the highest number in the folder, not that number
plus one, making its name accurate.
(store_message): Adapt to get_highest_msgnum returning only the
highest message number. Use better $! test. Only create the empty
message file with sysopen when not $run. Use the full filename in the
error message when we couldn't find a new filename.
epg [Fri, 30 Aug 2002 07:33:07 +0000 (07:33 +0000)]
(get_new_msgnum): New function, loops across the list returned by
getfiles and returns the number for a new message to go into an mh
folder. This is a replacement for the command 'mhpath new'.
(store_message): Address the XXX comment about using 'mhpath new' by
not using it, instead calling get_new_msgnum. Furthermore, use an
algorithm similar to the maildir delivery algorithm to get the
filename to rename to.
epg [Sun, 25 Aug 2002 22:29:48 +0000 (22:29 +0000)]
(is_spam): Change logic of testing razor-check exit code slightly to
bomb if execution of razor-check failed (as opposed to sucessful
execution with a failure exit code).