Change Gmail archive configuration

This commit is contained in:
Thomas Dehaeze 2021-10-25 14:25:08 +02:00
parent aad97a967e
commit 1697632bec

View File

@ -59,8 +59,8 @@ Channel gmail-Trash
Far :gmail-remote:"[Gmail]/Trash" Far :gmail-remote:"[Gmail]/Trash"
Near :gmail-local:Trash Near :gmail-local:Trash
Channel gmail-All Channel gmail-Archive
Far :gmail-remote:"[Gmail]/All Mail" Far :gmail-remote:"[Imap]/Archive"
Near :gmail-local:Archive Near :gmail-local:Archive
#+END_SRC #+END_SRC
@ -75,12 +75,10 @@ Near :gmail-local:
Patterns * Patterns *
Patterns !INBOX Patterns !INBOX
Patterns ![Gmail]* Patterns ![Gmail]*
Patterns !Archive
Patterns !Drafts Patterns !Drafts
Patterns !Sent Mail Patterns !Sent Mail
Patterns !Trash Patterns !Trash
Patterns !Spam # Patterns ![Imap]/Archive
Patterns !Starred
#+END_SRC #+END_SRC
#+BEGIN_SRC conf #+BEGIN_SRC conf
@ -661,6 +659,9 @@ bind generic,index,pager \Cy previous-line
bind pager k previous-line bind pager k previous-line
bind pager j next-line bind pager j next-line
# Display mode information
bind pager i display-toggle-weed
bind index <space> collapse-thread bind index <space> collapse-thread
bind index,pager K previous-entry bind index,pager K previous-entry
@ -886,28 +887,30 @@ macro index,pager S "<pipe-message>$HOME/.config/neomutt/bin/mutt-save-org-link.
:header-args+: :comments both :mkdirp yes :header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env python3" :header-args+: :shebang "#!/usr/bin/env python3"
:END: :END:
https://orgmode.org/manual/The-capture-protocol.html#The-capture-protocol
#+begin_src python #+begin_src python
import sys import sys
import email import email
from email import policy
import subprocess import subprocess
import urllib.parse import urllib.parse
# Parse the email from standard input # Parse the email from standard input
message_bytes = sys.stdin.buffer.read() message_bytes = sys.stdin.buffer.read()
message = email.message_from_bytes(message_bytes) message = email.message_from_bytes(message_bytes, policy=policy.default)
# Grab the relevant message headers # Grab the relevant message headers
message_id = urllib.parse.quote(message['message-id'].strip()[1:-1]) message_id = urllib.parse.quote(message['message-id'][1:-1])
subject = message['subject'].replace('[', '{').replace(']', '}').replace('\n', ' ') subject = message['subject']
subject = (subject[:75] + '..') if len(subject) > 75 else subject message_to = message['to']
# Ask emacsclient to save a link to the message # Ask emacsclient to save a link to the message
p = subprocess.Popen([ subprocess.Popen([
'emacsclient', 'emacsclient',
f'org-protocol://capture?template=pm&url={message_id}&title={subject}' f'org-protocol://capture?template=ps&url={message_id}&title={subject}&body={message_to}'
]) ])
p.wait()
#+end_src #+end_src
** Colors ** Colors
@ -1017,10 +1020,11 @@ set from = "dehaeze.thomas@gmail.com"
set sendmail = "~/.config/neomutt/bin/send_mail.sh gmail" set sendmail = "~/.config/neomutt/bin/send_mail.sh gmail"
# Other special folders. # Other special folders.
set mbox = "+gmail/Archive" set mbox = "+gmail/Archive" # Archive Box
unset record # Don't copy send message to Sent folder: Gmail does that for us
set postponed = "+gmail/Drafts" set postponed = "+gmail/Drafts"
unset record # Don't copy send message to Sent folder: Gmail does that for us
set signature = "~/.config/neomutt/accounts/gmail.signature" set signature = "~/.config/neomutt/accounts/gmail.signature"
macro index,pager d \ macro index,pager d \
@ -1412,8 +1416,12 @@ application/pdf; zathura %s &
audio/*; /usr/bin/xdg-open %s; copiousoutput audio/*; /usr/bin/xdg-open %s; copiousoutput
text/html; export DISPLAY=:0 && setsid qutebrowser %s; nametemplate=%s.html text/html; export DISPLAY=:0 && setsid qutebrowser %s; nametemplate=%s.html
text/html; lynx -width ${COLUMNS:-80} -dump %s; nametemplate=%s.html; copiousoutput; text/html; lynx -width ${COLUMNS:-80} -dump %s; nametemplate=%s.html; copiousoutput;
text/calendar; khal import --batch -a home %s && khal printics %s; copiousoutput; #+END_SRC
application/ics; khal import --batch -a home %s && khal printics %s; copiousoutput;
For calendar output, a personal =ics-add= script is used.
#+BEGIN_SRC conf
text/calendar; ics-add %s; copiousoutput;
application/ics; ics-add %s; copiousoutput;
#+END_SRC #+END_SRC
Libreoffice Libreoffice