Skip to content

'--psl-read-only' and '--psl-filename=' args do not work. #134

@Matthew-Grayson

Description

@Matthew-Grayson

🐛 Summary

Trustymail saves new PSLs to './public_suffix_list.dat' even when specifying a different file name using --psl-filename=. Additionally, older PSLs are overwritten even when using --psl-read-only.
This behavior is confirmed both through WSL and through a Docker container.

Because of this, trustymail is difficult to run in bulk, and is throwing errors from failed PSL fetches from publicsuffix.org.

To reproduce

Steps to reproduce the behavior:

  1. Open terminal

  2. Run trustymail --psl-filename=psl.dat cisa.gov

  3. See PSL is saved to 'public_suffix_list.dat' instead of 'psl.dat'

  4. Run trustymail --psl-read-only cisa.gov

  5. Note last modified time of 'public_suffix_list.dat'

  6. Change last modified time by running python3 -c "from os import utime; utime('public_suffix_list.dat', (1330712280, 1330712280))".

  7. Confirm that the last modified time was changed

  8. Repeat step 1

  9. See that the last modified time changed, signaling that PSL is overwritten

Expected behavior

Trustymail should never fetch a new PSL when specifying --psl-read-only.
Trustymail should read from/save to the path specified by --psl-filename=

Any helpful log output or screenshots

Here's an image of a container running trustymail against 22 dummy domains. The container spawns with an out of date PSL. Arguments specify that the file is read only to avoid trustymail producing unnecessary fetch requests. Trustymail rapidly produces 11 fetch requests (most of which fail causing their respective child processes to exit with error). When a fetch is successful, the PSL is overwritten evidenced by it's last modified time changing.

Screenshot 2023-05-22 at 11 47 13 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions