WEBVTT captioned by sachac

NOTE Introduction

00:00:02.620 --> 00:00:04.799
Hello, my name is Amin Bandali,

00:00:04.800 --> 00:00:06.359
and today I'd like to talk about

00:00:06.360 --> 00:00:08.799
reading and writing emails in GNU Emacs

00:00:08.800 --> 00:00:14.319
using Gnus specifically.

00:00:14.320 --> 00:00:16.879
Gnus has had this sort of reputation

00:00:16.880 --> 00:00:20.599
of being difficult to approach and configure.

00:00:20.600 --> 00:00:23.359
That's understandable

00:00:23.360 --> 00:00:26.319
because it has many, many options

00:00:26.320 --> 00:00:27.679
and major and minor modes

00:00:27.680 --> 00:00:30.679
that interact in different ways with each other.

00:00:30.680 --> 00:00:35.319
And it also doesn't help that Gnus started originally

00:00:35.320 --> 00:00:36.359
as a newsreader

00:00:36.360 --> 00:00:38.759
rather than a mail client.

00:00:38.760 --> 00:00:40.879
So a lot of the terminology that it uses

00:00:40.880 --> 00:00:42.519
is also rooted in that,

00:00:42.520 --> 00:00:45.559
in reading and writing news.

00:00:45.560 --> 00:00:48.119
But nevertheless, with this video and talk,

00:00:48.120 --> 00:00:52.159
I hope to provide a sort

00:00:52.160 --> 00:00:55.759
of very quick introduction

00:00:55.760 --> 00:00:57.539
of starting to use Gnus

00:00:57.540 --> 00:01:00.919
to read and write email and send it.

00:01:00.920 --> 00:01:02.679
We will use Gnus' IMAP support,

00:01:02.680 --> 00:01:06.119
mainly because a lot of people

00:01:06.120 --> 00:01:08.679
these days have email accounts

00:01:08.680 --> 00:01:10.759
with mail service providers

00:01:10.760 --> 00:01:12.039
that support IMAP,

00:01:12.040 --> 00:01:14.319
which is an open standard.

00:01:14.320 --> 00:01:17.479
So it's widely available and supported

00:01:17.480 --> 00:01:19.719
across many different providers

00:01:19.720 --> 00:01:25.239
as well as mail clients or mail user agents as well.

NOTE Demo

00:01:25.240 --> 00:01:30.559
Okay, so let's just jump straight right in.

00:01:30.560 --> 00:01:34.279
I will enter this demo directory that I created

00:01:34.280 --> 00:01:36.919
for the purposes of this demonstration

00:01:36.920 --> 00:01:40.999
and change my home directory to this one

00:01:41.000 --> 00:01:49.839
so that we can safely experiment with Gnus here.

00:01:49.840 --> 00:01:53.979
For this presentation, I've written up

00:01:53.980 --> 00:01:56.839
a quick initialization file or init file

00:01:56.840 --> 00:01:59.719
that I will share afterwards as well

00:01:59.720 --> 00:02:01.639
to get us going with Gnus.

00:02:01.640 --> 00:02:04.519
There's not much to it at the moment.

00:02:04.520 --> 00:02:07.399
Just set up the package archives and

00:02:07.400 --> 00:02:09.479
install the keycast package

00:02:09.480 --> 00:02:14.079
for showing the key presses in the mode line.

00:02:14.080 --> 00:02:15.359
Yeah, that's about it.

00:02:15.360 --> 00:02:16.239
And I'll also define

00:02:16.240 --> 00:02:20.279
a little like inline function +emacs.d

00:02:20.280 --> 00:02:24.079
that allows me to conveniently write

00:02:24.080 --> 00:02:26.639
and have it expanded

00:02:26.640 --> 00:02:29.300
or refer to files and directories, rather,

00:02:29.301 --> 00:02:30.900
paths that we could expand,

00:02:30.901 --> 00:02:32.833
inside my Emacs configuration directory.

00:02:32.834 --> 00:02:37.500
I also have this eval-last-sexp

00:02:37.501 --> 00:02:41.119
bound to a global key,

00:02:41.120 --> 00:02:43.279
so that I will be able to easily

