diff --git a/home/.chezmoi.toml.tmpl b/home/.chezmoi.toml.tmpl index d6b91f6..0b31f5e 100644 --- a/home/.chezmoi.toml.tmpl +++ b/home/.chezmoi.toml.tmpl @@ -1,18 +1,2 @@ [data] email = {{ promptString "Git main email address " "" | quote }} -{{- with promptInt "How many mail accounts would you like to configure " 0 -}}{{- $count := . | int }} - {{- if gt $count 0 -}} - {{- range $i, $e := until $count }} -[[data.mail]] -comment = {{ promptString "Mail description " | quote }} -account = {{ promptString "Mail account name " | quote }} -address = {{ promptString "Mail address " | quote }} -usrname = {{ promptString "Mail username " | quote }} -imapsrv = {{ promptString "Mail imap host " | quote }} -smtpsrv = {{ promptString "Mail smtp host " | quote }} -smtport = {{ promptInt "Mail smtp port " 465 }} -smtpaut = {{ promptChoice "Mail smtp auth " (list "on" "plain") "on" }} -autofro = {{ promptChoice "Auto from " (list "on" "off") "off" }} - {{- end }} - {{- end }} -{{- end }} diff --git a/home/.chezmoiignore b/home/.chezmoiignore new file mode 100644 index 0000000..5a316d4 --- /dev/null +++ b/home/.chezmoiignore @@ -0,0 +1,2 @@ +backup/ +backup/** diff --git a/home/backup/chezmoi.toml.tmpl b/home/backup/chezmoi.toml.tmpl new file mode 100644 index 0000000..d969bf5 --- /dev/null +++ b/home/backup/chezmoi.toml.tmpl @@ -0,0 +1,18 @@ +[data] +email = {{ promptString "Git main email address " "" | quote }} +{{- with promptInt "How many mail accounts would you like to configure " 0 -}}{{- $count := . | int }} + {{- if gt $count 0 -}} + {{- range $i, $e := until $count }} +[[data.mail]] +comment = {{ promptString "Mail description " | quote }} +account = {{ promptString "Mail account name " | quote }} +address = {{ promptString "Mail address " | quote }} +usrname = {{ promptString "Mail username " | quote }} +imapsrv = {{ promptString "Mail imap host " | quote }} +smtpsrv = {{ promptString "Mail smtp host " | quote }} +smtport = {{ promptInt "Mail smtp port " 465 | int }} +smtpaut = {{ promptChoice "Mail smtp auth " (list "on" "plain") "on" }} +autofro = {{ promptChoice "Auto from " (list "on" "off") "off" }} + {{- end }} + {{- end }} +{{- end }} diff --git a/home/dot_mbsyncrc.tmpl b/home/backup/dot_mbsyncrc.tmpl similarity index 100% rename from home/dot_mbsyncrc.tmpl rename to home/backup/dot_mbsyncrc.tmpl diff --git a/home/backup/dot_msmtprc.tmpl b/home/backup/dot_msmtprc.tmpl new file mode 100644 index 0000000..fdecb7d --- /dev/null +++ b/home/backup/dot_msmtprc.tmpl @@ -0,0 +1,22 @@ +# Set default values for all following accounts. +defaults +auto_from on +tls_trust_file /etc/ssl/certs/ca-certificates.crt +syslog on +# logfile /var/log/msmtp.log + +{{ range $value := .mail }} +# {{ $value.comment }} +account {{ $value.account }} +host {{ $value.smtpsrv }} +port {{ $value.smtport }} +auth {{ $value.smtpaut }} +tls on +tls_starttls off +user {{ $value.usrname }} +passwordeval "echo $(pass {{ $value.smtpsrv }}/{{ $value.usrname }})" +auto_from {{ $value.autofro }} +from {{ $value.address }} +# +{{ end }} +