Merge branch 'dev' into vhs

This commit is contained in:
2023-12-02 03:10:14 +01:00
8 changed files with 335 additions and 5 deletions

73
data/email.md Normal file
View File

@@ -0,0 +1,73 @@
---
title: "e-mail"
tags: [ "data", "smtp" ]
---
This is bare-bones, original, primitive e-mail.
Install `opensmtpd` (or similar), then `ncat` or `nc` or `netcat` (this mysterious cat has many names).
Start the `opensmtpd` service, then use netcat to speak with the mail-daemon:
```
nc localhost 25
```
The computer should respond with code `220`, which means 'I am listening'.
> 220 hex ESMTP OpenSMTPD
```
HELO gmail.com
```
You say `HELO` and say where you are coming from.
The `smtpd` will not check, so I am going to lie to it.
Mail servers are easily impressed, so it will be pleased to meet you.
> 250 hex Hello gmail.com [::1], pleased to meet you
```
MAIL FROM: <admin@gmail.com>
```
All the mail commands start with 4 bytes, because it's easier for admins to program.
Tell the mail daemon who you are in this format.
> 250 2.0.0 Ok
Then tell it who you're sending to.
```
RCPT TO: <www@dmz.rs>
```
> 250 2.1.5 Destination address valid: Recipient ok
Finally, tell it that you want to send `DATA`.
```
DATA
```
> 354 Enter mail, end with "." on a line by itself
```
Subject: turn off server please
very urgent
.
```
> 250 2.0.0 73864a49 Message accepted for delivery
You will find the email under `/var/spool` or `/var/mail` or similar.
If unsure, just take a part of your email, like `FRAGMENT="turn off server please"`, then `grep` for it:
```bash
sudo grep -r $FRAGMENT /var/spool/*
```

View File

@@ -82,7 +82,7 @@ This is a fingerprint.
You can now decide the trust level (this stays on your computer).
```bash
gpg --edit-key *CD30421FD825696BD95F1FF644C62C57B790D3CF*
gpg --edit-key CD30421FD825696BD95F1FF644C62C57B790D3CF
```
Once you're in the interface, type `trust`.
@@ -91,29 +91,52 @@ Once you're in the interface, type `trust`.
gpg --sign-key alice@posteo.net
```
Then send those trusted keys up to a server, so people can see you have verified them:
# Swapping Keys
This system relies on a ring of people swapping key information.
## Sending
Send those trusted keys up to a server, so people can see you have verified them:
```bash
gpg --send-keys *024C6B1C84449BD1CB4DF7A152295D2377F4D70F*
gpg --send-keys 024C6B1C84449BD1CB4DF7A152295D2377F4D70F
```
## Upload Your Keys
## Add More Key Servers
Key servers often swap keys, but it's best to just send to multiple places immediately.
You can add key servers by adding this to `~/.gnupg/gpg.conf`.
```
keyserver hkps://keys.openpgp.org
keyserver hkps://mail-api.proton.me
keyserver hkps://keys.mailvelope.com
```
# Refresh Keys
Refreshing keys will tell you if some key you have contains a signature from someone you already trust, or if someone has published a revocation certificate (meaning their key should not be trusted any more).
```bash
gpg --refresh-keys
```
You can use the [crontab](../basics/cron.md) to refresh keys.
# Export
Your public key:
```bash
gpg --output *me*.gpg --armor --export
gpg --output me.gpg --armor --export
```
or
```bash
gpg --export -a *person@email.tld* > *my_key*.pub
gpg --export -a person@email.tld > my_key.pub
```