1
0
This commit is contained in:
Jeff Lance 2024-03-04 20:02:02 +01:00
parent 09cea8065a
commit dcb8e7ea88
3 changed files with 59 additions and 88 deletions

View File

@ -1,13 +1,18 @@
[data]
email = {{ promptString "Git main email address " "" | quote }}
{{- with promptInt "How many mbsync accounts would you generate " 0 -}}{{- $count := . | int }}
{{- with promptInt "How many mail accounts would you like to configure " 0 -}}{{- $count := . | int }}
{{- if gt $count 0 -}}
{{- range $i, $e := until $count }}
[[data.mbsync]]
name = {{ promptString "MbSync account name " | quote }}
mail = {{ promptString "MbSync account mail " | quote }}
user = {{ promptString "MbSync account user " | quote }}
host = {{ promptString "MbSync account host " | quote }}
[[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 }}

View File

@ -25,15 +25,15 @@ BufferLimit 100M
# #
##########################
{{ range $value := .mbsync }}
# {{ $value.name }}
{{ range $value := .mail }}
# {{ $value.comment }}
#-------------------------
IMAPAccount {{ $value.name }}
IMAPAccount {{ $value.account }}
# Address to connect to
Host {{ $value.host }}
User {{ $value.user }}
PassCmd "pass {{ $value.host }}/{{ $value.user }}"
Host {{ $value.imapsrv }}
User {{ $value.usrname }}
PassCmd "pass {{ $value.host }}/{{ $value.usrname }}"
# Use SSL
# SSLType IMAPS
SSLType None
@ -43,61 +43,61 @@ SSLType None
CertificateFile /etc/ssl/certs/ca-certificates.crt
IMAPStore {{ $value.name }}-remote
Account {{ $value.name }}
IMAPStore {{ $value.account }}-remote
Account {{ $value.account }}
MaildirStore {{ $value.name }}-local
MaildirStore {{ $value.account }}-local
SubFolders Verbatim
# The trailing "/" is important
Path ~/Mail/{{ $value.name }}/
Inbox ~/Mail/{{ $value.name }}/inbox
Path ~/Mail/{{ $value.account }}/
Inbox ~/Mail/{{ $value.account }}/inbox
Channel {{ $value.name }}-inbox
Far :{{ $value.name }}-remote:
Near :{{ $value.name }}-local:inbox
Channel {{ $value.account }}-inbox
Far :{{ $value.account }}-remote:
Near :{{ $value.account }}-local:inbox
Sync PullNew PullDelete Push
SyncState *
# Remove Both
Expunge Both
Channel {{ $value.name }}-sent
Far :{{ $value.name }}-remote:"Sent Items"
Near :{{ $value.name }}-local:sent
Channel {{ $value.account }}-sent
Far :{{ $value.account }}-remote:"Sent Items"
Near :{{ $value.account }}-local:sent
Sync PullNew PullDelete Push
SyncState *
Expunge Both
Channel {{ $value.name }}-trash
Far :{{ $value.name }}-remote:"Deleted Items"
Near :{{ $value.name }}-local:trash
Channel {{ $value.account }}-trash
Far :{{ $value.account }}-remote:"Deleted Items"
Near :{{ $value.account }}-local:trash
Sync PullNew PullDelete Push
SyncState *
Expunge Both
Channel {{ $value.name }}-drafts
Far :{{ $value.name }}-remote:"Drafts"
Near :{{ $value.name }}-local:drafts
Channel {{ $value.account }}-drafts
Far :{{ $value.account }}-remote:"Drafts"
Near :{{ $value.account }}-local:drafts
Sync PullNew PullDelete Push
SyncState *
Expunge Both
Channel {{ $value.name }}-junk
Far :{{ $value.name }}-remote:"Junk Email"
Near :{{ $value.name }}-local:junk
Channel {{ $value.account }}-junk
Far :{{ $value.account }}-remote:"Junk Email"
Near :{{ $value.account }}-local:junk
Sync PullNew PullDelete Push
SyncState *
Expunge Both
Channel {{ $value.name }}-archive
Far :{{ $value.name }}-remote:"Archive"
Near :{{ $value.name }}-local:archive
Channel {{ $value.account }}-archive
Far :{{ $value.account }}-remote:"Archive"
Near :{{ $value.account }}-local:archive
Pattern *
Create Near
MaxMessages 1500
@ -106,12 +106,12 @@ SyncState *
Expunge Both
Group {{ $value.name }}
Channel {{ $value.name }}-inbox
Channel {{ $value.name }}-sent
Channel {{ $value.name }}-trash
Channel {{ $value.name }}-drafts
Channel {{ $value.name }}-junk
Channel {{ $value.name }}-archive
Group {{ $value.account }}
Channel {{ $value.account }}-inbox
Channel {{ $value.account }}-sent
Channel {{ $value.account }}-trash
Channel {{ $value.account }}-drafts
Channel {{ $value.account }}-junk
Channel {{ $value.account }}-archive
{{ end }}

View File

@ -5,52 +5,18 @@ tls_trust_file /etc/ssl/certs/ca-certificates.crt
syslog on
# logfile /var/log/msmtp.log
# MaLa
account jeff.lance@mala.fr
host ssl0.ovh.net
port 465
auth on
{{ range $value := .mail }}
# {{ $value.comment }}
account {{ $value.account }}
host {{ $value.smtpsrv }}
port {{ $value.smtport }}
auth {{ $value.smtpaut }}
tls on
tls_starttls off
user jeff.lance@mala.fr
passwordeval "echo $(pass ssl0.ovh.net/jeff.lance@mala.fr)"
auto_from off
from jeff.lance@mala.fr
user {{ $value.usrname }}
passwordeval "echo $(pass {{ $value.smtpsrv }}/{{ $value.usrname }})"
auto_from {{ $value.autofro }}
from {{ $value.address }}
#
{{ end }}
account games@mala.fr
host ssl0.ovh.net
port 465
auth on
tls on
tls_starttls off
user games@mala.fr
passwordeval "echo $(pass ssl0.ovh.net/games@mala.fr)"
auto_from off
from games@mala.fr
# GMail
account mathslance@gmail.com
host imap.gmail.com
port 465
auth on
tls on
tls_starttls off
user mathslance@gmail.com
passwordeval "echo $(pass google.com/mathslance@gmail.com)"
auto_from off
from mathslance@gmail.com
# Ac-creteil
account jean-francois.lance@ac-creteil.fr
host smtp-ext.ac-creteil.fr
port 465
auth plain
tls on
tls_starttls off
user jlance
passwordeval "echo $(pass ac-creteil.fr/jlance)"
auto_from off
from jean-francois.lance@ac-creteil.fr
# Set a default account
account default : jeff.lance@mala.fr