-
Notifications
You must be signed in to change notification settings - Fork 177
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
Configuring SMTP crashes the pds docker container #164
Comments
It's PDS_EMAIL_FROM_ADDRESS. |
For crying out loud! Talk about making a rookie mistake. You are correct - I had for some stupid reason omitted the "_ADDRESS" after the PDS_EMAIL_FROM. That brought me further, and eventually I found that it is probably the SMTP server that I use at my hosting company (Hetzner in Germany) that is a bit weird: When setting up a mail client (Evolution in my case), they default to SMTPS on port 587, but using that in the PDS_EMAIL_SMTP_URL just ended in an internal server error. A dive into the docker log, I found that the problem was a timeout - "Greeting never received". Eventually I tried setting port 465, even though there is a lot of discussions and articles that talks about port 465 being blocked on Hetzner mailservers, and - honestly, to my surprise - the mail went through with flying colors. No escaping, no nothing. So, to summarize: If you are using an external SMTP server that is not a service like Resend or the likes, you can simply add the login information to your SMTP-server to pds.env like this: PDS_EMAIL_SMTP_URL=smtps://[email protected]:[email protected]:465/ You do not need to escape the "@" in the username or e.g. a "!" in the password - it simply works as is. If you use port 587 and receive a timeout, try falling back to the deprecated (by almost three decades) port 465 instead - that may work. @BtbN - thanks a ton for your help, I was really tearing whatever few hairs are still on my head out in frustration. |
Port 465 is smtps, straight up TLS encrypted like https. It's not deprecated, but even recommended these days, since downgrade attacks are just out the window from the get go. There's also port 25, which is where mailservers talk to each other on. |
I have installed the PDS on a clean Debian 12 server, and regardless of what I do, setting up SMTP on an external server crashes the pds container every time.
I used this installer script:
wget https://raw.githubusercontent.com/bluesky-social/pds/main/installer.sh
I have tried adding the example lines from the documentation (the resend-example), and even that crashes the container on start:
/app/node_modules/.pnpm/@atproto[email protected]/node_modules/@atproto/pds/src/config/config.ts:146
throw new Error(
^
Error: Partial email config, must set both emailFromAddress and emailSmtpUrl
at envToCfg (/app/node_modules/.pnpm/@atproto[email protected]/node_modules/@atproto/pds/src/config/config.ts:146:13)
at main (/app/index.js:14:15)
at Object. (/app/index.js:72:1)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
Node.js v20.11.1
The lines I have added to /pds/pds.env are:
PDS_EMAIL_FROM=[email protected]
PDS_EMAIL_SMTP_URL=smtps://resend:[email protected]:465/
I have tried with the actual information for my email server in this form as well:
PDS_EMAIL_SMTP_URL=smtps://[email protected]:[email protected]:587/
The email address, the server domain as well as the password has been checked and double checked and triple checked and they are all valid. The file is being edited with either nano or vi and there should be no weird chars anywhere.
If I comment out the PDS_EMAIL_SMTP_URL the container runs as expected, so the PDS-EMAIL-FROM seems to be accepted.
The text was updated successfully, but these errors were encountered: