procmail
[Top] [All Lists]

Re: [Procmail??] Apparently-To: Headers

1997-01-07 02:07:20
John Conover <john(_at_)johncon(_dot_)johncon(_dot_)com> writes:
Philip Guenther writes:

Not quite.  An Apparently-To: header is inserted iff there are no
recipient headers at all, including To:, Cc:, Bcc:, and the Resent-
forms of all three of those.  Furthermore, as of sendmail 8.7, the
default is to not insert an Apparently-To: header, but rather to leave
the message bare of recipient headers, though this is configurable via
the "NoRecipientAction" option.


It was a fragment, because that is what he ask. A more complete
rendition is:

   #
   # If there is no "^To:" record in the message, then the message is,
   # almost certainly, junk mail. Note that this probably interacts with
   # the next recipe, since messages that do not have a "^To:" will have
   # an "Apparently-To:" record inserted by sendmail(1).
   #
   :0:
   * !^To:.*
   junk
   #
   # Finally, if not specifically addressed to at least this machine, the
   # message is to be considered junk mail. This will correctly file
   # messages that are .forward'ed from other accounts, bang addresses,
   # etc. Note that the "* !^TOmymachine" will correctly read header records
   # of the form "Resent-To:.*mymachine" and not file the message in "junk"
   # if resent to an address that contains at least this machine name. The
   # "^TO" will match "Original-To:", "Original-Cc:", "Original-Bcc:",
   # "To:", "Cc:", "Bcc:", "Xenvelope-To:", "Apparently-To",
   # "Apparently-Resent-To:", "Resent-To:", "Resent-Cc:", and
   # "Resent-Bcc:".
   #
   :0:
   * !^TOmymachine
   junk

This, of course, depends on sendmail's "NoRecipientAction" not putting
a domain or machine name in the "Apparently-To:" field-the idea being
that an MTA's bounce command to you should not file stuff in junk. A
"To:", with nothing else in the field, will be filed in junk.

Well, rfc822 explictly prohibits empty To: fields (if it would be empty,
it should be deleted entirely), so that's not a real worry.  (sendmail
at least does enforce this bit of rfc822).

Okay, that raises the question of when the To: field could be empty.
I know of one legitimate case: when you're the 'target' of a Bcc.
Treating Bcc's as "junk" scares me, as while I've received few Bcc's,
all of them have been important and relatively time critical.


The second recipe above ("!^TOmymachine") makes the assumption that
you've already dealt with any mailing lists you're on, as mailing lists
in general don't put your address in the header (only in the
envelope).  If you haven't, then almost all of the messages you receive
from said unhandled lists will be dropped in the "junk" folder.

I'm not trying to rain on your spam catching parade, but it's really
easy to be too strict and start dropping mail you want in the bit
bucket.  Do you really receive so much spam that you've actually saved
time by putting these recipes in?  I have one (1) recipe that discards
anything that could be called spam, and searching my logfile, it hasn't
been used since before September.  (Actually, I think I'll remove it,
given that it's not doing anything).  I've found it faster to simply
delete any spam I receive as I go through my inbox.

How much spam do other people out there receive?  Ten a day?  More than
that?  Less than that?  Less than 10 a week?  Less than one a week?

Anyway, when passing on recipes, whether spam related or not, and this
goes for everyone including myself, one needs to explicitly state the
not-so-obvious assumptions that are made, be they "all mailing list
mail should be delivered before reaching this recipe", or "SERVPATH is
considered relative to $HOME, not $MAILDIR".


Philip Guenther