]> git.rmz.io Git - dotfiles.git/commitdiff
mail: use mailfence as the default inbox
authorSamir Benmendil <me@rmz.io>
Mon, 16 Mar 2020 00:28:17 +0000 (00:28 +0000)
committerSamir Benmendil <me@rmz.io>
Mon, 16 Mar 2020 00:28:17 +0000 (00:28 +0000)
mbsync/config
msmtprc
mutt/accounts/mailfence [new file with mode: 0644]
mutt/bindings
mutt/hooks
mutt/muttrc

index 189e39bf00000f4338b2a2c6e05aa141d9f07c07..a51b7a67a544b1de38c30a3efcc3f4a341f2aa36 100644 (file)
@@ -4,6 +4,56 @@ Expunge Both
 Create Both
 CopyArrivalDate yes
 
+IMAPAccount     mailfence
+Host            imap.mailfence.com
+User            samirbenmendil
+PassCmd         "sed -En '/imap.mailfence.com.*samirbenmendil/ s/.*password (.*)/\\1/p' ~/.netrc"
+AuthMechs       LOGIN
+SSLType         IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore mailfence-remote
+Account mailfence
+
+MaildirStore mailfence-local
+Path         ~/mail/mailfence/
+Inbox        ~/mail/mailfence/inbox
+SubFolders   Verbatim
+
+Channel mailfence-inbox
+Master  :mailfence-remote:
+Slave   :mailfence-local:
+Patterns INBOX
+
+Channel mailfence-drafts
+Master  :mailfence-remote:"Drafts"
+Slave   :mailfence-local:"drafts"
+
+Channel mailfence-sent
+Master  :mailfence-remote:"Sent Items"
+Slave   :mailfence-local:"sent"
+
+Channel mailfence-spam
+Master  :mailfence-remote:"Spam?"
+Slave   :mailfence-local:"spam"
+
+Channel mailfence-bin
+Master  :mailfence-remote:"Trash"
+Slave   :mailfence-local:"trash"
+
+Channel mailfence-archive
+Master  :mailfence-remote:
+Slave   :mailfence-local:
+Patterns archive*
+
+Group mailfence
+Channel mailfence-inbox
+Channel mailfence-drafts
+Channel mailfence-sent
+Channel mailfence-spam
+Channel mailfence-bin
+Channel mailfence-archive
+
 IMAPAccount     gmail
 Host            imap.gmail.com
 User            samir.benmendil@gmail.com
diff --git a/msmtprc b/msmtprc
index 72b132260443fec0ee96a2396c4aa849c9a098c3..dd223583e3e46829c38be09a6280d55f21800659 100644 (file)
--- a/msmtprc
+++ b/msmtprc
@@ -3,6 +3,19 @@ tls on
 tls_trust_file /etc/ssl/certs/ca-certificates.crt
 logfile ~/.msmtp/msmtp.log
 
+# mailfence
+account      mailfence
+host         smtp.mailfence.com
+protocol     smtp
+tls          on
+# no plaintext negotiations, straight into tls
+tls_starttls off
+port         465
+auth         on
+user         samirbenmendil
+passwordeval "pass mailfence.com/smtp"
+from         me@rmz.io
+
 # gmail
 account gmail
 host smtp.gmail.com
@@ -33,4 +46,4 @@ user samir.benmendil@ultrahaptics.com
 passwordeval "pass ultrahaptics/okta.com/samir.benmendil@ultrahaptics.com"
 
 #set default account
