I'll leave my workaround to use with gmail for future reference after testing every suggestion here without success:
- Define SMTP_USER and SMTP_PASS
SHARELATEX_EMAIL_SMTP_USER=your_email SHARELATEX_EMAIL_SMTP_PASS=app_password # requires 2fa enabled
- Connect to sharelatex container (docker exec) and run this command:
$ cp /overleaf/services/web/app/src/Features/Email/EmailSender.js /var/lib/sharelatex
- Move the file EmailSender.js in your ${SHARELATEX_DATA_PATH} (defined in config/overleaf.rc) to wherever you want (I recommend toolkit root folder)
- Add this definition in line 60 of EmailSender.js (right before
client = nodemailer.createTransport(smtp)
)smtp.service = "gmail";
- Edit lib/docker-compose.base.yml to bind the new file. Add this line in the volumes section
- ../EmailSender.js:/overleaf/services/web/app/src/Features/Email/EmailSender.js:ro
Use the correct relative/absolute path to your EmailSender.js
Run bin/docker-compose down && bin/docker-compose up -d
.
Yes, I've tried with "forgot password" and it seems to work. I've uncommented SMTP_USER and SMTP_EMAIL, I think the default port is 465 and host smtp.gmail.com