postal icon indicating copy to clipboard operation
postal copied to clipboard

SMTP Replay

Open djmuttart opened this issue 8 years ago • 5 comments

Hello I'm trying to configure the postal.yml file to use an external SMTP server to handle the relaying of the emails I send to Postal. My current configurations in postal.yml are exactly what you see below. I've searched the issue logs and I saw that there are other settings which I don't have in my postal.yml file. Do I need this as well and if so, what do I include and/or remove in my .yml file?

My File smtp: host: 127.0.0.1 port: 25 username: # Complete when Postal is running and you can password: # generate the credentials within the interface. from_name: Postal from_address: [email protected]

Not in my file smtp_server: port: 25 tls_enabled: false tls_certificate_path: # Defaults to config/smtp.cert tls_private_key_path: # Defaults to config/smtp.key tls_ciphers: ssl_version: SSLv23 proxy_protocol: false log_connect: true strip_received_headers: false max_message_size: 14 # size in Megabytes

smtp_relays:

hostname:
port: 25
ssl_mode: Auto

djmuttart avatar May 17 '18 18:05 djmuttart

Try with "hostname" (a domain name) instead IP Address.

smtp_relays:

hostname: **your-stmp.hostname**
port: 25
ssl_mode: none

rbustos avatar May 17 '18 18:05 rbustos

Thank you,

I will give that a try, also, do I need to remove these two chunks of setting from my yml file

mtp: host: 127.0.0.1 port: 25 username: # Complete when Postal is running and you can password: # generate the credentials within the interface. from_name: Postal from_address: [email protected]

Not in my file smtp_server: port: 25 tls_enabled: false tls_certificate_path: # Defaults to config/smtp.cert tls_private_key_path: # Defaults to config/smtp.key tls_ciphers: ssl_version: SSLv23 proxy_protocol: false log_connect: true strip_received_headers: false max_message_size: 14 # size in Megabytes

djmuttart avatar May 17 '18 19:05 djmuttart

Technically you only need values in your postal.yml file if you want to override the defaults which are listed here https://github.com/atech/postal/blob/master/config/postal.defaults.yml

The smtp: section is for Postal to send messages to the users (i.e. password resets) and the smtp_server: section is for Postal to actually send the messages you tell it from your application.

Have you actually put the URL of your relay server in the hostname: bit?

willpower232 avatar May 18 '18 10:05 willpower232

willpower232, I got the relay to work then I thought of something, why use smtp_relay, can't I use my smtp server instead of the Postal default SMTP?

so I removed smtp_relay and edited the following and it didn't work. It still seems to be using the Postal default mail server because it fails to send to mymailserver.com smtp: host: mymailserver.com port: 25 username: # Complete when Postal is running and you can password: # generate the credentials within the interface. from_name: Postal from_address: [email protected]

djmuttart avatar May 18 '18 19:05 djmuttart

Is your SMTP server on a different server? Can you telnet to it from the Postal server? Have you entered the username and password correctly?

willpower232 avatar Jun 04 '18 11:06 willpower232