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.

§149 ANNOYANCE-FILTER MAIL FOLDER 129<br />

149. Here we parse interesting fields from a MIME message part header.<br />

〈 Parse MIME part header 149 〉 ≡<br />

if (multiPart ∧ inPartHeader ) {<br />

string arg , par ;<br />

}<br />

partHeaderLines ++;<br />

if (compareHeaderField (s, "content−type", arg )) {<br />

if (parseHeaderArgument (s, "charset", par )) {<br />

stringCanonicalise (par );<br />

mimeContentTypeCharset = par ;<br />

}<br />

if (parseHeaderArgument (s, "boundary", par )) {<br />

mimeContentTypeBoundary = par ;<br />

}<br />

if (parseHeaderArgument (s, "name", par )) {<br />

mimeContentTypeName = par ;<br />

}<br />

mimeContentType = arg ;<br />

}<br />

if (compareHeaderField (s, "content−transfer−encoding", arg )) {<br />

mimeContentTransferEncoding = arg ;<br />

}<br />

if (compareHeaderField (s, "content−disposition", arg )) {<br />

if (parseHeaderArgument (s, "filename", par )) {<br />

mimeContentDispositionFilename = par ;<br />

}<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!