From c2b27d2f431953df000b25617ad50ca3231a59f5 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Tue, 3 Oct 2023 14:21:41 +0200 Subject: [PATCH] Move --email to init --- bundle/bundle--email.el | 96 ------------------------------------ bundle/bundle--package.el | 1 - init.el | 100 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 97 deletions(-) delete mode 100644 bundle/bundle--email.el diff --git a/bundle/bundle--email.el b/bundle/bundle--email.el deleted file mode 100644 index e84870c8..00000000 --- a/bundle/bundle--email.el +++ /dev/null @@ -1,96 +0,0 @@ -(setq smtpmail-smtp-server "smtp.mailbox.org" - smtpmail-smtp-service 465 - smtpmail-stream-type 'ssl - smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg") - mml-default-sign-method "pgpmime" - mml-default-encrypt-method "pgpmime" - mail-user-agent 'message-user-agent - message-directory "~/Maildir" - message-auto-save-directory "~/Maildir/Drafts" - message-send-mail-function 'smtpmail-send-it - compose-mail-user-agent-warnings nil) - -;; (setq mml-secure-openpgp-signers '("86DB0F30F9F1661A54E21664C374817BE285268F")) -;; (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime) - -(defun mk/sign-email () - ;; Sign an Email using the key of the sender. - (interactive) - (setq mml-secure-openpgp-sign-with-sender t) - (mml-secure-message-sign-pgpmime)) - -(defun mk/encrypt-email () - ;; Encrypt an Email using the key of the recipient. - (interactive) - (mml-secure-message-encrypt-pgpmime)) - -(defvar mk/gps-location - (eval '(let ((float-output-format "%.1f")) - (format "%s%s, %s%s" - (if (numberp calendar-latitude) - (abs calendar-latitude) - (+ (aref calendar-latitude 0) - (/ (aref calendar-latitude 1) 60.0))) - (if (numberp calendar-latitude) - (if (> calendar-latitude 0) "N" "S") - (if (eq (aref calendar-latitude 2) 'north) "N" "S")) - (if (numberp calendar-longitude) - (abs calendar-longitude) - (+ (aref calendar-longitude 0) - (/ (aref calendar-longitude 1) 60.0))) - (if (numberp calendar-longitude) - (if (> calendar-longitude 0) "E" "W") - (if (eq (aref calendar-longitude 2) 'east) "E" "W")))))) - -(defvar mk/signature-name - (concat "Cheers, " user-full-name " (" calendar-location-name ", " mk/gps-location ")\n")) - -(defvar mk/signature-gpg "GnuPG Key: https://meta.sr.ht/~marcuskammer.pgp\nFingerprint: 86DB 0F30 F9F1 661A 54E2 1664 C374 817B E285 268F") - -(defun mk/signature-time () - (format-time-string "Written on: %a, %d %b %Y %R %z\n")) - -(defun mk/signature () - (concat mk/signature-name (mk/signature-time) mk/signature-gpg)) - -(use-package message - :ensure nil - :hook (message-signature-setup . (lambda () (setf message-signature (mk/signature))))) - -(add-hook 'mail-send-hook #'ispell-message) -(add-hook 'message-send-hook #'ispell-message) - -(when (eq system-type 'gnu/linux) - (use-package mu4e - :ensure nil - :hook (mu4e-compose-pre . (lambda () (setf mu4e-compose-signature (mk/signature)))) - :custom - (mu4e-change-filenames-when-moving t) - (mu4e-drafts-folder "/Drafts") - (mu4e-get-mail-command "mbsync -a") - (mu4e-headers-date-format "%Y-%m-%d %H:%M") - (mu4e-refile-folder "/Archive") - (mu4e-sent-folder "/Sent") - (mu4e-trash-folder "/Trash") - (mu4e-split-view 'horizontal) - (mu4e-update-interval (* 10 60)))) - -(use-package gnus - :ensure nil - :hook (gnus-summary-prepare . gnus-summary-sort-by-most-recent-date) - :custom - (gnus-inhibit-startup-message t) - (gnus-check-new-newsgroups nil) - (gnus-select-method '(nnnil "")) - :config - (setq gnus-secondary-select-methods - '((nntp "news.individual.de" - (nntp-open-connection-function nntp-open-ssl-stream) - (nntp-port-number 563) - (nntp-authinfo-file "~/.authinfo.gpg")) - (nnimap "mailbox" - (nnimap-address "imap.mailbox.org") - (nnimap-inbox "INBOX") - (nnimap-server-port 993) - (nnimap-stream ssl) - (nnimap-authinfo-file "~/.authinfo.gpg"))))) diff --git a/bundle/bundle--package.el b/bundle/bundle--package.el index 40856b3c..67682580 100644 --- a/bundle/bundle--package.el +++ b/bundle/bundle--package.el @@ -573,4 +573,3 @@ (load "bundle--irc") (load "bundle--news") -(load "bundle--email") diff --git a/init.el b/init.el index 4e871326..9540dcb7 100755 --- a/init.el +++ b/init.el @@ -231,6 +231,106 @@ Uses `mk/hyperspec-dir-locations' to find the directory." ;;; (load "bundle--package") + +;;; bundle--email +(setq smtpmail-smtp-server "smtp.mailbox.org" + smtpmail-smtp-service 465 + smtpmail-stream-type 'ssl + smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg") + mml-default-sign-method "pgpmime" + mml-default-encrypt-method "pgpmime" + mail-user-agent 'message-user-agent + message-directory "~/Maildir" + message-auto-save-directory "~/Maildir/Drafts" + message-send-mail-function 'smtpmail-send-it + compose-mail-user-agent-warnings nil) + +;; (setq mml-secure-openpgp-signers '("86DB0F30F9F1661A54E21664C374817BE285268F")) +;; (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime) + +(defun mk/sign-email () + ;; Sign an Email using the key of the sender. + (interactive) + (setq mml-secure-openpgp-sign-with-sender t) + (mml-secure-message-sign-pgpmime)) + +(defun mk/encrypt-email () + ;; Encrypt an Email using the key of the recipient. + (interactive) + (mml-secure-message-encrypt-pgpmime)) + +(defvar mk/gps-location + (eval '(let ((float-output-format "%.1f")) + (format "%s%s, %s%s" + (if (numberp calendar-latitude) + (abs calendar-latitude) + (+ (aref calendar-latitude 0) + (/ (aref calendar-latitude 1) 60.0))) + (if (numberp calendar-latitude) + (if (> calendar-latitude 0) "N" "S") + (if (eq (aref calendar-latitude 2) 'north) "N" "S")) + (if (numberp calendar-longitude) + (abs calendar-longitude) + (+ (aref calendar-longitude 0) + (/ (aref calendar-longitude 1) 60.0))) + (if (numberp calendar-longitude) + (if (> calendar-longitude 0) "E" "W") + (if (eq (aref calendar-longitude 2) 'east) "E" "W")))))) + +(defvar mk/signature-name + (concat "Cheers, " user-full-name " (" calendar-location-name ", " mk/gps-location ")\n")) + +(defvar mk/signature-gpg "GnuPG Key: https://meta.sr.ht/~marcuskammer.pgp\nFingerprint: 86DB 0F30 F9F1 661A 54E2 1664 C374 817B E285 268F") + +(defun mk/signature-time () + (format-time-string "Written on: %a, %d %b %Y %R %z\n")) + +(defun mk/signature () + (concat mk/signature-name (mk/signature-time) mk/signature-gpg)) + +(use-package message + :ensure nil + :hook (message-signature-setup . (lambda () (setf message-signature (mk/signature))))) + +(add-hook 'mail-send-hook #'ispell-message) +(add-hook 'message-send-hook #'ispell-message) + +(when (eq system-type 'gnu/linux) + (use-package mu4e + :ensure nil + :hook (mu4e-compose-pre . (lambda () (setf mu4e-compose-signature (mk/signature)))) + :custom + (mu4e-change-filenames-when-moving t) + (mu4e-drafts-folder "/Drafts") + (mu4e-get-mail-command "mbsync -a") + (mu4e-headers-date-format "%Y-%m-%d %H:%M") + (mu4e-refile-folder "/Archive") + (mu4e-sent-folder "/Sent") + (mu4e-trash-folder "/Trash") + (mu4e-split-view 'horizontal) + (mu4e-update-interval (* 10 60)))) + +(use-package gnus + :ensure nil + :hook (gnus-summary-prepare . gnus-summary-sort-by-most-recent-date) + :custom + (gnus-inhibit-startup-message t) + (gnus-check-new-newsgroups nil) + (gnus-select-method '(nnnil "")) + :config + (setq gnus-secondary-select-methods + '((nntp "news.individual.de" + (nntp-open-connection-function nntp-open-ssl-stream) + (nntp-port-number 563) + (nntp-authinfo-file "~/.authinfo.gpg")) + (nnimap "mailbox" + (nnimap-address "imap.mailbox.org") + (nnimap-inbox "INBOX") + (nnimap-server-port 993) + (nnimap-stream ssl) + (nnimap-authinfo-file "~/.authinfo.gpg"))))) +;;; + (load "bundle--org") (load "bundle--ux")