syncloud / platform

Run popular services on your device with one click
https://syncloud.org
GNU General Public License v3.0
396 stars 40 forks source link

[mail] implement ISP relay (indirect) delivery feature #553

Open cyberb opened 3 years ago

cyberb commented 3 years ago

Currently Gmail and probably other mail providers do not allow sending mail directly to them: https://support.google.com/mail/answer/10336?p=NotAuthorizedError

We could implement a UI to choose direct/indirect mode with mail server relay address/login/password. Probably it should be done inside Roundcube mail UI (plug-in?) as it is the only Mail UI we have at the moment.

Workaround (gmail example)

Add login and password

vim.tiny  /var/snap/mail/common/sasl_passwd

[smtp.gmail.com]:587 email:password

Encrypt

/snap/mail/current/postfix/usr/sbin/postmap -c /var/snap/mail/common/config/postfix /var/snap/mail/common/sasl_passwd

Change mail config (lost on every upgrade)

vim.tiny /var/snap/mail/common/config/postfix/main.cf

Find existing relayhost and change it.

relayhost = [smtp.gmail.com]:587

Append to the end:

smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/var/snap/mail/common/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

Restart mail:

snap restart mail

Send a message to google mail to check.