chatwoot / chatwoot

Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬
https://www.chatwoot.com/help-center
Other
21.38k stars 3.63k forks source link

Docker swarm error sending system notifications SMTPSyntaxError #7322

Closed aerostovtsev closed 1 year ago

aerostovtsev commented 1 year ago

Describe the bug

Hello!

I changed the docker-compose.yml config and started Chatwoot in Docker swarm, after which I ran into a problem sending email notification systems. There is an error in the console when sending a system notification (for example password reset) SMTPSyntaxError https://i.imgur.com/atPGE3u.png. When I run docker normally with docker-compose up command, there is no such error and the messages are sent.

To Reproduce

  1. The .env variable is set to MAILER_SENDER_EMAIL="BrandName email@yourdomain.com"
  2. Run chatwoot in docker swarm
  3. I went to the reset page https://chat.bitcdp.ru/app/auth/reset/password
  4. Specified the user's valid mail in the reset form
  5. I checked the user's mail client, the message did not come
  6. Checked the server console, it fixed the error SMTPSyntaxError

If you change the variable to MAILER_SENDER_EMAIL=email@yourdomain.com, then when running in docker swarm, system notifications are correctly sent and there are no errors in the console.

Expected behavior

In docker swarm mode, system notifications are sent without errors when the MAILER_SENDER_EMAIL variable is set with a value in the format "BrandName email@yourdomain.com"

Environment

Docker

Cloud Provider

Other [please specify in the description]

Platform

Browser

Operating system

Ubuntu

Browser and version

No response

Docker (if applicable)

Docker version: 23.0.6 Docker Compose version v2.2.2 Client: Docker Engine - Community Version: 23.0.6 API version: 1.42 Go version: go1.19.9 Git commit: ef23cbc Built: Fri May 5 21:18:22 2023 OS/Arch: linux/amd64 Context: default

Server: Docker Engine - Community Engine: Version: 23.0.6 API version: 1.42 (minimum version 1.12) Go version: go1.19.9 Git commit: 9dbdbd4 Built: Fri May 5 21:18:22 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.21 GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc: Version: 1.1.7 GitCommit: v1.1.7-0-g860f061 docker-init: Version: 0.19.0 GitCommit: de40ad0 root@fb-chatwoot:/home/admin/fb-chatwoot# docker-compose version Docker Compose version v2.2.2 root@fb-chatwoot:/home/admin/fb-chatwoot# docker info Client: Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.10.4 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.17.3 Path: /usr/libexec/docker/cli-plugins/docker-compose

Server: Containers: 8 Running: 5 Paused: 0 Stopped: 3 Images: 12 Server Version: 23.0.6 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Using metacopy: false Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: active NodeID: b3lx94ymxhswiqxwoum90w3iw Is Manager: true ClusterID: jmi2rs1sa0inumb2vwbpe906u Managers: 1 Nodes: 3 Default Address Pool: 10.0.0.0/8
SubnetSize: 24 Data Path Port: 4789 Orchestration: Task History Retention Limit: 5 Raft: Snapshot Interval: 10000 Number of Old Snapshots to Retain: 0 Heartbeat Tick: 1 Election Tick: 10 Dispatcher: Heartbeat Period: 5 seconds CA Configuration: Expiry Duration: 3 months Force Rotate: 0 Autolock Managers: false Root Rotation In Progress: false Node Address: 10.129.0.18 Manager Addresses: 10.129.0.18:2377 Runtimes: io.containerd.runc.v2 runc Default Runtime: runc Init Binary: docker-init containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc version: v1.1.7-0-g860f061 init version: de40ad0 Security Options: apparmor seccomp Profile: builtin cgroupns Kernel Version: 5.15.0-73-generic Operating System: Ubuntu 22.04.2 LTS OSType: linux Architecture: x86_64 CPUs: 2 Total Memory: 1.928GiB Name: fb-chatwoot ID: 2UPV:JAH3:W4JU:SJAP:IHXL:JJID:VERP:ITPM:5QWC:X7IW:NY2R:LN2R Docker Root Dir: /var/lib/docker Debug Mode: false Username: atomantkras Registry: https://index.docker.io/v1/ Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

Additional context

Chatwoot v2.17.1

sojan-official commented 1 year ago

@aerostovtsev could you check the faq configuration with these steps ? ref: https://www.chatwoot.com/docs/self-hosted/faq/

aerostovtsev commented 1 year ago

@sojan-official Yes, I followed all the steps in the console. The .env file has the variable MAILER_SENDER_EMAIL="BrandName email@yourdomain.com"

  1. When executing the command mailer.mail(from: 'sender@example.com', to: 'recipient@example.com', subject: 'test', body: "Hello, you've got mail!").deliver OK, the letter has been sent.

  2. When sending a system notification about password recovery - Not ok, the letter was not sent.

sojan-official commented 1 year ago

@aerostovtsev you need to wrap your email address in <>

"BrandName <email@yourdomain.com>"
aerostovtsev commented 1 year ago

@sojan-official Yes, this is the value I use, it's github that removes brackets from the message text.

Screenshot 2023-06-27 at 8 30 43

Screenshot set to .env

Screenshot 2023-06-27 at 14 30 44
sojan-official commented 1 year ago

@aerostovtsev can you login to rails console in one of the containers and check the value of MAILER_SENDER_EMAIL

ENV.fetch('MAILER_SENDER_EMAIL', '')
aerostovtsev commented 1 year ago

@sojan-official Screenshot from checking the value of MAILER_SENDER_EMAIL

Screenshot 2023-06-28 at 08 35 44

I tried to change the value in .env to the format MAILER_SENDER_EMAIL=BrandName <email@yourdomain.com>, removed wrap ``, as a result I received the correct sending of the system message.

sojan-official commented 1 year ago

@aerostovtsev Thanks for the follow-up.

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.