private void handleHeaderField(Field field) throws HaltProcessingException, ParseException {
        // If we don't have a field, no point continuing.
        if (field == null) {
            return;
        }

        Header header = Header.findHeader(field.getName());

        // If we didn't resolve the header, then we don't need to pay attention to it.
        if (header == null) {
            return;
        }

        String value = field.getValue();

        switch (header) {
            case TO:
                mMessageBuilder.to(value);
                break;
            case FROM:
                if (!GITHUB_FROM.equalsIgnoreCase(value)) {
                    throw new HaltProcessingException();
                }
                mMessageBuilder.from(value);
                break;
            case SUBJECT:
                if (!value.startsWith(GITHUB_SUBJECT)) {
                    throw new HaltProcessingException();
                }
                mMessageBuilder.subject(value);
                break;
            case DATE:
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
                mMessageBuilder.date(simpleDateFormat.parse(value));
        }
    }