12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

§139 ANNOYANCE-FILTER MAIL FOLDER 123<br />

}<br />

〈 Reset MIME decoder state 142 〉;<br />

}<br />

else {<br />

newMessage = false ;<br />

}<br />

This code is cited in section 256.<br />

This code is used in section 130.<br />

140. To facilitate message parsing, we delete any white space from the ends of lines. Mail transfer<br />

agents are explicitly permitted to do this, and all forms of encoding are proof against it. If the line is<br />

blank after pruning trailing white space, we note this to use in testing for the start of the next message<br />

for non-BSD folders.<br />

〈 Eliminate any trailing space from line 140 〉 ≡<br />

while ((s.length ( ) > 0) ∧ (isISOspace (s[s.length ( ) − 1]))) {<br />

s.erase (s.length ( ) − 1);<br />

}<br />

setNewMessageEligiblity (s.empty ( ));<br />

This code is used in section 130.<br />

141. If we’re within the message header section, there are various things we want to be on the lookout<br />

for. First, of course, is the blank line that denotes the end of the header. If the header declares the<br />

content type of the body to be MIME multi-part, we need to save the part boundary separator for later<br />

use. As it happens, this code works equally fine for parsing the part headers which follow the sentinel<br />

denoting the start of new part in a MIME multi-part message.<br />

〈 Process message header lines 141 〉 ≡<br />

if (inHeader ∨ inPartHeader ) {<br />

if (s ≡ "") {<br />

if (inHeader ) {<br />

if ((¬multiPart ) ∧ (bodyContentTransferEncoding ≠ "")) {<br />

mimeContentType = bodyContentType ;<br />

mimeContentTypeCharset = bodyContentTypeCharset ;<br />

mimeContentTypeName = bodyContentTypeName ;<br />

mimeContentTransferEncoding = bodyContentTransferEncoding ;<br />

multiPart = true ;<br />

partBoundary = "";<br />

}<br />

}<br />

inHeader = inPartHeader = false ;<br />

〈 Activate MIME decoder if required 153 〉;<br />

}<br />

〈 Check for continuation of mail header lines 143 〉;<br />

〈 Save Message-ID for diagnostics 145 〉;<br />

〈 Process multipart MIME header declaration 150 〉;<br />

〈 Process body content type declarations 146 〉;<br />

〈 Check for encoded header line and decode 147 〉;<br />

}<br />

This code is used in section 130.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!