[GH-ISSUE #77] MP_SMTP_AUTH_ALLOW_INSECURE can not be configured via env variable #49

Closed
opened 2026-03-15 12:17:38 +03:00 by kerem · 7 comments
Owner

Originally created by @IgnisDa on GitHub (Mar 31, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/77

I set MP_SMTP_AUTH_ALLOW_INSECURE = 1 in my environment.

I get this error.

ERRO[2023/03/31 16:13:13] SMTP authentication requires TLS encryption, run with `--smtp-auth-allow-insecure` to allow insecure authentication

I think it means that the enviroment variable is not being recognized.

Same applies to the MP_SMTP_AUTH_ACCEPT_ANY variable.

Originally created by @IgnisDa on GitHub (Mar 31, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/77 I set `MP_SMTP_AUTH_ALLOW_INSECURE = 1` in my environment. I get this error. ``` ERRO[2023/03/31 16:13:13] SMTP authentication requires TLS encryption, run with `--smtp-auth-allow-insecure` to allow insecure authentication ``` I think it means that the enviroment variable is not being recognized. Same applies to the `MP_SMTP_AUTH_ACCEPT_ANY` variable.
kerem 2026-03-15 12:17:38 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@axllent commented on GitHub (Mar 31, 2023):

Can you please cop & paste the exact command you are running to start Mailpit, including trying to set the environment?

<!-- gh-comment-id:1492489734 --> @axllent commented on GitHub (Mar 31, 2023): Can you please cop & paste the exact command you are running to start Mailpit, including trying to set the environment?
Author
Owner

@IgnisDa commented on GitHub (Apr 1, 2023):

I have this in my docker-compose.yml.


  mail:
    image: axllent/mailpit
    ports:
      - 8025:8025
    environment:
      MP_DATA_FILE: /data/mail.data
      MP_SMTP_AUTH_ACCEPT_ANY: '1'
      MP_SMTP_AUTH_ALLOW_INSECURE: '1'
    healthcheck:
      test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8025/readyz" ]
      interval: 5s
      timeout: 5s
      retries: 3
    volumes:
      - mail-data:/data

I have not exposed port 1025 because I am using docker internal networking to communicate with it.

<!-- gh-comment-id:1492804112 --> @IgnisDa commented on GitHub (Apr 1, 2023): I have this in my `docker-compose.yml`. ```yml mail: image: axllent/mailpit ports: - 8025:8025 environment: MP_DATA_FILE: /data/mail.data MP_SMTP_AUTH_ACCEPT_ANY: '1' MP_SMTP_AUTH_ALLOW_INSECURE: '1' healthcheck: test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8025/readyz" ] interval: 5s timeout: 5s retries: 3 volumes: - mail-data:/data ``` I have not exposed port `1025` because I am using docker internal networking to communicate with it.
Author
Owner

@IgnisDa commented on GitHub (Apr 1, 2023):

Looking at: github.com/axllent/mailpit@321c181a9c/cmd/root.go (L241-L248)

It should be working fine. I wonder why it does not.

<!-- gh-comment-id:1492806932 --> @IgnisDa commented on GitHub (Apr 1, 2023): Looking at: https://github.com/axllent/mailpit/blob/321c181a9c5e855e990ed1fe7e1305e1ad456cc0/cmd/root.go#L241-L248 It should be working fine. I wonder why it does not.
Author
Owner

@axllent commented on GitHub (Apr 1, 2023):

I would say because you are using ' in your yaml config, so the value is seen literally as '1' instead of 1. From memory you can only use "" or none at all. Try:

      MP_SMTP_AUTH_ACCEPT_ANY: 1
      MP_SMTP_AUTH_ALLOW_INSECURE: 1

or

      MP_SMTP_AUTH_ACCEPT_ANY: "1"
      MP_SMTP_AUTH_ALLOW_INSECURE: "1"
<!-- gh-comment-id:1492825167 --> @axllent commented on GitHub (Apr 1, 2023): I would say because you are using `'` in your yaml config, so the value is seen literally as `'1'` instead of `1`. From memory you can only use `""` or none at all. Try: ```yaml MP_SMTP_AUTH_ACCEPT_ANY: 1 MP_SMTP_AUTH_ALLOW_INSECURE: 1 ``` or ```yaml MP_SMTP_AUTH_ACCEPT_ANY: "1" MP_SMTP_AUTH_ALLOW_INSECURE: "1" ```
Author
Owner

@IgnisDa commented on GitHub (Apr 1, 2023):

Tried both, did not work.

<!-- gh-comment-id:1492829222 --> @IgnisDa commented on GitHub (Apr 1, 2023): Tried both, did not work.
Author
Owner

@axllent commented on GitHub (Apr 1, 2023):

You are absolutely correct, these flags weren't being recognised, my apologies. I found the bug and have just released v1.5.3 which will fix it for you. The latest docker image has been updated, so make sure to pull the latest (docker pull axllent/mailpit)

<!-- gh-comment-id:1492896736 --> @axllent commented on GitHub (Apr 1, 2023): You are absolutely correct, these flags weren't being recognised, my apologies. I found the bug and have just released v1.5.3 which will fix it for you. The latest docker image has been updated, so make sure to pull the latest (`docker pull axllent/mailpit`)
Author
Owner

@IgnisDa commented on GitHub (Apr 1, 2023):

Thanks!

<!-- gh-comment-id:1492902587 --> @IgnisDa commented on GitHub (Apr 1, 2023): Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#49
No description provided.