def _create_artifacts(self, parsed_mail):
    ips = parsed_mail[PROC_EMAIL_JSON_IPS]
    hashes = parsed_mail[PROC_EMAIL_JSON_HASHES]
    urls = parsed_mail[PROC_EMAIL_JSON_URLS]
    domains = parsed_mail[PROC_EMAIL_JSON_DOMAINS]
    email_headers = parsed_mail[PROC_EMAIL_JSON_EMAIL_HEADERS]
    artifact_id = 0
    added_artifacts = self._add_artifacts('sourceAddress', ips, 'IP Artifact', artifact_id, self._artifacts)
    artifact_id += added_artifacts
    added_artifacts = self._add_artifacts('fileHash', hashes, 'Hash Artifact', artifact_id, self._artifacts)
    artifact_id += added_artifacts
    added_artifacts = self._add_artifacts('requestURL', urls, 'URL Artifact', artifact_id, self._artifacts)
    artifact_id += added_artifacts
    added_artifacts = self._add_artifacts('destinationDnsDomain', domains, 'Domain Artifact', artifact_id, self._artifacts)
    artifact_id += added_artifacts
    added_artifacts = self._add_email_header_artifacts(email_headers, artifact_id, self._artifacts)
    artifact_id += added_artifacts
    return phantom.APP_SUCCESS
def _create_artifacts(self, parsed_mail):
    ips = parsed_mail[PROC_EMAIL_JSON_IPS]
    hashes = parsed_mail[PROC_EMAIL_JSON_HASHES]
    urls = parsed_mail[PROC_EMAIL_JSON_URLS]
    domains = parsed_mail[PROC_EMAIL_JSON_DOMAINS]
    email_headers = parsed_mail[PROC_EMAIL_JSON_EMAIL_HEADERS]
    artifact_id = 0
    added_artifacts = self._add_artifacts('sourceAddress', ips, 'IP Artifact', artifact_id, self._artifacts)
    artifact_id += added_artifacts
    added_artifacts = self._add_artifacts('fileHash', hashes, 'Hash Artifact', artifact_id, self._artifacts)
    artifact_id += added_artifacts
    added_artifacts = self._add_artifacts('requestURL', urls, 'URL Artifact', artifact_id, self._artifacts)
    artifact_id += added_artifacts
    added_artifacts = self._add_artifacts('destinationDnsDomain', domains, 'Domain Artifact', artifact_id, self._artifacts)
    artifact_id += added_artifacts
    added_artifacts = self._add_email_header_artifacts(email_headers, artifact_id, self._artifacts)
    artifact_id += added_artifacts
    return phantom.APP_SUCCESS