Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: jindam.vani@disroot.org
To: info-gnus-english@gnu.org
Subject: [v 1.0] disroot email pop3 gnus configuration on debian gnu/linux
Date: Sun, 11 Dec 2022 15:24:51 +0000	[thread overview]
Message-ID: <ygf7cyyyncs.fsf@jindam> (raw)

* i am running debian 11 (bullseye) [1] on userland [2]

** prerequisites:

* emacs [3] an email client
* getmail6 [4] to rerieve emails
* msmtp [5] to send emails
* defaultencrypt [6] to encrypted emails
* gnupg/gpg [7] to create gnupg/gpg key for 
encryption or decryption


** you must

* provide password of your disroot email id 
and disroot email id and password when you 
retrieve emails and send emails

* update to and from email address when 
composing email

* replace 46BB3F32 with your gnupg/gpg encryption 
key id in .emacs file

* create backup of important emails

** you cannot

* send encrypted email if there is no gnupg/gpg key 
available for recipient

* view or read encrypted emails if you forgot your 
gnupg/gpg key password

* if you permentately delete emails in gnus, you 
cannot recover emails from email isp

** how to install prerequisites on debian [8] and 
its derivatives [9]
;; security is first priority, i included 
;; sudo apt update && sudo apt full-upgrade
* $ sudo apt update && sudo apt full-upgrade && sudo apt install emacs-lucid
 or 
  $ sudo apt update && sudo apt full-upgrade && sudo apt install emacs-gtk
* $ sudo apt update && sudo apt full-upgrade && sudo apt install getmail6
* $ sudo apt update && sudo apt full-upgrade && sudo apt install msmtp
* $ sudo apt update && sudo apt full-upgrade && sudo apt install gnupg

** .emacs

;; whereis .emacs
$ ~/.emacs

(setq make-backup-files nil)
(setq create-lockfiles nil)
(setq auto-save-default nil)
(setq frame-title-format "%b")
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(debug-on-error t)
 '(display-battery-mode nil)
 '(initial-buffer-choice "~/")
 '(send-mail-function 'mailclient-send-it)
 '(smtpmail-smtp-server "disroot.org")
 '(smtpmail-smtp-service 25))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "fixed" :foundry "misc" :slant normal :weight normal :height 231 :width normal)))))
(add-to-list 'load-path "~/.emacs.d/jl-encrypt")
(require 'jl-encrypt)
(require 'epa-file)
(setq epa-file-encrypt-to "46BB3F32")

** getmailrc

;; first we need to create getmail directory for 
;; getmailrc:
 $ mkdir -m 0700 $HOME/.getmail [10]

;; create Maildir & INBOX directories to download 
;; emails
 $ mkdir ~/.Maildir
 $ mkdir ~/.Maildir/INBOX/

;; whereis getmailrc
$ ~/.getmail/getmailrc

*** .getmailrc

;; getmailrc configuration

[options]
delete = True
read_all = true

;; replace email id with your disroot email id
[retriever]
type = SimplePOP3SSLRetriever
server = disroot.org
username = email id

[destination]
type = Maildir
path = ~/.Maildir/INBOX/

** .msmtprc

;; whereis .msmtprc
$ ~/.msmtprc

;; create your own .msmtprc [11] with:
$ msmtp --configure yourmail@example.com
;; note replace yourmail@example.com with 
your disroot email id.....

;; or manually create .msmtprc
;; replace user1 with your username
;; replace email id with your disroot email id
# - copy this to your configuration file /home/jin/.msmtprc
# - add your password to the key ring:
#   secret-tool store --label=msmtp host disroot.org service smtp
 user jindam.vani
account jindam.vani@disroot.org
host disroot.org
port 587
tls on
tls_starttls on
auth on
user user1
from email id

** defaultencrypt installation:

;; download jl-encrypt.el from defaultencrypt 
repo [12]

;; create jl-encrypt directory in .emacs.d
 $ mkdir ~/.emacs.d/jl-encrypt

;; copy downloaded jl-encrypt.el into jl-encrypt 
directory

;; specify directory location of jl-encrypt in .emacs
(add-to-list 'load-path "~/.emacs.d/jl-encrypt")

;; add jl-encrypt in .emacs
(require 'jl-encrypt)

** .gnus

;; whereis .gnus
$ ~/.gnus

;; for more information and context, refer to 
;; corresponding section given at top of commands 
;; in gnus manual
;; view or download gnus manual: https://www.gnus.org/manual.html

;; create empty backend, 6.6.5 the empty backend
(setq gnus-select-method '(nnnil ""))

;; specify mail back end, 6.4.2 getting started
;; reading mail
(add-to-list 'gnus-secondary-select-methods
             '(nnmaildir ""
              (directory "~/.Maildir/")
              (get-new-mail t)
              (directory-files nnheader-directory-files-safe)))

;; shows gnus version when you send an email
;; for example, it adds "User-Agent: Gnus/5.13 (Gnus v5.13) 
;; Emacs/27.1 (gnu/linux)" when you compose email
;; 5.4 mail and post
(setq mail-user-agent 'gnus-user-agent)

;; specifies to use gnus as preferred mail client
;; see https://www.emacswiki.org/emacs/GettingMail#h5o-7
(setq read-mail-command 'gnus)

;; specified pop3 as mail source, 6.4.4 mail sources
;; replace email id with your disroot email id
(setq mail-sources
                  '((pop :server "disroot.org"
                         :user "email id")))

;; to send email through smtp server, question: 3.8
(setq send-mail-function 'smtpmail-send-it)
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-default-smtp-server "disroot.org")

;; to specify ssl, tls, starttls
;; see https://www.gnu.org/software/emacs/manual/html_mono/smtpmail.html#Emacs-Speaks-SMTP
(setq smtpmail-stream-type 'ssl)

;; specify authentication
;; more info: https://www.gnu.org/software/emacs/manual/html_mono/smtpmail.html#Encryption
(setq smtpmail-servers-requiring-authorization ".*")

;; specify smtp service port
;; see https://www.josefsson.org/smtpmail.html#Authentication
(setq smtpmail-smtp-service 465)

;; connect smtp using starttls
;; see https://www.josefsson.org/smtpmail.html#Authentication
(setq smtpmail-starttls-credentials '(("disroot.org" 465 nil nil)))

** how to retrieve or download emails using getmail6

;; provide your email id for password prompt
$ getmail

** external links:
[1] https://en.wikipedia.org/wiki/Debian_version_history#Debian_11_(Bullseye)
[2] https://github.com/CypherpunkArmory/UserLAnd
[3] https://en.wikipedia.org/wiki/Emacs
[4] https://en.wikipedia.org/wiki/Getmail
[5] https://en.wikipedia.org/wiki/Msmtp
[6] https://gitlab.com/lechten/defaultencrypt
[7] https://en.wikipedia.org/wiki/GNU_Privacy_Guard
[8] https://en.wikipedia.org/wiki/Debian
[9] https://en.wikipedia.org/wiki/List_of_Linux_distributions#Debian-based
[10] https://getmail6.org/configuration.html#configuring
[11] https://marlam.de/msmtp/msmtprc.txt
[12] https://gitlab.com/lechten/defaultencrypt/-/raw/master/jl-encrypt.el?inline=false

regards,
jindam, vani


                 reply	other threads:[~2022-12-11 15:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ygf7cyyyncs.fsf@jindam \
    --to=jindam.vani@disroot.org \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).