summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 249985e37cae80b443aa96ddbbda1039782a3b8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# neomutt-config

Privacy-focused NeoMutt configuration with:
- Multi-account support (IMAP/SMTP)
- GPG/ECC signing on all accounts
- **Mail2news via Tor** — post to Usenet anonymously through a `.onion` SMTP gateway
- Cyberpunk color theme
- `pass`(1) integration for credential management (no plaintext passwords)

---

## Requirements

| Package      | Purpose                          |
|--------------|----------------------------------|
| `neomutt`    | MUA                              |
| `gpg`        | Signing/encryption               |
| `pass`       | Password storage                 |
| `torsocks`   | Tor proxy for mail2news          |
| `netcat`     | SMTP raw send (openbsd-netcat)   |
| `tor`        | Tor daemon                       |
| `vim`        | Composing messages               |
| `lynx`       | HTML email rendering in terminal |
| `pandoc`     | Markdown → HTML compose (opt.)   |

---

## Installation

```bash
git clone https://github.com/YOUR_USERNAME/neomutt-config
cd neomutt-config

# Copia i file di configurazione
mkdir -p ~/.config/neomutt/accounts
cp neomuttrc ~/.config/neomutt/neomuttrc    # oppure ~/.neomuttrc
cp colors.mutt ~/.config/neomutt/colors.mutt
cp mailcap ~/.config/neomutt/mailcap
cp accounts/* ~/.config/neomutt/accounts/
cp scripts/m2n-post.sh ~/.config/neomutt/m2n-post.sh
chmod +x ~/.config/neomutt/m2n-post.sh

# Cache per header/body IMAP
mkdir -p ~/.cache/neomutt/{headers,bodies}
```

---

## Setup account email

Ogni account ha un file in `~/.config/neomutt/accounts/`. Modifica i valori:

```
set from      = "user@example.com"
set imap_user = "user@example.com"
set folder    = "imap://mail.example.com:143"
set smtp_url  = "smtp://user%40example.com@mail.example.com:587"
```

### Password con `pass`

Usa [pass](https://www.passwordstore.org/) per non avere password in chiaro:

```bash
pass insert email/account1
```

Nel file account:
```
set imap_pass = "`pass email/account1`"
set smtp_pass = "`pass email/account1`"
```

---

## Generare una chiave ECC (Ed25519) con GPG

```bash
gpg --full-generate-key
# → scegli: (9) ECC (sign and encrypt) oppure (10) ECC (sign only)
# → curva: Ed25519
# → scadenza: a tua scelta (consigliato: 1-2 anni)
# → nome e indirizzo

# Mostra il fingerprint
gpg --list-secret-keys --keyid-format LONG

# Esempio output:
# sec   ed25519/AABBCCDDEEFF0011 2024-01-01
#       Key fingerprint = AABB CCDD EEFF 0011 ...
# uid   Your Name <user@example.com>
```

Copia il fingerprint (es. `AABBCCDDEEFF0011`) nel campo `pgp_default_key` e `pgp_sign_as` del file account.

### Chiave dedicata per mail2news

Si consiglia una chiave separata per i post Usenet, non legata alla propria identità email:

```bash
gpg --full-generate-key
# → usa un nome/email non riconducibile a te (es. "Anonymous <anon@anonymous.invalid>")
```

Aggiorna `FINGERPRINT_CHIAVE_ECC_MAIL2NEWS` in `accounts/mail2news` e in `scripts/m2n-post.sh`.

---

## Mail2news via Tor

Il sistema mail2news permette di inviare post Usenet attraverso un gateway SMTP `.onion`, senza rivelare il proprio IP.

### Configurazione

1. Avvia il daemon Tor
2. Modifica `scripts/m2n-post.sh` con i tuoi valori:

```bash
SMTP_ONION="INDIRIZZO.onion"           # server mail2news .onion
SMTP_PORT="25"
MAIL2NEWS_TO="mail2news@INDIRIZZO.onion"
FROM_ADDR="anon@anonymous.invalid"
GPG_KEY="FINGERPRINT_CHIAVE_ECC_MAIL2NEWS"
```

3. In NeoMutt premi **F9** per aprire lo script interattivo

### Flusso del post

```
F9 → Newsgroup → Subject → [References se Re:] → vim → Revisione → Invio
```

Il messaggio viene firmato con GPG/ECC prima dell'invio (clearsign inline, compatibile con i lettori Usenet).

### Server mail2news noti su Tor

Cerca gateway mail2news pubblici su Tor in:
- gruppi `alt.privacy`, `alt.anonymous.messages`
- [Tor hidden services directories]

---

## Keybindings

| Tasto | Azione                         |
|-------|-------------------------------|
| F2    | Account 1                     |
| F3    | Account 2                     |
| F4    | Account 3                     |
| F9    | Nuovo post mail2news           |
| B     | Toggle sidebar                 |
| Ctrl+P / Ctrl+N | Sidebar su/giù    |
| j/k   | Navigazione vim-like           |
| r/R   | Reply / Reply-all             |
| p     | Menu GPG in composizione       |

---

## Account FOG SMTP

FOG è un relay SMTP custom raggiungibile via Tor (`.onion`). Se usi il tuo server:

```
set smtp_url = "smtp://YOUR_FOG_ONION.onion:25"
set ssl_starttls = no
set ssl_force_tls = no
```

Assicurati di avviare `torsocks` prima di NeoMutt oppure configura un proxy SOCKS5:

```bash
torsocks neomutt
```

---

## Struttura file

```
~/.config/neomutt/
├── neomuttrc              # configurazione principale
├── colors.mutt            # tema cyberpunk
├── mailcap                # handler MIME
├── m2n-post.sh            # script mail2news
└── accounts/
    ├── account1           # account email 1
    ├── account2           # account email 2
    ├── account3           # account con FOG SMTP
    └── mail2news          # mittente fisso per Usenet
```