00:02:43.280 --> 00:02:47.519
use it for this talk.

00:02:47.520 --> 00:02:49.959
Okay, let's jump right in.

NOTE Don't panic

00:02:49.960 --> 00:02:52.239
First things first, don't panic.

00:02:52.240 --> 00:02:55.267
And that's actually also the name

00:02:55.268 --> 00:02:58.359
of the very first node

00:02:58.360 --> 00:03:01.559
in the Gnus manual when you open it.

00:03:01.560 --> 00:03:02.839
And it's actually nice.

00:03:02.840 --> 00:03:04.479
I definitely, definitely recommend

00:03:04.480 --> 00:03:07.079
that you look through

00:03:07.080 --> 00:03:10.199
at least the very first couple of chapters of this,

00:03:10.200 --> 00:03:14.199
skim through it, and later on refer to it

00:03:14.200 --> 00:03:16.133
whenever you find something confusing

00:03:16.134 --> 00:03:19.499
or don't understand it.

00:03:19.500 --> 00:03:21.359
But yeah, we'll start

00:03:21.360 --> 00:03:22.399
with these two paragraphs here.

00:03:22.400 --> 00:03:23.639
So again, a Gnus installation

00:03:23.640 --> 00:03:28.119
is basically just a list of one or more servers

00:03:28.120 --> 00:03:30.119
and the subscribed groups from those servers

00:03:30.120 --> 00:03:32.319
and articles in those groups.

00:03:32.320 --> 00:03:34.279
You can already kind of see

00:03:34.280 --> 00:03:39.479
where that influence of a newsreader comes in.

00:03:39.480 --> 00:03:41.839
But yeah, basically what it's saying is that,

00:03:41.840 --> 00:03:43.839
you know, we have one or more servers.

00:03:43.840 --> 00:03:47.079
We can think of them as email servers.

00:03:47.080 --> 00:03:49.359
Groups can be like, we can think

00:03:49.360 --> 00:03:52.959
of them as folders or directories.

00:03:52.960 --> 00:03:55.239
And yeah, articles,

00:03:55.240 --> 00:03:58.559
those would be like our email messages.

NOTE Configuring servers

00:03:58.560 --> 00:03:59.679
With Gnus, we can add

00:03:59.680 --> 00:04:06.119
and configure servers mainly using two variables.

00:04:06.120 --> 00:04:07.919
One of them is the gnus-select-method

00:04:07.920 --> 00:04:11.479
and the other is gnus-secondary-select-methods.

00:04:11.480 --> 00:04:15.759
The first one predates the second one

00:04:15.760 --> 00:04:17.559
and I generally don't recommend using it, because

00:04:17.560 --> 00:04:22.559
first of all, it can only point

00:04:22.560 --> 00:04:26.359
to one server, and that server,

00:04:26.360 --> 00:04:27.879
because it's the primary,

00:04:27.880 --> 00:04:32.559
then Gnus won't add a prefix to its groups,

00:04:32.560 --> 00:04:34.839
so later on, as you get into

00:04:34.840 --> 00:04:36.679
more advanced features of Gnus

00:04:36.680 --> 00:04:38.519
and, for example, want to write rules

00:04:38.520 --> 00:04:42.959
to modify your message composition

00:04:42.960 --> 00:04:47.039
in a way for certain groups, or file mail,

00:04:47.040 --> 00:04:48.799
automatically classify mail,

00:04:48.800 --> 00:04:51.879
this distinction can become

00:04:51.880 --> 00:04:53.959
confusing and annoying.

00:04:53.960 --> 00:04:57.199
My recommendation is to always and only use

00:04:57.200 --> 00:05:01.799
the gnus-secondary-select-methods.

00:05:01.800 --> 00:05:07.319
Yeah, so let's do that here.

00:05:07.320 --> 00:05:10.299
I'm gonna uncomment this portion.

00:05:10.300 --> 00:05:16.419
So here, I set the primary select method to nil,

00:05:16.420 --> 00:05:24.159
and the second one, I define an nnimap server

00:05:24.160 --> 00:05:30.039
of the nnimap backend.

00:05:30.040 --> 00:05:32.439
I give it the name ec25gnus.

