{"id":13705330,"url":"https://github.com/cisagov/trustymail","last_synced_at":"2025-10-14T14:29:57.222Z","repository":{"id":65441831,"uuid":"95620558","full_name":"cisagov/trustymail","owner":"cisagov","description":"Scan domains and return data based on trustworthy email best practices","archived":false,"fork":false,"pushed_at":"2025-10-08T02:13:57.000Z","size":1393,"stargazers_count":214,"open_issues_count":21,"forks_count":41,"subscribers_count":21,"default_branch":"develop","last_synced_at":"2025-10-08T04:12:19.292Z","etag":null,"topics":["cisa-directives","dmarc","email-security","spf","starttls","us-federal-government"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cisagov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-06-28T02:29:03.000Z","updated_at":"2025-10-06T09:21:52.000Z","dependencies_parsed_at":"2023-02-13T02:01:27.269Z","dependency_job_id":"f3cd711f-6a68-42f0-8afa-fd7b91d9a8c1","html_url":"https://github.com/cisagov/trustymail","commit_stats":{"total_commits":652,"total_committers":24,"mean_commits":"27.166666666666668","dds":0.6533742331288344,"last_synced_commit":"25394f266e0555c2f13cd8f49ec81fc6fab2b6d1"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/cisagov/trustymail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisagov%2Ftrustymail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisagov%2Ftrustymail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisagov%2Ftrustymail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisagov%2Ftrustymail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cisagov","download_url":"https://codeload.github.com/cisagov/trustymail/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisagov%2Ftrustymail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016571,"owners_count":26085850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cisa-directives","dmarc","email-security","spf","starttls","us-federal-government"],"created_at":"2024-08-02T22:00:37.763Z","updated_at":"2025-10-14T14:29:57.199Z","avatar_url":"https://github.com/cisagov.png","language":"Python","funding_links":[],"categories":["Security","Python"],"sub_categories":["Security Check"],"readme":"# Trustworthy Mail #\n\n[![Latest Version](https://img.shields.io/pypi/v/trustymail.svg)](https://pypi.org/project/trustymail/)\n[![GitHub Build Status](https://github.com/cisagov/trustymail/workflows/build/badge.svg)](https://github.com/cisagov/trustymail/actions)\n[![CodeQL](https://github.com/cisagov/trustymail/workflows/CodeQL/badge.svg)](https://github.com/cisagov/trustymail/actions/workflows/codeql-analysis.yml)\n[![Coverage Status](https://coveralls.io/repos/github/cisagov/trustymail/badge.svg?branch=develop)](https://coveralls.io/github/cisagov/trustymail?branch=develop)\n[![Known Vulnerabilities](https://snyk.io/test/github/cisagov/trustymail/develop/badge.svg)](https://snyk.io/test/github/cisagov/trustymail)\n\n`trustymail` is a tool that evaluates SPF/DMARC records set in a\ndomain's DNS. It also checks the mail servers listed in a domain's MX\nrecords for STARTTLS support. It saves its results to CSV or JSON.\n\n## Getting started ##\n\n`trustymail` requires **Python 3.6+**. Python 2 is not supported.\n\n### Local installation ###\n\n`trustymail` can be installed directly via pip:\n\n```console\npip install trustymail\n```\n\nIt can then be run directly:\n\n```console\ntrustymail [options] example.com\n```\n\nor\n\n```console\npython3 -m trustymail [options] example.com\n```\n\n### Using Docker (optional) ###\n\n```console\n./run [opts]\n```\n\n`opts` are the same arguments that would get passed to `trustymail`.\n\n### Usage and examples ###\n\n```console\ntrustymail [options] INPUT\n\ntrustymail dhs.gov\ntrustymail --output=homeland.csv --debug cisa.gov dhs.gov us-cert.gov usss.gov\ntrustymail agencies.csv\n```\n\nNote: if INPUT ends with `.csv`, domains will be read from CSV. CSV\noutput will always be written to disk, defaulting to `results.csv`.\n\n#### Options ####\n\n```console\n  -h --help                   Show this message.\n  -o --output=OUTFILE         Name of output file.  (Default results)\n  -t --timeout=TIMEOUT        The DNS lookup timeout in seconds.  (Default is 5.)\n  --smtp-timeout=TIMEOUT      The SMTP connection timeout in seconds.  (Default is 5.)\n  --smtp-localhost=HOSTNAME   The hostname to use when connecting to SMTP\n                              servers.  (Default is the FQDN of the host from\n                              which trustymail is being run.)\n  --smtp-ports=PORTS          A comma-delimited list of ports at which to look\n                              for SMTP servers.  (Default is '25,465,587'.)\n  --no-smtp-cache             Do not cache SMTP results during the run.  This\n                              may results in slower scans due to testing the\n                              same mail servers multiple times.\n  --mx                        Only check MX records.\n  --starttls                  Only check MX records and STARTTLS support.\n                              (Implies --mx.)\n  --spf                       Only check SPF records.\n  --dmarc                     Only check DMARC records.\n  --json                      Output is in JSON format.  (Default is CSV.)\n  --debug                     Output should include more verbose logging.\n  --dns=HOSTNAMES             A comma-delimited list of DNS servers to query\n                              against.  For example, if you want to use\n                              Google's DNS then you would use the\n                              value --dns-hostnames='8.8.8.8,8.8.4.4'.  By\n                              default the DNS configuration of the host OS\n                              (/etc/resolv.conf) is used.  Note that\n                              the host's DNS configuration is not used at all\n                              if this option is used.\n  --psl-filename=FILENAME     The name of the file where the public suffix list\n                              (PSL) cache will be saved.  If set to the name of\n                              an existing file then that file will be used as\n                              the PSL.  If not present then the PSL cache will\n                              be saved to a file in the current directory called\n                              public_suffix_list.dat.\n  --psl-read-only             If present, then the public suffix list (PSL)\n                              cache will be read but never overwritten.  This\n                              is useful when running in AWS Lambda, for\n                              instance, where the local filesystem is read-only.\n```\n\n## What's checked? ##\n\nFor a given domain, MX records, SPF records (TXT), DMARC (TXT, at\n`_dmarc.\u003cdomain\u003e`), and support for STARTTLS are checked. Resource records can\nalso be checked for DNSSEC if the resolver used is DNSSEC-aware.\n\nThe following values are returned in `results.csv`:\n\n### Domain and redirect info ###\n\n- `Domain` - The domain you're scanning!\n- `Base Domain` - The base domain of `Domain`. For example, for a\n  Domain of `sub.example.gov`, the Base Domain will be\n  `example.gov`. Usually this is the second-level domain, but\n  `trustymail` will download and factor in the [Public Suffix\n  List](https://publicsuffix.org) when calculating the base domain.\n- `Live` - The domain is actually published in the DNS.\n\n### Mail sending ###\n\n- `MX Record` - If an MX record was found that contains at least a\n  single mail server.\n- `MX Record DNSSEC` - A boolean value indicating whether or not the\n  DNS record is protected by DNSSEC.\n- `Mail Servers` - The list of hosts found in the MX record.\n- `Mail Server Ports Tested` - A list of the ports tested for SMTP and\n  STARTTLS support.\n- `Domain Supports SMTP` - True if and only if **any** mail servers\n  specified in a MX record associated with the domain supports SMTP.\n- `Domain Supports SMTP Results` - A list of the mail server and port\n  combinations that support SMTP.\n- `Domain Supports STARTTLS` - True if and only if **all** mail\n  servers that support SMTP also support STARTTLS.\n- `Domain Supports STARTTLS Results` - A list of the mail server and\n  port combinations that support STARTTLS.\n\n### Sender Policy Framework (SPF) ###\n\n- `SPF Record` - Whether or not a SPF record was found.\n- `SPF Record DNSSEC` - A boolean value indicating whether or not the\n  DNS record is protected by DNSSEC.\n- `Valid SPF` - Whether the SPF record found is syntactically correct,\n  per RFC 4408.\n- `SPF Results` - The textual representation of any SPF record found\n  for the domain.\n\n### Domain-based Message Authentication, Reporting, and Conformance (DMARC) ###\n\n- `DMARC Record` - True/False whether or not a DMARC record was found.\n- `DMARC Record DNSSEC` - A boolean value indicating whether or not\n  the DNS record is protected by DNSSEC.\n- `Valid DMARC` - Whether the DMARC record found is syntactically\n  correct.\n- `DMARC Results` - The DMARC record that was discovered when querying\n  DNS.\n- `DMARC Record on Base Domain`, `DMARC Record on Base Domain DNSSEC`,\n  `Valid DMARC Record on Base Domain`, `DMARC Results on Base\n  Domain` - Same definition as above, but returns the result for the\n  Base Domain. This is important in DMARC because if there isn't a\n  DMARC record at the domain, the base domain (or \"Organizational\n  Domain\", per [RFC\n  7489](https://tools.ietf.org/html/rfc7489#section-6.6.3)), is\n  checked and applied.\n- `DMARC Policy` - An adjudication, based on any policies found in\n  `DMARC Results` and `DMARC Results on Base Domain`, of the relevant\n  DMARC policy that applies.\n- `DMARC Subdomain Policy` - An adjudication, based on any policies\n  found in `DMARC Results` and `DMARC Results on Base Domain`, of the\n  relevant DMARC subdomain policy that applies.\n- `DMARC Policy Percentage` - The percentage of mail that should be\n  subjected to the `DMARC Policy` according to the `DMARC Results`.\n- `DMARC Aggregate Report URIs` - A list of the DMARC aggregate report\n  URIs specified by the domain.\n- `DMARC Forensic Report URIs` - A list of the DMARC forensic report\n  URIs specified by the domain.\n- `DMARC Has Aggregate Report URI` - A boolean value that indicates if\n  `DMARC Results` included `rua` URIs that tell recipients where to\n  send DMARC aggregate reports.\n- `DMARC Has Forensic Report URI` - A boolean value that indicates if\n  `DMARC Results` included `ruf` URIs that tell recipients where to\n  send DMARC forensic reports.\n- `DMARC Reporting Address Acceptance Error` - A boolean value that is\n  True if one or more of the domains listed in the aggregate and\n  forensic report URIs does not indicate that it accepts DMARC reports\n  from the domain being tested.\n\n### Everything else ###\n\n- `Syntax Errors` - A list of syntax errors that were encountered when\n  analyzing SPF records.\n- `Debug Info` - A list of any other warnings or errors encountered,\n  such as DNS failures.  These can be helpful when determining how\n  `trustymail` reached its conclusions, and are indispensible for bug\n  reports.\n\n## Contributing ##\n\nWe welcome contributions!  Please see [`CONTRIBUTING.md`](CONTRIBUTING.md) for\ndetails.\n\n## License ##\n\nThis project is in the worldwide [public domain](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisagov%2Ftrustymail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcisagov%2Ftrustymail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisagov%2Ftrustymail/lists"}