From: Jean Louis <bugs@gnu.support>
To: gfp <gfp@posteo.at>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: E-mail package
Date: Sat, 7 Dec 2024 01:11:02 +0300 [thread overview]
Message-ID: <Z1N2dpjUVvADn8ib@lco2> (raw)
In-Reply-To: <b16c7b81-1dce-4096-87b7-e940f610a655@posteo.at>
* gfp <gfp@posteo.at> [2024-10-19 17:17]:
> Hi GNU Emacs,
>
> 1. I need a graphical overview of folders in my E-mail package
> in order to find messages.
>
> In Emacs:
> Mu4e,
> Mutt (no pop, imap),
> Gnus
> in all of them there are no folders available.
>
> Are there possibilities to create folders?
>
>
> 2.
> I got to know that Thunderbird spies on us and collects data.
>
> 2.
> which graphical E-mail package do you use, if any?
> What would you suggest?
>
> 3.
>
> Evolution,
> Geary (no pgp)
> KMail,
> Kontakt - (KDE) probably works only on a KDE Plasma desktop I guess
> Claws Mail freezes said somebody
The decades long strategy I follow is that for each email of
correspondent, such as user@example.com my software generates
automatically folder in ~/Maildir such as ~/Maildir/user@example.com
which contains all the correspondence between any of my emails and the
correspondent.
- I am using Maildir mail box type for reasons explained here:
cr.yp.to/proto/maildir.html:
http://cr.yp.to/proto/maildir.html
- All correspondence related to particular email address go to
specific Maildir for that address, like ~/Maildir/user@example.com
- If I am using any other E-mail software, that maybe saves e-mails
into single file, then I use GNU Mailutils program `sieve' and sort
all the e-mails to their corresponding Maildir folders such as
~/Maildir/user@example.com
- Listing Maildir folders is possible within Emacs as well with
maildir.el package and `mu' for Emacs
- Making list of folders may be done this way:
(defun mutt-emails-of-email (email)
"Opens XTerm with mutt showing conversations related to EMAIL."
(let* ((maildir (format (concat (file-name-as-directory
(getenv "MAILDIR"))
"%s")
email)))
(start-process "Mutt" "Mutt" "xterm" "-e" "mutt" "-f" maildir)))
Then this function generates Org file with 1000 folders maximum, it is made for demonstration:
(defun my-maildirs ()
"List maildir folders in Org mode ready to launch."
(interactive)
(catch 'no-maildir-found
(let ((maildir (getenv "MAILDIR")))
(unless (and maildir
(file-directory-p maildir))
(throw 'no-maildir-found "I did not find $MAILDIR environment."))
(let ((maildir-files (seq-take (directory-files maildir t "@") 1000))
(meta-buffer "my-maildirs.org"))
(with-temp-buffer-window meta-buffer nil nil
(switch-to-buffer meta-buffer)
(org-mode)
(keymap-local-set "<RET>" 'org-open-at-point)
(keymap-local-set "q" 'quit-window)
(insert "#+TITLE: My Maildir folders\n\n")
(insert "* My Maildirs\n\n")
(while maildir-files
(let ((file (pop maildir-files)))
(insert (format "- [[elisp:(mutt-emails-of-email \"%s\")][%s]]\n"
(file-name-nondirectory file)
(file-name-nondirectory file))))))))))
It works very good on my side.
By using similar approach, one can fire any other e-mail comptaible
software on the Maildir folder to see what is inside or to read and
send emails.
Folders are available in each of software you mentioned.
For Mutt, here is settings:
# Save by email address
set save_name=yes
set save_address=yes
set folder=/home/data1/protected/Maildir
set mbox_type=Maildir
set record="+Sent"
So basically one needs settings to ensure that email sent to user is saved into ~/Maildir/user@example.com
or sieve to move emails from one folder to system folders.
Here is sieve script:
require [ "fileinto", "variables" ];
if address :matches [ "from" ] "*" {
set "recipient" :lower "${1}";
fileinto "~/Maildir/${recipient}";
}
and it is run on mbox type like:
sieve -v --dry-run -f MBOX-FILE name-of-sieve-script
where you remove dry run, and replace MBOX-FILE with actual file and
sieve script with the name of actual script.
How to create Maildir:
$ maildirmake Maildir/my@folder.com
You can call folders as you wish.
I do not use graphical email, but when I use, then Geary for sending
or Thunderbird. But then I sort Sent emails into Maildir folders.
Emacs is enough graphica
How to open Maildir in Emacs?l
------------------------------
(defun rcd-maildir-open (email)
"Opens maildir for email address"
(let ((maildir (concat (file-name-as-directory (getenv "MAILDIR")) email)))
(maildir-list maildir)))
We must understand that above will open Maildir as EMAIL address as specified in the $MAILDIR main directory.
And maildir.el library is here:
https://github.com/nicferrier/emacs-maildir
That means function could be rewritten to show folders in Org mode:
(defun my-maildirs ()
"List maildir folders in Org mode ready to launch."
(interactive)
(catch 'no-maildir-found
(let ((maildir (getenv "MAILDIR")))
(unless (and maildir
(file-directory-p maildir))
(throw 'no-maildir-found "I did not find $MAILDIR environment."))
(let ((maildir-files (seq-take (directory-files maildir t "@") 1000))
(meta-buffer "my-maildirs.org"))
(with-temp-buffer-window meta-buffer nil nil
(switch-to-buffer meta-buffer)
(org-mode)
(keymap-local-set "<RET>" 'org-open-at-point)
(keymap-local-set "q" 'quit-window)
(insert "#+TITLE: My Maildir folders\n\n")
(insert "* My Maildirs\n\n")
(while maildir-files
(let ((file (pop maildir-files)))
(insert (format "- [[elisp:(rcd-maildir-open \"%s\")][%s]]\n"
(file-name-nondirectory file)
(file-name-nondirectory file))))))))))
Then it works pretty much in Emacs, user can run function and get list
of all emails, search for particular email and by click open all
conversation related to that email. But maildir.el is not complete, so
deleting emails is not option, that is I use Mutt.
--
Jean Louis
next prev parent reply other threads:[~2024-12-06 22:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 14:15 E-mail package gfp
2024-10-19 15:21 ` Jude DaShiell
2024-10-20 3:19 ` W. Greenhouse
2024-10-21 8:47 ` Eric S Fraga
2024-12-06 22:11 ` Jean Louis [this message]
2024-12-21 11:50 ` Joel Reicher
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z1N2dpjUVvADn8ib@lco2 \
--to=bugs@gnu.support \
--cc=gfp@posteo.at \
--cc=help-gnu-emacs@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 read-only IMAP folder(s) and NNTP newsgroup(s).