Add mailbox account

This commit is contained in:
2026-06-11 21:14:17 +02:00
parent 2a9fad1c35
commit 98f80757e0
4 changed files with 124 additions and 4 deletions
+104
View File
@@ -185,6 +185,61 @@ Expunge Near
Sync Pull
#+END_SRC
** Mailbox Account
#+BEGIN_SRC conf
IMAPAccount mailbox
Host imap.mailbox.org
User thomas@tdehaeze.xyz
PassCmd "pass email/thomas@tdehaeze.xyz"
TLSType IMAPS
AuthMechs LOGIN
#+END_SRC
#+BEGIN_SRC conf
IMAPStore mailbox-remote
Account mailbox
MaildirStore mailbox-local
Path ~/.local/share/mails/mailbox/
Inbox ~/.local/share/mails/mailbox/Inbox
Channel mailbox-Home
Far :mailbox-remote:INBOX
Near :mailbox-local:Inbox
Channel mailbox-Drafts
Far :mailbox-remote:Drafts
Near :mailbox-local:Drafts
Channel mailbox-Archive
Far :mailbox-remote:Archive
Near :mailbox-local:Archive
Channel mailbox-Sent
Far :mailbox-remote:Sent
Near :mailbox-local:Sent
Channel mailbox-Trash
Far :mailbox-remote:Trash
Near :mailbox-local:Trash
#+END_SRC
#+BEGIN_SRC conf
Channel mailbox
Far :mailbox-remote:
Near :mailbox-local:
#+END_SRC
For doing a quick sync of just the INBOX with =mbsync mailbox-download=.
#+BEGIN_SRC conf
Channel mailbox-download
Far :mailbox-remote:INBOX
Near :mailbox-local:Inbox
Create Near
Expunge Near
Sync Pull
#+END_SRC
** ESRF Account
#+BEGIN_SRC conf
IMAPAccount esrf
@@ -269,6 +324,17 @@ passwordeval "pass email/dehaeze.thomas@gmail.com"
# proxy_port 8080
#+END_SRC
** Mailbox Account
#+BEGIN_SRC conf
account mailbox
host smtp.mailbox.org
port 587
protocol smtp
from thomas@tdehaeze.xyz
user thomas@tdehaeze.xyz
passwordeval "pass email/thomas@tdehaeze.xyz"
#+END_SRC
** ESRF Account
#+BEGIN_SRC conf
account esrf
@@ -1031,9 +1097,11 @@ set from = "thomas.dehaeze@esrf.fr"
folder-hook gmail/* source $HOME/.config/neomutt/accounts/gmail
folder-hook esrf/* source $HOME/.config/neomutt/accounts/esrf
folder-hook mailbox/* source $HOME/.config/neomutt/accounts/mailbox
macro index,pager ge "<change-folder>+esrf/Inbox<enter>" "go to inbox"
macro index,pager gm "<change-folder>+gmail/Inbox<enter>" "go to inbox"
macro index,pager gb "<change-folder>+mailbox/Inbox<enter>" "go to inbox"
#+END_SRC
*** Gmail
@@ -1067,6 +1135,36 @@ This empty code block is used to add a new line after signature
#+begin_src conf :tangle ~/.config/neomutt/accounts/gmail.signature :comments none :padline no
#+end_src
*** Mailbox
**** Configuration
#+begin_src conf :tangle ~/.config/neomutt/accounts/mailbox :comments none
set from = "thomas@tdehaeze.xyz"
set sendmail = "$HOME/.config/neomutt/bin/send_mail.sh mailbox"
# Other special folders.
set mbox = "+mailbox/Archive"
set record = "+mailbox/Sent"
set postponed = "+mailbox/Drafts"
set signature = "$HOME/.config/neomutt/accounts/mailbox.signature"
macro index,pager d \
"<save-message>+mailbox/Archive<enter>" \
"Move message to the Archive"
macro index,pager D \
"<save-message>+mailbox/Trash<enter>" \
"Move message to the Trash"
#+end_src
**** Signature
#+begin_src conf :tangle ~/.config/neomutt/accounts/mailbox.signature :comments none :padline no
Thomas DEHAEZE
#+end_src
This empty code block is used to add a new line after signature
#+begin_src conf :tangle ~/.config/neomutt/accounts/mailbox.signature :comments none :padline no
#+end_src
*** ESRF
**** Configuration
#+begin_src conf :tangle ~/.config/neomutt/accounts/esrf :comments none
@@ -1257,6 +1355,12 @@ named-mailboxes "  Sent" =gmail/Sent
named-mailboxes "  Drafts" =gmail/Drafts
named-mailboxes "  Archive" =gmail/Archive
named-mailboxes "  Trash" =gmail/Trash
named-mailboxes " MAILBOX" =empty/mailbox
named-mailboxes "  Inbox" =mailbox/Inbox
named-mailboxes "  Sent" =mailbox/Sent
named-mailboxes "  Drafts" =mailbox/Drafts
named-mailboxes "  Archive" =mailbox/Archive
named-mailboxes "  Trash" =mailbox/Trash
named-mailboxes " ESRF" =empty/esrf
named-mailboxes "  Inbox" =esrf/Inbox
named-mailboxes "  Sent" =esrf/Sent
+1 -1
View File
@@ -420,7 +420,7 @@ config.bind(',q', 'QRcode')
** Create a new password
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/add-passowrd.sh
url=$(echo "$QUTE_URL" | awk -F[/:] '{print $4}' | grep -oP '[\w-]+\.[\w-]+$' | rofi -i -p "URL" -dmenu -lines 1)
username=$(echo -e "dehaeze.thomas@gmail.com\nthomas.dehaeze@esrf.fr\ntdehaeze" | rofi -p "Username" -dmenu -lines 5)
username=$(echo -e "thomas@tdehaeze.xyz\ndehaeze.thomas@gmail.com\nthomas.dehaeze@esrf.fr\ntdehaeze" | rofi -p "Username" -dmenu -lines 5)
password=$(rofi -p "Password" -dmenu -password -lines 1)
if [ -z "$url" ] || [ -z "$username" ] || [ -z "$password" ]; then
+14
View File
@@ -8,3 +8,17 @@ paru -S --needed --noconfirm \
neomutt \
mu \
lynx urlview
echo "==> Tangling mail.org"
emacsclient -e '(org-babel-tangle-file "/home/thomas/.config/literate-dotfiles/mail.org")'
echo "==> Creating mail directories"
mkdir -p ~/.local/share/mails/{gmail,esrf,search,empty}
mkdir -p ~/.local/share/mails/gmail/{Inbox,Sent,Drafts,Archive,Trash}
mkdir -p ~/.local/share/mails/esrf/{Inbox,Sent,Drafts,Archive,Trash}
mkdir -p ~/.local/share/mails/search/{cur,new,tmp}
mkdir -p ~/.local/share/mails/empty/gmail/{cur,new,tmp}
mkdir -p ~/.local/share/mails/empty/esrf/{cur,new,tmp}
echo "==> Getting all the emails"
mbsync -a
+5 -3
View File
@@ -220,18 +220,20 @@ done
# Count number of new mails before retreiving mails
gmail_old="$(ls ~/.local/share/mails/gmail/Inbox/new | wc -l)"
mailbox_old="$(ls ~/.local/share/mails/mailbox/Inbox/new | wc -l)"
esrf_old="$(ls ~/.local/share/mails/esrf/Inbox/new | wc -l)"
# Retreive mails
mbsync -c /home/thomas/.config/isync/mbsyncrc $opt_all $opt_verbose gmail-Home esrf-Home 2>/tmp/mbsync.log
mbsync -c /home/thomas/.config/isync/mbsyncrc $opt_all $opt_verbose gmail-Home mailbox-Home esrf-Home 2>/tmp/mbsync.log
# Count number of new mails after retreiving mails
gmail_new="$(ls ~/.local/share/mails/gmail/Inbox/new | wc -l)"
mailbox_new="$(ls ~/.local/share/mails/mailbox/Inbox/new | wc -l)"
esrf_new="$(ls ~/.local/share/mails/esrf/Inbox/new | wc -l)"
# Notification if there are new retreive mails
if [ "$(($esrf_new+$gmail_new))" -gt "$(($esrf_old+$gmail_old))" ]; then
dunstify --replace=98465 'Mails ' "$(($gmail_new+$esrf_new)) new mail(s)"
if [ "$(($esrf_new+$mailbox_new+$gmail_new))" -gt "$(($esrf_old+$mailbox_old+$gmail_old))" ]; then
dunstify --replace=98465 'Mails ' "$(($gmail_new+$mailbox_new+$esrf_new)) new mail(s)"
fi
# Indexation and Tags