-account default : gmail
+account default : mailfence
diff --git a/mutt/accounts/mailfence b/mutt/accounts/mailfence
new file mode 100644 (file)
index 0000000..4714c72
--- /dev/null
@@ -0,0 +1,28 @@
+# vim: ft=muttrc
+set realname = "Samir Benmendil"
+set from = "me@rmz.io"
+my_hdr Bcc: sent@rmz.io
+set sendmail = "msmtp -a mailfence"
+
+set spoolfile    = "+mailfence/inbox"   # set inbox
+set postponed    = "+mailfence/drafts"  # drafts folder
+set record       = "+mailfence/sent"    # fcc sent message into folder
+set trash        = "+mailfence/trash"   # deleted messages go here
+set mbox         = "+mailfence/archive"
+unset move                          # do not move read msgs, we archive them after 3 months
+
+# goobook
+#TODO
+# set query_command = "goobook query '%s'"
+
+mailboxes "+mailfence/inbox"
+mailboxes "+mailfence/sent"
+# mailboxes "+mailfence/youtube"
+mailboxes "+mailfence/archive"
+mailboxes "+mailfence/drafts"
+mailboxes "+mailfence/spam"
+mailboxes "+mailfence/trash"
+
+macro index,pager gi "<change-folder>=mailfence/inbox<return>"   "go to inbox"
+macro index,pager ga "<change-folder>=mailfence/archive<return>" "go to archive"
+macro index,pager gs "<change-folder>=mailfence/spam<return>"    "go to spam"
index 8aac997f96c5cfbac80528efcda079bf845e6a61..4898ee6f2b0e309e0438725519e1fc8e6c5c5784 100644 (file)
@@ -49,5 +49,6 @@ bind attach <return>    view-mailcap
 # add sender to goobook
 macro index,pager a "<pipe-message>goobook add<return>" "add the sender address to goobook"
 
-macro index,pager <f2> '<sync-mailbox><enter-command>source $my_config_dir/accounts/gmail<enter><change-folder>!<enter>'
+macro index,pager <f2> '<sync-mailbox><enter-command>source $my_config_dir/accounts/mailfence<enter><change-folder>!<enter>'
 macro index,pager <f3> '<sync-mailbox><enter-command>source $my_config_dir/accounts/fpp<enter><change-folder>!<enter>'
+macro index,pager <f4> '<sync-mailbox><enter-command>source $my_config_dir/accounts/gmail<enter><change-folder>!<enter>'
index 44b709e3843c988dde0aefec0ea2254b5aeab9c2..40391e3567a96f91e03e0986f6ca630233e0ac10 100644 (file)
@@ -1,8 +1,9 @@
 # vim: ft=muttrc
-reply-hook .                 source $my_config_dir/accounts/gmail
+reply-hook .                 source $my_config_dir/accounts/mailfence
 reply-hook "%L chakra"       source $my_config_dir/accounts/chakra
 reply-hook "%L fpp"          source $my_config_dir/accounts/fpp
 
+folder-hook mailfence     source $my_config_dir/accounts/mailfence
 folder-hook gmail         source $my_config_dir/accounts/gmail
 folder-hook gmail/chakra  source $my_config_dir/accounts/chakra
 
@@ -14,6 +15,8 @@ folder-hook .* "exec collapse-all"
 folder-hook inbox push '<limit>=(=U|=F)<enter>'
 # delete mails older than 3 months
 folder-hook gmail/inbox push '<delete-pattern>!~(~U|~F|~d<3m)<enter>'
+# or archive them for mailfence
+folder-hook mailfence/inbox push '<tag-pattern>!~(~U|~F|~d<3m)<enter><tag-prefix-cond><save-message>=archive<enter><end-cond>'
 
 # limit youtube to Unread and Flagged mails
 folder-hook gmail/youtube push '<limit>=(=U|=F)<enter>'
index 5bfba235b2cf01f4641b8a74866dde3167572c5b..3c9a2dab0949c83422ed5f1c38a0d68e44ad9be1 100644 (file)
@@ -2,6 +2,7 @@ set my_config_dir = $XDG_CONFIG_HOME/mutt
 
 # general settings
 alternates -group me samir.benmendil@gmail.com ram-z@hotmail.com @rmz.io
+alternates -group me samir.benmendil@mailfence.com
 alternates -group me -group chakra ram-z@chakra chakra@rmz.io
 alternates -group me -group unimaas s.benmendil@student.maastrichtuniversity.nl
 alternates -group me -group cadscan sb@cad-scan.co.uk
@@ -106,4 +107,4 @@ source hooks
 source bindings
 source colors/badfox         # color theme
 
-source accounts/gmail  # source default account
+source accounts/mailfence  # source default account