gjcarneiro / yacron

A modern Cron replacement that is Docker-friendly
MIT License
454 stars 38 forks source link

email: add smtp login support #21

Closed shenbaise closed 4 years ago

shenbaise commented 6 years ago

how to config email,there is no password option?

gjcarneiro commented 5 years ago

Currently it only works with SMTP servers that do not require login.

dset0x commented 5 years ago

It would be nice if sendmail was supported, but the easiest solution right now is with sasl-enabled postfix.

main.cf:

inet_interfaces = 127.0.0.1

relayhost = [mail.youremailhost.com]:587

smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/saslpass
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_generic_maps = pcre:/etc/postfix/generic

saslpass:

[mail.youremailhost.com]:587 you@youremailhost.com:yourpassword

generic:

// you@youremailhost.com

Build lookup tables:

$ postmap /etc/postfix/generic
$ postmap /etc/postfix/saslpass