home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

config-mails.el (2597B)


      1 ;;; config-mails.el --- -*- lexical-binding: t -*-
      2 ;;; Commentary:
      3 ;;; Mails configuration
      4 ;;; Code:
      5 
      6 (use-package simple
      7   :custom (read-mail-command #'gnus))
      8 
      9 (use-package auth-source
     10   :config
     11   (setq auth-sources '("~/.authinfo.gpg" "~/.authinfo"))
     12   (setq user-full-name "Vincent Demeester")
     13   (setq user-mail-address "vincent@sbr.pm"))
     14 
     15 (use-package epa-file
     16   :config
     17   (setq epa-file-cache-passphrase-for-symmetric-encryption t)
     18   :init
     19   (epa-file-enable))
     20 
     21 (setq gnus-init-file (expand-file-name "~/.config/gnus/init.el"))
     22 
     23 (use-package smtpmail
     24   ;;:commands (mail-mode mail-text)
     25   :config
     26   (setq message-send-mail-function 'message-send-mail-with-sendmail)
     27   (setq sendmail-program "msmtp")
     28   (setq message-sendmail-f-is-evil 't)
     29   (setq message-sendmail-extra-arguments '("--read-envelope-from")))
     30 
     31 (use-package sendmail
     32   ;;:commands (mail-mode mail-text)
     33   :defines (send-mail-function)
     34   :config
     35   (setq-default send-mail-function 'sendmail-send-it
     36                 sendmail-program "/home/vincent/bin/msmtp"))
     37 
     38 (use-package message
     39   :commands (message-mode message-cite-original-without-signature)
     40   :hook ((message-mode . my-message-hook))
     41   :config
     42   (setq mail-user-agent 'message-user-agent
     43         message-wide-reply-confirm-recipients t
     44         message-default-charset 'utf-8
     45         message-default-mail-headers "Cc: \nBcc: \n"
     46         message-kill-buffer-on-exit t
     47         message-generate-headers-first t)
     48   (add-to-list 'mm-body-charset-encoding-alist '(utf-8 . base64))
     49 
     50   (defun my-message-hook ()
     51     "Message mode hook."
     52     (turn-on-auto-fill)
     53     (set (make-local-variable 'company-backends)
     54          '(company-emoji company-capf company-files company-dabbrev))
     55     (company-mode 1)))
     56 
     57 (if *sys/full*
     58     (progn
     59       (setenv "NOTMUCH_CONFIG" (expand-file-name ".config/notmuch/notmuchrc" (getenv "HOME")))
     60       (use-package notmuch
     61         :disabled
     62         :defer t
     63         :bind ("<f6>" . notmuch)
     64         :config
     65         (setq notmuch-search-oldest-first nil
     66               mail-user-agent 'message-user-agent
     67               notmuch-tree-show-out t)
     68         (setq notmuch-saved-searches
     69               '((:key "i" :name "inbox" :query "tag:Inbox")
     70                 (:key "r" :name "redhat inbox folder" :query "folder:redhat/Inbox")
     71                 (:key "p" :name "perso inbox folder" :query "folder:perso/Inbox")
     72                 (:key "u" :name "unread" :query "tag:unread")
     73                 (:key "F" :name "flagged" :query "tag:flagged")
     74                 (:key "S" :name "sent" :query "tag:Sent Mail"))))))
     75 
     76 (provide 'config-mails)
     77 ;;; config-mails ends here