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"
Near :gmail-local:Trash
Channel gmail-All
Far :gmail-remote:"[Gmail]/All Mail"
Channel gmail-Archive
Far :gmail-remote:"[Imap]/Archive"
Near :gmail-local:Archive
#+END_SRC
@ -75,12 +75,10 @@ Near :gmail-local:
Patterns *
Patterns !INBOX
Patterns ![Gmail]*
Patterns !Archive
Patterns !Drafts
Patterns !Sent Mail
Patterns !Trash
Patterns !Spam
Patterns !Starred
# Patterns ![Imap]/Archive
#+END_SRC
#+BEGIN_SRC conf
@ -661,6 +659,9 @@ bind generic,index,pager \Cy previous-line
bind pager k previous-line
bind pager j next-line
# Display mode information
bind pager i display-toggle-weed
bind index <space> collapse-thread
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+: :shebang "#!/usr/bin/env python3"
:END:
https://orgmode.org/manual/The-capture-protocol.html#The-capture-protocol
#+begin_src python
import sys
import email
from email import policy
import subprocess
import urllib.parse
# Parse the email from standard input
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
message_id = urllib.parse.quote(message['message-id'].strip()[1:-1])
subject = message['subject'].replace('[', '{').replace(']', '}').replace('\n', ' ')
subject = (subject[:75] + '..') if len(subject) > 75 else subject
message_id = urllib.parse.quote(message['message-id'][1:-1])
subject = message['subject']
message_to = message['to']
# Ask emacsclient to save a link to the message
p = subprocess.Popen([
subprocess.Popen([
'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
** Colors
@ -1017,10 +1020,11 @@ set from = "dehaeze.thomas@gmail.com"
set sendmail = "~/.config/neomutt/bin/send_mail.sh gmail"
# Other special folders.
set mbox = "+gmail/Archive"
unset record # Don't copy send message to Sent folder: Gmail does that for us
set mbox = "+gmail/Archive" # Archive Box
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"
macro index,pager d \
@ -1412,8 +1416,12 @@ application/pdf; zathura %s &
audio/*; /usr/bin/xdg-open %s; copiousoutput
text/html; export DISPLAY=:0 && setsid qutebrowser %s; nametemplate=%s.html
text/html; lynx -width ${COLUMNS:-80} -dump %s; nametemplate=%s.html; copiousoutput;
text/calendar; khal import --batch -a home %s && khal printics %s; copiousoutput;
application/ics; khal import --batch -a home %s && khal printics %s; copiousoutput;
#+END_SRC
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
Libreoffice