00:05:32.440 --> 00:05:35.879
What I want it to do is to

00:05:35.880 --> 00:05:37.799
connect to my mail server,

00:05:37.800 --> 00:05:41.079
which is at this address,

00:05:41.080 --> 00:05:46.239
and fetch emails from it over TLS with this username.

NOTE .authinfo

00:05:46.240 --> 00:05:50.719
And then the passwords or the credentials,

00:05:50.720 --> 00:05:56.839
you can put them in the .authinfo file.

00:05:56.840 --> 00:05:58.799
Normally, you would want to, for example,

00:05:58.800 --> 00:06:03.719
encrypt this file with your GPG key.

00:06:03.720 --> 00:06:06.719
But for this demonstration, I haven't.

00:06:06.720 --> 00:06:10.479
So yeah, the format is the keyword "machine"

00:06:10.480 --> 00:06:15.239
followed by the name of your Gnus server or account,

00:06:15.240 --> 00:06:17.199
followed by the word "login",

00:06:17.200 --> 00:06:19.199
then your login username,

00:06:19.200 --> 00:06:23.959
and then the password, which here it's not shown.

00:06:23.960 --> 00:06:26.599
Yeah.

NOTE Configuration

00:06:26.600 --> 00:06:28.679
But before we actually set this,

00:06:28.680 --> 00:06:31.479
I'll just show you that if we like start Gnus

00:06:31.480 --> 00:06:33.719
with M-x gnus,

00:06:33.720 --> 00:06:36.439
initially, it will just show

00:06:36.440 --> 00:06:37.759
an error like this.

00:06:37.760 --> 00:06:40.399
Even if we continue, it's empty.

00:06:40.400 --> 00:06:43.399
There's not much because Gnus doesn't know

00:06:43.400 --> 00:06:47.039
where to fetch these emails from.

00:06:47.040 --> 00:06:52.159
And that's what we will configure.

00:06:52.160 --> 00:06:55.859
Excuse me.

00:06:55.860 --> 00:06:57.559
Yeah, so just for convenience,

00:06:57.560 --> 00:06:59.079
we can bind Gnus to,

00:06:59.080 --> 00:07:00.679
for example, C-c g, as I've done here.

00:07:00.680 --> 00:07:04.119
You will want to set your name

00:07:04.120 --> 00:07:05.799
and email address, like so.

00:07:05.800 --> 00:07:09.239
Here we tell Emacs

00:07:09.240 --> 00:07:11.439
that we are going to be using Gnus for reading email,

00:07:11.440 --> 00:07:12.839
because Emacs comes

00:07:12.840 --> 00:07:14.759
with other email clients as well,

00:07:14.760 --> 00:07:18.559
such as Rmail, and in fact, defaults to Rmail,

00:07:18.560 --> 00:07:24.839
so this way, we tell it to use Gnus.

00:07:24.840 --> 00:07:31.559
By default, Gnus puts its newsrc file and other files,

00:07:31.560 --> 00:07:34.319
I believe it still scatters them

00:07:34.320 --> 00:07:35.439
in a few different directories

00:07:35.440 --> 00:07:36.279
in your home directory,

00:07:36.280 --> 00:07:37.399
so it's a little bit messy.

00:07:37.400 --> 00:07:40.039
So what I prefer to do is to just put it

00:07:40.040 --> 00:07:42.439
all under the Gnus directory

00:07:42.440 --> 00:07:47.439
inside of my Emacs configuration, as I do here.

00:07:47.440 --> 00:07:50.639
Yeah, and then here we just tell Gnus

00:07:50.640 --> 00:07:53.319
to, like, don't try to bother

00:07:53.320 --> 00:07:55.759
with a generic newsrc file

00:07:55.760 --> 00:07:57.119
that would be shared

00:07:57.120 --> 00:07:58.399
with other news readers.

00:07:58.400 --> 00:07:59.679
Just want to use it for email.

00:07:59.680 --> 00:08:01.959
And yeah, so we just tell Gnus

00:08:01.960 --> 00:08:03.039
to keep all of its data

00:08:03.040 --> 00:08:08.079
inside a dedicated .newsrc.eld

