Update mail related configuration

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2018-11-23 23:10:37 +05:30
parent f885f6796f
commit babc2bb780
5 changed files with 52 additions and 47 deletions

32
mbsyncrc Normal file
View file

@ -0,0 +1,32 @@
IMAPAccount gmail
# Address to connect to
Host imap.gmail.com
User maitysanchayan@gmail.com
# To store the password in an encrypted file use PassCmd instead of Pass
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.sanchayan.gpg"
#
# Use SSL
SSLType IMAPS
# The following line should work. If get certificate errors, uncomment the two following lines and read the "Troubleshooting" section.
CertificateFile /etc/ssl/certs/ca-certificates.crt
IMAPStore gmail-remote
Account gmail
MaildirStore gmail-local
Subfolders Verbatim
# The trailing "/" is important
Path ~/Gmail/
Inbox ~/Gmail/Inbox
Channel gmail
Master :gmail-remote:
Slave :gmail-local:
# Exclude everything under the internal [Gmail] folder, except the interesting folders
Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail"
# Or include everything
#Patterns *
# Automatically create missing mailboxes, both locally and on the server
Create Both
# Save the synchronization state files in the relevant directory
SyncState *

View file

@ -1,15 +1,15 @@
set from = "maitysanchayan@gmail.com"
set sendmail = "/usr/bin/msmtp -a Sanchayan"
set mbox = "+Sanchayan/Archive"
set postponed = "+Sanchayan/Drafts"
set record = "+Sanchayan/Sent"
set mbox = "+Archive"
set postponed = "+drafts"
set record = "+Sent"
color status green default
macro index D \
"<save-message>+Sanchayan/Trash<enter>" \
"<save-message>+Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+Sanchayan/Spam<enter>" \
"<save-message>+Spam<enter>" \
"mark message as spam"

View file

@ -1,25 +1,14 @@
#!/bin/bash
export DISPLAY=:0
imapfilter
offlineimap -o -u quiet
imapfilter -c /home/sanchayan/.imapfilter/config.lua
mbsync -Va
notmuch new
let toradex_mail_count=`ls /home/sanchayan/Mail/Toradex/INBOX/new/|wc -l`
let stefan_mail_count=`ls /home/sanchayan/Mail/Sanchayan/Stefan/new/|wc -l`
let sanchayan_linux=`ls /home/sanchayan/Mail/Sanchayan/Linux\ Kernel/new/|wc -l`
export DISPLAY=:0
let inbox=`ls /home/sanchayan/Mail/Inbox/new/|wc -l`
if (("$toradex_mail_count" > 0)); then
if (("$inbox" > 0)); then
sudo -u sanchayan DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have
$toradex_mail_count new mails in Toradex"
$inbox new mails in Inbox"
fi
if (("$stefan_mail_count" > 0)); then
sudo -u sanchayan DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have
$stefan_mail_count new mails in Stefan inbox"
fi
if (("$sanchayan_linux" > 0)); then
sudo -u sanchayan DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have
$sanchayan_linux new mails in Linux Kernel inbox"
fi

View file

@ -1,12 +1,11 @@
set mbox_type = Maildir
set spoolfile = "+Sanchayan/INBOX"
set spoolfile = "+Inbox"
source ~/.mutt/accounts/sanchayan
folder-hook Sanchayan/* source ~/.mutt/accounts/sanchayan
folder-hook Victor/* source ~/.mutt/accounts/victor
folder-hook Toradex/* source ~/.mutt/accounts/toradex
#folder-hook Victor/* source ~/.mutt/accounts/victor
set mail_check = 0
set envelope_from
@ -48,7 +47,7 @@ macro index 'c' '<change-folder>?<change-dir><home>^K=<enter>'
set send_charset="us-ascii:utf-8"
set send_charset="utf-8"
set editor="emacsclient -t"
set editor="nvim"
set date_format="%y-%m-%d %T"
set index_format="%2C | %Z [%d] %-30.30F (%-4.4c) %s"
@ -74,7 +73,7 @@ macro index L "<enter-command>unset wait_key<enter><shell-escape>read -p 'notmuc
# 'a' shows all messages again (supersedes default <alias> binding)
macro index a "<limit>all\n" "show all messages (undo limit)"
set header_cache=~/Mail/mutt_cache/ # a much faster opening of mailboxes...
set header_cache=~/Gmail/mutt_cache/ # a much faster opening of mailboxes...
macro index D "<save-message>+/ACCOUNT/[Gmail].Trash<enter>" "Move message to the trash"
macro index D "<save-message>+/Trash<enter>" "Move message to the trash"

View file

@ -1,6 +1,6 @@
[general]
ui = ttyui
accounts = Sanchayan,Victor,Toradex
accounts = Sanchayan,Victor
fsync = false
pythonfile = ~/.offlineimap.py
@ -14,10 +14,6 @@ localrepository = Victor-Local
remoterepository = Victor-Remote
postsynchook =- notmuch new
[Account Toradex]
localrepository = Toradex-Local
remoterepository = Toradex-Remote
[Repository Sanchayan-Local]
type = Maildir
localfolders = ~/Mail/Sanchayan
@ -26,15 +22,12 @@ localfolders = ~/Mail/Sanchayan
type = Maildir
localfolders = ~/Mail/Victor
[Repository Toradex-Local]
type = Maildir
localfolders = ~/Mail/Toradex
[Repository Sanchayan-Remote]
type = Gmail
remoteuser = maitysanchayan@gmail.com
remotepasseval = mailpasswd("sanchayan")
realdelete = yes
ssl_versions = tls1_2
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail','[Gmail]/Trash']
@ -43,16 +36,8 @@ type = Gmail
remoteuser = victorascroft@gmail.com
remotepasseval = mailpasswd("victor")
realdelete = yes
ssl_versions = tls1_2
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail', '[Gmail]/Trash']
[Repository Toradex-Remote]
type = IMAP
remotehost = outlook.office365.com
remoteuser = sanchayan.maity@toradex.com
remotepasseval = mailpasswd("toradex")
realdelete = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
folderfilter = lambda folder: folder in ['INBOX', 'Sent']
postsynchook = notmuch new