org.jasen.interfaces
Interface ReceivedHeaderParser

All Known Implementing Classes:
AbstractReceivedHeaderParser

public interface ReceivedHeaderParser

The ReceivedHeaderParser interface represents a class which can parse a "received" header of an email message.

Author:
Jason Polites

Method Summary
 ReceivedHeaderParserData parse(String header, InetAddressResolver resolver)
          Parses a single received header line.
 

Method Detail

parse

public ReceivedHeaderParserData parse(String header,
                                      InetAddressResolver resolver)
                               throws JasenParseException
Parses a single received header line.

We expect the Received header to be in the form:

 received    =  "Received"    ":"          ; one per relay
                 ["from" domain]           ; sending host
                 ["by"   domain]           ; receiving host
                 ["via"  atom]             ; physical path
                *("with" atom)             ; link/mail protocol
                 ["id"   msg-id]           ; receiver msg id
                 ["for"  addr-spec]        ; initial form
 

Parameters:
header -
Returns:
ReceivedHeaderParserData containing the results of the parse
Throws:
JasenParseException - only if a parse failed due to an unexpected error. Or a parse could not complete due to a malformed header line