00:08:08.080 --> 00:08:12.159
(for Emacs Lisp data) file instead.

00:08:12.160 --> 00:08:15.199
And we can also have Gnus not prompt us

00:08:15.200 --> 00:08:19.679
when we want to exit with q.

00:08:19.680 --> 00:08:23.399
Anyway, so let's go ahead and evaluate this.

00:08:23.400 --> 00:08:25.719
So this has been set,

NOTE Starting Gnus

00:08:25.720 --> 00:08:32.267
so if we type M-x gnus again, or hit C-c g,

00:08:32.268 --> 00:08:35.699
now we're faced with an empty buffer,

00:08:35.700 --> 00:08:37.399
and it says no news is good news,

00:08:37.400 --> 00:08:38.399
and that's actually

00:08:38.400 --> 00:08:40.719
one of the characteristics of Gnus

00:08:40.720 --> 00:08:44.779
is that by default it tries

00:08:44.780 --> 00:08:47.619
to like sort of declutter

00:08:47.620 --> 00:08:49.199
and show us a little less possible

00:08:49.200 --> 00:08:50.819
in the group buffer,

00:08:50.820 --> 00:08:53.259
meaning that if you don't have

00:08:53.260 --> 00:08:55.639
any groups with unread or marked

00:08:55.640 --> 00:09:00.119
or, like, starred messages, it will not show them.

00:09:00.120 --> 00:09:03.959
To actually see all of our groups or folders,

00:09:03.960 --> 00:09:08.359
we hit shift L or capital L,

00:09:08.360 --> 00:09:12.419
and we see that we have an inbox here,

00:09:12.420 --> 00:09:14.879
as expected. So we enter the inbox,

00:09:14.880 --> 00:09:17.459
and we see that there is an article there

00:09:17.460 --> 00:09:20.779
and it's already been marked as read.

00:09:20.780 --> 00:09:22.679
But if we mark it as unread

00:09:22.680 --> 00:09:25.959
and exit and enter Gnus again,

00:09:25.960 --> 00:09:27.279
this is what we would see.

00:09:27.280 --> 00:09:28.839
We would see that our group

00:09:28.840 --> 00:09:34.099
and then we enter it, we see our mail here.

00:09:34.100 --> 00:09:36.159
Yeah, and this is our very first email

00:09:36.160 --> 00:09:40.079
that we read in GNU Emacs here, inside Gnus.

NOTE Always showing groups

00:09:40.080 --> 00:09:43.839
It might be useful to have Gnus always show

00:09:43.840 --> 00:09:46.839
certain groups or folders

00:09:46.840 --> 00:09:48.319
even if they don't have

00:09:48.320 --> 00:09:52.339
anything unread or marked inside of them.

00:09:52.340 --> 00:09:56.039
The way we can do that is

00:09:56.040 --> 00:09:57.599
by setting this variable

00:09:57.600 --> 00:10:01.339
gnus-permanently-visible-groups

00:10:01.340 --> 00:10:03.039
to a regular expression

00:10:03.040 --> 00:10:09.119
that describes the name of these groups.

00:10:09.120 --> 00:10:11.539
So if we launch Gnus again,

00:10:11.540 --> 00:10:14.759
this time, we see that that group is visible,

00:10:14.760 --> 00:10:19.899
even though there's no unread messages in it.

NOTE Reading messages

00:10:19.900 --> 00:10:24.399
When we enter a group or folder,

00:10:24.400 --> 00:10:26.719
we will see a list of all of our messages.

00:10:26.720 --> 00:10:27.799
Here, we only have one.

00:10:27.800 --> 00:10:31.939
We can press M-u or Alt-u

00:10:31.940 --> 00:10:34.679
to mark something as unread.

00:10:34.680 --> 00:10:38.539
You can press d to mark it as read.

00:10:38.540 --> 00:10:40.079
If you press just u,

00:10:40.080 --> 00:10:41.959
it'll tick the article,

00:10:41.960 --> 00:10:44.039
which is kind of the equivalent

00:10:44.040 --> 00:10:46.999
of marking the message or email

00:10:47.000 --> 00:10:50.539
as starred in other email clients

00:10:50.540 --> 00:10:55.719
such as Thunderbird.

