Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: When I'm using docker-compose, After I put smtp service under the traefik, and I'm using the proxyProtocol, The connection will breke #372

Open
yingshaoxo opened this issue Mar 23, 2023 · 2 comments

Comments

@yingshaoxo
Copy link

yingshaoxo commented Mar 23, 2023

Here is the traefik code:

tcp:
  routers:
    smtp_router:
      entryPoints:
        - smtp
      rule: "HostSNI(`*`)"
      service: smtp_service
  services:
    smtp_service:
      loadBalancer:
        servers:
          - address: weloveparty_account_auth_service:25
        proxyProtocol:
          version: 2
        terminationDelay: 200

https://traefik.io/blog/announcing-traefik-2-4/#:~:text=However%2C%20when%20forwarding-,SMTP%20connections,-to%20a%20service

@yingshaoxo
Copy link
Author

yingshaoxo commented Mar 23, 2023

The error is:

root@my-new-vps:~/we_love_party/email_platform# python3 email_send.py 
Traceback (most recent call last):
  File "/root/we_love_party/email_platform/email_send.py", line 12, in <module>
    s.send_message(msg)
  File "/usr/lib/python3.10/smtplib.py", line 943, in send_message
    self.ehlo_or_helo_if_needed()
  File "/usr/lib/python3.10/smtplib.py", line 614, in ehlo_or_helo_if_needed
    raise SMTPHeloError(code, resp)
smtplib.SMTPHeloError: (500, b'Error: bad syntax')

and

party_protocols-weloveparty_account_auth_service-1  | ('172.18.0.11', 35778) unrecognised: 

@waynew
Copy link
Collaborator

waynew commented Mar 23, 2023

I don't think this is an aiosmtpd issue - it looks like traefik is terminating, possibly lines incorrectly.

I had a similar issue - Exchange was strict about the \r\n and my custom handler was joining with \n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants