fetchmail-friends
[Top] [All Lists]

[fetchmail]Patch to enable/disable discarding messages with incorrect header lines

2004-06-06 10:18:09
Hi,

recently, I noticed that mails for which fetchmail 6.2.5 displays
"incorrect header line found while scanning headers" are not
forwarded at all. Even worse, these mails are deleted from my POP3
account though they are not delivered locally.

At first, I thought of this being a bug, but looking at the code,
this turned out to be a feature: mails that have no empty line to
separate the headers from the body of the mail are discarded
deliberately. Although such mails are clearly broken (and are spam or
virus mails in most cases), I do not feel comfortable with fetchmail
silently discarding mails.

Making this behavior configurable is not easy (at least not for
me...), since the readheaders function in transact.c already reads
too much if there is no blank line before the body, i.e. it already
reads the first line of the mail's body.

Therefore, the attached patch does the following:
- readheaders may return the first line of the body (in first_body_line)
- readbody inserts the line provided by readheaders into the body if
  needed
- the old behavior (refuse the mail) can be configured by setting the
  "refusenodelimiter" option

Any comments on the patch are welcome. If there is any problem with
the attachment, the most current version of the patch can be found
at:

http://web792.can17.de/fetchmail-6.2.5-refusenodelimiter.patch


- Simon





<Prev in Thread] Current Thread [Next in Thread>
  • [fetchmail]Patch to enable/disable discarding messages with incorrect header lines, Simon Baatz <=