00:10:55.720 --> 00:11:00.639
We see that when there are groups

00:11:00.640 --> 00:11:03.959
that have starred or ticked messages

00:11:03.960 --> 00:11:04.679
inside of them,

00:11:04.680 --> 00:11:05.599
Gnus will mark them

00:11:05.600 --> 00:11:16.019
with this little star here, or asterisk.

00:11:16.020 --> 00:11:17.639
This talk is just barely

00:11:17.640 --> 00:11:19.039
scratching the surface.

00:11:19.040 --> 00:11:21.080
Let's see how far...

00:11:21.081 --> 00:11:22.759
How am I doing with the time?

00:11:22.760 --> 00:11:30.119
Okay, 11 minutes already.

NOTE Debugging IMAP

00:11:30.120 --> 00:11:32.079
Just a couple of helpful things here,

00:11:32.080 --> 00:11:36.919
like this nnimap-record-commands variable.

00:11:36.920 --> 00:11:38.519
It's useful when you want to debug

00:11:38.520 --> 00:11:40.119
your IMAP setup with Gnus.

00:11:40.120 --> 00:11:42.859
If you set it to anything non-nil,

00:11:42.860 --> 00:11:46.699
it will log the commands that it runs

00:11:46.700 --> 00:11:49.539
to a special `*imap log*` buffer.

00:11:49.540 --> 00:11:50.719
And here I just set it

00:11:50.720 --> 00:11:52.679
to this init-file-debug variable,

00:11:52.680 --> 00:11:55.159
which is set to non-nil

00:11:55.160 --> 00:11:56.439
whenever you launch Emacs

00:11:56.440 --> 00:11:59.279
with the --debug-init switch,

00:11:59.280 --> 00:12:02.239
so that's pretty helpful.

00:12:02.240 --> 00:12:05.119
You want to also set your sent folder,

00:12:05.120 --> 00:12:07.479
basically, where Gnus will save

00:12:07.480 --> 00:12:09.439
a copy of the message that you just sent.

00:12:09.440 --> 00:12:12.799
Normally, I think the convention these days is,

00:12:12.800 --> 00:12:16.599
a lot of you know servers and clients

00:12:16.600 --> 00:12:18.799
use a dedicated sent folder,

00:12:18.800 --> 00:12:24.339
but with Gnus, I just prefer to use INBOX itself.

00:12:24.340 --> 00:12:27.119
Mainly because then I will have

00:12:27.120 --> 00:12:28.759
threading working for free,

00:12:28.760 --> 00:12:31.939
so I can read the entire thread

00:12:31.940 --> 00:12:34.299
of an email chain there in one place.

00:12:34.300 --> 00:12:35.319
Of course, we don't have to keep

00:12:35.320 --> 00:12:38.899
the messages in there forever.

00:12:38.900 --> 00:12:42.079
And in fact, Gnus has facilities,

00:12:42.080 --> 00:12:43.479
both manual and automated,

00:12:43.480 --> 00:12:45.999
for expiring emails into

00:12:46.000 --> 00:12:52.679
different locations or different folders.

00:12:52.680 --> 00:12:55.159
Yeah. So let's move on here.

NOTE Topics

00:12:55.160 --> 00:13:02.039
Topics are another nice feature of Gnus.

00:13:02.040 --> 00:13:03.279
So this is useful

00:13:03.280 --> 00:13:05.359
for creating some topics

00:13:05.360 --> 00:13:08.459
and then classifying or grouping

00:13:08.460 --> 00:13:10.599
your directories there.

00:13:10.600 --> 00:13:11.799
So we will see the use

00:13:11.800 --> 00:13:13.639
of this in a moment,

00:13:13.640 --> 00:13:17.019
where, let's say, I want to add

00:13:17.020 --> 00:13:19.999
a second account to Gnus.

00:13:20.000 --> 00:13:23.559
This one I'm going to call ec25work.

00:13:23.560 --> 00:13:24.679
Let's pretend that

00:13:24.680 --> 00:13:29.859
this is my work email.

00:13:29.860 --> 00:13:32.479
So if we open Gnus now,

00:13:32.480 --> 00:13:36.999
we see that our work INBOX

