patschi / parsedmarc-dockerized

Dockerized self-initializing parsedmarc docker stack for lazy people
GNU General Public License v3.0
78 stars 21 forks source link

not able to parse password with special char #8

Closed frank3427 closed 9 months ago

frank3427 commented 2 years ago

Traceback (most recent call last): File "/opt/pypy/bin/parsedmarc", line 8, in sys.exit(_main()) File "/opt/pypy/lib/pypy3.8/site-packages/parsedmarc/cli.py", line 440, in _main opts.imap_password = imap_config["password"] File "/opt/pypy/lib/pypy3.8/configparser.py", line 1255, in getitem return self._parser.get(self._name, key) File "/opt/pypy/lib/pypy3.8/configparser.py", line 800, in get d) File "/opt/pypy/lib/pypy3.8/configparser.py", line 395, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) File "/opt/pypy/lib/pypy3.8/configparser.py", line 445, in _interpolate_some "found: %r" % (rest,)) configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%kGDzy'

RafaelKr commented 2 years ago

It probably tries to insert a variable. You probably can get it to run if you replace every % with %% in the password you put in the config file.

frank3427 commented 1 year ago

I have chaged the passowr dto not have special char and it still failes. I think we are running into an issue with offie365 dropping basic auth support and requireing Oauth

frank3427 commented 1 year ago

Moving config to us MSgraph now I am getting the following error parsedmarc_1 | ERROR:cli.py:924:MS Graph Error parsedmarc_1 | Traceback (most recent call last): parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/msal_extensions/libsecret.py", line 18, in <module> parsedmarc_1 | import gi # https://github.com/AzureAD/microsoft-authentication-extensions-for-python/wiki/Encryption-on-Linux # pylint: disable=line-too-long parsedmarc_1 | ModuleNotFoundError: No module named 'gi' parsedmarc_1 | parsedmarc_1 | During handling of the above exception, another exception occurred: parsedmarc_1 | parsedmarc_1 | Traceback (most recent call last): parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/azure/identity/_persistent_cache.py", line 92, in _get_persistence parsedmarc_1 | return msal_extensions.LibsecretPersistence( parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/msal_extensions/persistence.py", line 314, in __init__ parsedmarc_1 | from .libsecret import ( # This uncertain import is deferred till runtime parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/msal_extensions/libsecret.py", line 20, in <module> parsedmarc_1 | raise ImportError("""Unable to import module 'gi' parsedmarc_1 | ImportError: Unable to import module 'gi' parsedmarc_1 | Runtime dependency of PyGObject is missing. parsedmarc_1 | Depends on your Linux distro, you could install it system-wide by something like: parsedmarc_1 | sudo apt install python3-gi python3-gi-cairo gir1.2-secret-1 parsedmarc_1 | If necessary, please refer to PyGObject's doc: parsedmarc_1 | https://pygobject.readthedocs.io/en/latest/getting_started.html parsedmarc_1 | parsedmarc_1 | parsedmarc_1 | The above exception was the direct cause of the following exception: parsedmarc_1 | parsedmarc_1 | Traceback (most recent call last): parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/parsedmarc/cli.py", line 912, in _main parsedmarc_1 | mailbox_connection = MSGraphConnection( parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/parsedmarc/mail/graph.py", line 87, in __init__ parsedmarc_1 | credential = _generate_credential(auth_method, parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/parsedmarc/mail/graph.py", line 57, in _generate_credential parsedmarc_1 | credential = UsernamePasswordCredential( parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/azure/identity/_credentials/user_password.py", line 54, in __init__ parsedmarc_1 | super(UsernamePasswordCredential, self).__init__(client_id=client_id, **kwargs) parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/azure/identity/_internal/interactive.py", line 94, in __init__ parsedmarc_1 | super(InteractiveCredential, self).__init__(**kwargs) parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/azure/identity/_internal/msal_credentials.py", line 43, in __init__ parsedmarc_1 | self._cache = _load_persistent_cache(options) parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/azure/identity/_persistent_cache.py", line 59, in _load_persistent_cache parsedmarc_1 | persistence = _get_persistence( parsedmarc_1 | File "/opt/pypy/lib/pypy3.9/site-packages/azure/identity/_persistent_cache.py", line 104, in _get_persistence parsedmarc_1 | six.raise_from(error, ex) parsedmarc_1 | File "<string>", line 3, in raise_from parsedmarc_1 | ValueError: Cache encryption is impossible because libsecret dependencies are not installed or are unusable, for example because no display is available (as in an SSH session). The chained exception has more information. Specify "allow_unencrypted_storage=True" to store the cache unencrypted instead of raising this exception.

patschi commented 9 months ago

It looks like it is missing a few OS dependencies:

ImportError: Unable to import module 'gi' parsedmarc_1

I will be included them in the next Dockerfile, still testing. Re-open if still issue persists by then.