rob-luke / emails-html-to-pdf

Convert emails without attachments to pdf and send as email
32 stars 7 forks source link

Response status "OK" expected, but "NO" received. (Mailbox name should probably be prefixed with: INBOX.) #42

Open sepidre opened 1 year ago

sepidre commented 1 year ago

Hi all

do you know this error?

600
Skipping virtualenv creation, as specified in config file.
Running emails-html-to-pdf
Starting mail processing run
Traceback (most recent call last):
  File "/app/main.py", line 257, in <module>
    process_mail(
  File "/app/main.py", line 102, in process_mail
    with MailBox(imap_url).login(imap_username, imap_password, imap_folder) as mailbox:
  File "/usr/local/lib/python3.9/site-packages/imap_tools/mailbox.py", line 48, in login
    self.folder.set(initial_folder)
  File "/usr/local/lib/python3.9/site-packages/imap_tools/folder.py", line 20, in set
    check_command_status(result, MailboxFolderSelectError)
  File "/usr/local/lib/python3.9/site-packages/imap_tools/utils.py", line 54, in check_command_status
    raise exception(command_result=command_result, expected=expected)
imap_tools.errors.MailboxFolderSelectError: Response status "OK" expected, but "NO" received. Data: [b'Client tried to access nonexistent namespace. (Mailbox name should probably be prefixed with: INBOX.) (0.001 + 0.000 secs).']

This part is the important, I think: imap_tools.errors.MailboxFolderSelectError: Response status "OK" expected, but "NO" received. Data: [b'Client tried to access nonexistent namespace. (Mailbox name should probably be prefixed with: INBOX.) (0.001 + 0.000 secs)

But I don't use the folder name INBOX but Paperless instead. And INBOX must exist due to the fact that I cannot create it.

My compose is:

 email2pdf:
    image: ghcr.io/rob-luke/emails-html-to-pdf:latest
    hostname: email2pdf
    environment:
     IMAP_URL: "${EMAIL_SERVER}"
     IMAP_USERNAME: "${EMAIL_TO}"
     IMAP_PASSWORD: "${EMAIL_PWD}"
     IMAP_FOLDER: "Paperless"
     SMTP_URL: "${EMAIL_SERVER}"
     MAIL_SENDER: "${my_user}+paperless@${domain_WAN}"
     MAIL_DESTINATION: "${EMAIL_TO}"
     INTER_RUN_INTERVAL: 600
     HOSTS: "127.0.0.1 tracking.paypal.com"
     WKHTMLTOPDF_OPTIONS: '{"load-media-error-handling":"ignore"}'
     SMTP_PORT: 587
     SMTP_TLS: 'true'
     TZ: ${TZ}
    deploy:
      restart_policy:
        condition: on-failure
      mode: replicated
      replicas: 1
      placement:
        constraints:
        - node.labels.netreachable == false
    networks:
     cloud-edge: 

Thank you very much!

br Stephan