00:13:37.000 --> 00:13:37.959
also shows up here.

00:13:37.960 --> 00:13:41.299
And because we enabled topic mode,

00:13:41.300 --> 00:13:42.359
we see that we have

00:13:42.360 --> 00:13:43.439
these sort of buttons

00:13:43.440 --> 00:13:44.839
like Gnus and misc here.

00:13:44.840 --> 00:13:46.679
And we can, I believe,

00:13:46.680 --> 00:13:49.799
create a topic with capital T n.

00:13:49.800 --> 00:13:52.879
We can call it personal, this one.

00:13:52.880 --> 00:13:56.939
Let's create another one, work.

00:13:56.940 --> 00:13:59.579
And then what we can do is go

00:13:59.580 --> 00:14:02.799
over the directory that we want,

00:14:02.800 --> 00:14:04.759
for example, this one,

00:14:04.760 --> 00:14:08.219
hit capital T m to move it

00:14:08.220 --> 00:14:11.899
to the personal topic,

00:14:11.900 --> 00:14:13.079
and this work one,

00:14:13.080 --> 00:14:15.199
move it to the work topic.

00:14:15.200 --> 00:14:17.439
So we can nicely classify

00:14:17.440 --> 00:14:23.119
and group our groups folders here,

00:14:23.120 --> 00:14:24.719
which is especially useful

00:14:24.720 --> 00:14:25.559
when you have hundreds of them.

NOTE Customizing message display

00:14:25.560 --> 00:14:29.759
Anyhow, we can customize

00:14:29.760 --> 00:14:35.039
different aspects of message display.

00:14:35.040 --> 00:14:35.839
Like for example,

00:14:35.840 --> 00:14:38.199
we can this way customize

00:14:38.200 --> 00:14:39.199
and change the order of

00:14:39.200 --> 00:14:41.599
which headers we want to see and where.

00:14:41.600 --> 00:14:45.199
So if I launch Gnus

00:14:45.200 --> 00:14:48.459
and go back to this email here,

00:14:48.460 --> 00:14:52.139
these are the headers that we see at the top.

00:14:52.140 --> 00:14:52.639
Excuse me.

00:14:52.640 --> 00:14:55.159
And with Gnus we can always

00:14:55.160 --> 00:14:57.799
We can have it show all the headers

00:14:57.800 --> 00:15:01.999
by pressing t to toggle the headers.

00:15:02.000 --> 00:15:04.579
Here we can see all the nitty-gritty

00:15:04.580 --> 00:15:06.359
and all of the headers in the message

00:15:06.360 --> 00:15:12.219
and we can toggle it back with t again.

00:15:12.220 --> 00:15:16.479
We can modify and customize the sorting

00:15:16.480 --> 00:15:20.019
with dedicated sorting functions.

00:15:20.020 --> 00:15:20.999
It comes with a number of them

00:15:21.000 --> 00:15:21.599
out of the box

00:15:21.600 --> 00:15:24.319
but we can define them as well.

NOTE Sending emails

00:15:24.320 --> 00:15:29.759
Now to send emails. Let's see.

00:15:29.760 --> 00:15:30.999
We will be using message,

00:15:31.000 --> 00:15:34.939
and that's what Gnus itself uses.

00:15:34.940 --> 00:15:38.579
So I will set things up here.

00:15:38.580 --> 00:15:42.639
Let's see.

00:15:42.640 --> 00:15:44.519
Okay, so first of all,

00:15:44.520 --> 00:15:46.439
we want to have Gnus mark

00:15:46.440 --> 00:15:48.519
the messages that we write to others

00:15:48.520 --> 00:15:49.759
as read automatically,

00:15:49.760 --> 00:15:51.359
so this option does that.

00:15:51.360 --> 00:15:58.039
And then we define posting styles this way

00:15:58.040 --> 00:16:01.619
using the prefix, the name

00:16:01.620 --> 00:16:04.359
of the IMAP server.

00:16:04.360 --> 00:16:06.519
And this is how we can tell it to use

00:16:06.520 --> 00:16:09.199
what email address for the From [header]

00:16:09.200 --> 00:16:14.599
and which SMTP server to send it with.

