diff options
Diffstat (limited to 'msmtp.rb')
-rw-r--r-- | msmtp.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/msmtp.rb b/msmtp.rb new file mode 100644 index 0000000..383be87 --- /dev/null +++ b/msmtp.rb @@ -0,0 +1,26 @@ +def make_msmtp_config config + accounts = config['accounts'].map do |account| + <<~END.chomp + # BEGIN profile generated by mmm + account #{account['name']} + host #{account['smtp']} + port 587 + from #{account['email']} + user #{account['email']} + passwordeval "pass show #{account['pass_tag'] || account['name']}" + # END profile generated by mmm + END + end + + accounts.join "\n\n" +end + +def msmtprc_preamble + <<~END + defaults + auth on + tls on + tls_trust_file /etc/ssl/certs/ca-certificates.crt + logfile ~/.msmtp.log + END +end |