From 2e29d7d8bd8beee2737a09a82abfcb3fec62a515 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Wed, 9 Dec 2020 22:14:17 +0100 Subject: [PATCH] Automatically synchronize Sent inbox --- mail.org | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/mail.org b/mail.org index 1d0190d..fe5578b 100644 --- a/mail.org +++ b/mail.org @@ -1078,7 +1078,7 @@ https://unix.stackexchange.com/questions/20456/pretty-print-mails-from-mutt **** Configuration #+begin_src conf :tangle ~/.config/neomutt/accounts/gmail :comments none set from = "dehaeze.thomas@gmail.com" - set sendmail = "msmtp -a gmail" + set sendmail = "~/.config/neomutt/bin/send_mail.sh gmail" # Other special folders. set mbox = "+gmail/Archive" @@ -1108,7 +1108,7 @@ This empty code block is used to add a new line after signature **** Configuration #+begin_src conf :tangle ~/.config/neomutt/accounts/esrf :comments none set from = "thomas.dehaeze@esrf.fr" - set sendmail = "msmtp -a esrf" + set sendmail = "~/.config/neomutt/bin/send_mail.sh esrf" # Other special folders. set mbox = "+esrf/Archive" @@ -1138,7 +1138,7 @@ This empty code block is used to add a new line after signature **** Configuration #+begin_src conf :tangle ~/.config/neomutt/accounts/ulg :comments none set from = "thomas.dehaeze@doct.uliege.be" - set sendmail = "msmtp -a ulg" + set sendmail = "~/.config/neomutt/bin/send_mail.sh ulg" # Other special folders. set mbox = "+ulg/Archive" @@ -1168,7 +1168,7 @@ This empty code block is used to add a new line after signature **** Configuration #+begin_src conf :tangle ~/.config/neomutt/accounts/uliege :comments none set from = "tdehaeze@uliege.be" - set sendmail = "msmtp -a uliege" + set sendmail = "~/.config/neomutt/bin/send_mail.sh uliege" # Other special folders. set mbox = "+uliege/Archive" @@ -1396,7 +1396,23 @@ Of ranger can be used with the =A= keybinding. #+end_src ** Scripts and other config files -*** Sync Mail script +*** Send Mail Script +:PROPERTIES: +:header-args: :tangle ~/.config/neomutt/bin/send_mail.sh +:header-args+: :comments both :mkdirp yes +:header-args+: :shebang "#!/usr/bin/env bash" +:END: + +#+begin_src bash + msmtp -a $1 ${@:2} && \ + if [ $TMUX ]; then + tmux split -v -l 1 mbsync $1-Sent && tmux select-pane -U + else + mbsync $1-Sent + fi +#+end_src + +*** Sync Mail Script :PROPERTIES: :header-args: :tangle ~/.config/neomutt/bin/get_new_mail.sh :header-args+: :comments both :mkdirp yes