00:16:14.600 --> 00:16:17.879
Yeah, and then gcc is where Gnus will save

00:16:17.880 --> 00:16:20.199
the copy of the messages that we write.

00:16:20.200 --> 00:16:24.139
So if we go ahead and launch Gnus again.

00:16:24.140 --> 00:16:26.279
We can go into our personal email here,

00:16:26.280 --> 00:16:28.919
hit m to compose a new message.

00:16:28.920 --> 00:16:33.559
We can prepare an email to,

00:16:33.560 --> 00:16:35.119
let's say, our work address.

00:16:35.120 --> 00:16:42.419
Hello from EmacsConf 2025 Gnus talk.

00:16:42.420 --> 00:16:47.639
Hello, this is just a test. :)

00:16:47.640 --> 00:16:55.739
Yeah, and we hit send.

00:16:55.740 --> 00:16:56.919
The sending will be done

00:16:56.920 --> 00:17:03.479
using Emacs's built-in SMTP libraries.

00:17:03.480 --> 00:17:05.119
Sometimes it can take a moment.

00:17:05.120 --> 00:17:07.599
Okay, that's it. It's done.

00:17:07.600 --> 00:17:09.259
So if we go back out

00:17:09.260 --> 00:17:11.559
and if we hit g to get new news,

00:17:11.560 --> 00:17:15.679
we should be able to see our new email there

00:17:15.680 --> 00:17:17.639
in the other account that we just sent it to.

00:17:17.640 --> 00:17:22.360
So we can come here, open it,

00:17:22.361 --> 00:17:26.659
and there we go.

NOTE Plans

00:17:26.660 --> 00:17:29.239
There is a lot to configure in Gnus,

00:17:29.240 --> 00:17:31.439
and we're just barely scratching the surface,

00:17:31.440 --> 00:17:34.079
and unfortunately I don't have the time

00:17:34.080 --> 00:17:34.999
to explain all of these

00:17:35.000 --> 00:17:36.519
but I do plan on doing

00:17:36.520 --> 00:17:38.839
a much longer running series,

00:17:38.840 --> 00:17:41.499
whether it's text or videos,

00:17:41.500 --> 00:17:42.879
showing how to configure

00:17:42.880 --> 00:17:45.319
and use a lot of these different aspects of Gnus.

00:17:45.320 --> 00:17:49.519
But yeah, here, near the end, just a couple of...

00:17:49.520 --> 00:17:54.919
quick things. I find it's nice to have message

00:17:54.920 --> 00:17:56.519
prompt us for [confirmation]

00:17:56.520 --> 00:17:59.199
that we do want to send a message.

00:17:59.200 --> 00:18:01.359
Actually, when it does that, I take

00:18:01.360 --> 00:18:02.599
another look over my email

00:18:02.600 --> 00:18:07.059
to make sure I don't have any typos.

00:18:07.060 --> 00:18:09.519
It's generally a good idea to wrap your messages

00:18:09.520 --> 00:18:14.119
around 70 or 72 characters.

00:18:14.120 --> 00:18:16.619
We do that here.

00:18:16.620 --> 00:18:19.159
We can tell Gnus to forward messages

00:18:19.160 --> 00:18:22.599
as a proper MIME part,

00:18:22.600 --> 00:18:27.059
instead of some half-broken way.

00:18:27.060 --> 00:18:30.119
This customization, the sendmail function,

00:18:30.120 --> 00:18:34.239
is how we tell Gnus with message

00:18:34.240 --> 00:18:38.239
to use the SMTP library to sending the email,

00:18:38.240 --> 00:18:42.479
and these two variables are useful for

00:18:42.480 --> 00:18:45.959
omitting our own email address

00:18:45.960 --> 00:18:47.439
when we want to send someone,

00:18:47.440 --> 00:18:50.179
like when we hit r, to reply to someone.

00:18:50.180 --> 00:18:51.959
if we configure these variables,

00:18:51.960 --> 00:18:52.959
then Gnus won't add

00:18:52.960 --> 00:18:56.059
our own address to the To or Cc,

00:18:56.060 --> 00:18:58.479
which is pretty useful.

