Skip to content

TypeError("unsupported operand type(s) for +: 'int' and 'str'") #237

@FlashIvano

Description

@FlashIvano
version: '3'

services:      
  email-oauth2-proxy:
    image: blacktirion/email-oauth2-proxy-docker:2024.02.22

    container_name: email-oauth2-proxy
    network_mode: 'host'
    volumes:
      - /opt/compose/email-oauth2-proxy/cache:/cache
      - /opt/compose/email-oauth2-proxy/conf:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    environment:
      LOGFILE: true
      DEBUG: false
      CACHE_STORE: /cache/credstore.config
      #LOCAL_SERVER_AUTH: true #Optional

cat conf/emailproxy.config

[IMAP-143]
server_address = partner.outlook.cn
server_port = 993

[POP-110]
server_address = partner.outlook.cn
server_port = 995

[SMTP-25]
server_address = smtp.partner.outlook.cn
server_port = 587
starttls = True

[AUSER@MYOFFICE365CN.DOMAIN]
token_url = https://login.partner.microsoftonline.cn/0000000-0000-0000-0000-0000000/oauth2/token
oauth2_scope = https://partner.outlook.cn/.default
oauth2_flow = client_credentials
redirect_uri = http://localhost
client_id = 111111-1111-1111-1111-111111
client_secret = <secret_here>

[emailproxy]
delete_account_token_on_password_error = True
encrypt_client_secret_on_first_use = False
allow_catch_all_accounts = False

docker compose log:

email-oauth2-proxy  | 2024-03-13 17:16:00,749: Starting IMAP server at [::]:143 (unsecured) proxying partner.outlook.cn:993 (SSL/TLS)
email-oauth2-proxy  | 2024-03-13 17:16:00,751: Starting POP server at [::]:110 (unsecured) proxying partner.outlook.cn:995 (SSL/TLS)
email-oauth2-proxy  | 2024-03-13 17:16:00,751: Starting SMTP server at [::]:25 (unsecured) proxying smtp.partner.outlook.cn:587 (STARTTLS)
email-oauth2-proxy  | 2024-03-13 17:16:00,751: Initialised Email OAuth 2.0 Proxy - listening for authentication requests. Connect your email client to begin
email-oauth2-proxy  | 2024-03-13 17:16:16,408: Accepting new connection from [::ffff:10.6.4.54]:54780 to IMAP server at [::]:143 (unsecured) proxying partner.outlook.cn:993 (SSL/TLS)
email-oauth2-proxy  | 2024-03-13 17:16:17,721: Caught exception while requesting OAuth 2.0 credentials for AUSER@MYOFFICE365CN.DOMAIN: TypeError("unsupported operand type(s) for +: 'int' and 'str'")
email-oauth2-proxy  | 2024-03-13 17:16:20,259: Accepting new connection from [::ffff:10.6.4.54]:54786 to SMTP server at [::]:25 (unsecured) proxying smtp.partner.outlook.cn:587 (STARTTLS)
email-oauth2-proxy  | 2024-03-13 17:16:21,689: Caught exception while requesting OAuth 2.0 credentials for AUSER@MYOFFICE365CN.DOMAIN: TypeError("unsupported operand type(s) for +: 'int' and 'str'")
email-oauth2-proxy  | 2024-03-13 17:16:26,714: Accepting new connection from [::ffff:10.6.4.54]:54787 to SMTP server at [::]:25 (unsecured) proxying smtp.partner.outlook.cn:587 (STARTTLS)
email-oauth2-proxy  | 2024-03-13 17:16:27,048: Proxy config file entry missing for account AUSER - aborting login

Check token api:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'client_id=0000000-0000-0000-0000-0000000&scope=https%3A%2F%2Fpartner.outlook.cn%2F.default&client_secret=<secret_here>&grant_type=client_credentials'  'https://login.partner.microsoftonline.cn/0cbe875d-8cc3-4386-8283-0d80bbf23e05/oauth2/token'

result:

{"token_type":"Bearer","expires_in":"3599","ext_expires_in":"3599","expires_on":"1710325999","not_before":"1710322099","resource":"00000002-0000-0000-c000-000000000000","access_token":"<a_long_string>"}

Maybe error in emailproxy.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions