diff --git a/mbsyncrc b/mbsyncrc new file mode 100644 index 0000000..59b8d47 --- /dev/null +++ b/mbsyncrc @@ -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 * diff --git a/mutt/accounts/sanchayan b/mutt/accounts/sanchayan index 0f9ca77..8612537 100644 --- a/mutt/accounts/sanchayan +++ b/mutt/accounts/sanchayan @@ -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 \ - "+Sanchayan/Trash" \ + "+Trash" \ "move message to the trash" macro index S \ - "+Sanchayan/Spam" \ + "+Spam" \ "mark message as spam" diff --git a/mutt/mailnotify.sh b/mutt/mailnotify.sh index 4924895..874ebca 100755 --- a/mutt/mailnotify.sh +++ b/mutt/mailnotify.sh @@ -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 - 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" +if (("$inbox" > 0)); then + sudo -u sanchayan DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "You have +$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 diff --git a/mutt/muttrc b/mutt/muttrc index 3e1fdfd..eaeb890 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -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' '?^K=' 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 "unset wait_keyread -p 'notmuc # 'a' shows all messages again (supersedes default binding) macro index a "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 "+/ACCOUNT/[Gmail].Trash" "Move message to the trash" +macro index D "+/Trash" "Move message to the trash" diff --git a/offlineimaprc b/offlineimaprc index 8c6890e..06ca1ef 100644 --- a/offlineimaprc +++ b/offlineimaprc @@ -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