00:18:58.480 --> 00:18:59.919
I also find it helpful

00:18:59.920 --> 00:19:03.359
to unbind C-c C-s.

00:19:03.360 --> 00:19:04.974
That's another key

00:19:04.975 --> 00:19:06.319
for sending the message [in addition to C-c C-c].

00:19:06.320 --> 00:19:09.719
And because C-c C-d,

00:19:09.720 --> 00:19:13.359
which is very close to it on the QWERTY layout,

00:19:13.360 --> 00:19:15.719
is useful for saving a draft

00:19:15.720 --> 00:19:16.839
and then coming back to it,

00:19:16.840 --> 00:19:20.079
I don't want to accidentally hit C-c C-s,

00:19:20.080 --> 00:19:22.039
and send the message prematurely.

00:19:22.040 --> 00:19:25.979
So I unbind it.

00:19:25.980 --> 00:19:27.959
Yeah, anyway, that's about it.

NOTE Wrapping up

00:19:27.960 --> 00:19:31.039
That's a kind of very quick tour

00:19:31.040 --> 00:19:37.119
and introduction of setting up Gnus.

00:19:37.120 --> 00:19:40.719
Here, we just configured a remote IMAP server,

00:19:40.720 --> 00:19:43.519
but we can also, of course,

00:19:43.520 --> 00:19:46.359
set up a local IMAP server such as Dovecot

00:19:46.360 --> 00:19:48.399
and point Gnus to there,

00:19:48.400 --> 00:19:52.799
and use programs like OfflineIMAP, I believe,

00:19:52.800 --> 00:19:57.479
or the mbsync program from isync package

00:19:57.480 --> 00:20:02.939
or isync project to synchronize our messages

00:20:02.940 --> 00:20:04.479
to local mail directories

00:20:04.480 --> 00:20:06.279
and then point Gnus to it.

00:20:06.280 --> 00:20:08.359
The reason we might want to use that

00:20:08.360 --> 00:20:11.719
is to always have a copy of our messages at hand

00:20:11.720 --> 00:20:12.759
so we can use offline.

NOTE nnimap

00:20:12.760 --> 00:20:17.439
And why use nnimap specifically?

00:20:17.440 --> 00:20:27.399
As of now, the Maildir backend included with Gnus

00:20:27.400 --> 00:20:29.679
is very inefficient,

00:20:29.680 --> 00:20:31.399
especially when dealing with

00:20:31.400 --> 00:20:33.839
tens or hundreds of thousands of messages

00:20:33.840 --> 00:20:36.659
like some of us are.

00:20:36.660 --> 00:20:38.759
It just takes an eternity to try

00:20:38.760 --> 00:20:43.259
and index them and get going.

00:20:43.260 --> 00:20:44.639
In that case, what I recommend doing

00:20:44.640 --> 00:20:47.799
is instead of interfacing directly with Maildir,

00:20:47.800 --> 00:20:52.359
for Gnus, just install and run

00:20:52.360 --> 00:20:54.359
Dovecot, a local IMAP server,

00:20:54.360 --> 00:20:59.819
and point Gnus to that.

00:20:59.820 --> 00:21:02.959
I plan on writing tutorials or doing videos

00:21:02.960 --> 00:21:06.639
about these other aspects

00:21:06.640 --> 00:21:10.519
of configuring Gnus after the conference.

00:21:10.520 --> 00:21:11.439
That's about it for me,

00:21:11.440 --> 00:21:14.119
so I hope you find this helpful.

00:21:14.120 --> 00:21:16.679
If you have any questions,

00:21:16.680 --> 00:21:18.239
please feel free to email me

00:21:18.240 --> 00:21:23.759
at bandali@gnu.org or @kelar.org.

00:21:23.760 --> 00:21:25.879
You can take a look at my personal website

00:21:25.880 --> 00:21:26.839
where I plan on posting

00:21:26.840 --> 00:21:31.059
other Emacs and Gnus materials.

00:21:31.060 --> 00:21:33.039
And yeah, thank you for watching

00:21:33.040 --> 00:21:35.159
and I hope you enjoy the rest of the conference.

00:21:35.160 --> 00:21:37.760
Take care.
