summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGab Virebent <noreply@virebent.art>2026-05-23 02:48:34 +0200
committerGab Virebent <noreply@virebent.art>2026-05-23 02:48:34 +0200
commit847759f50596b0d992085aa34d7b5b78057aa7ce (patch)
tree30b786fe24a3451f8dbb96c76f097b934abcc677
downloadneomutt-config-847759f50596b0d992085aa34d7b5b78057aa7ce.tar.gz
neomutt-config-847759f50596b0d992085aa34d7b5b78057aa7ce.tar.xz
neomutt-config-847759f50596b0d992085aa34d7b5b78057aa7ce.zip
Initial public release
-rw-r--r--.gitignore10
-rw-r--r--README.md191
-rw-r--r--accounts/account130
-rw-r--r--accounts/account228
-rw-r--r--accounts/account336
-rw-r--r--accounts/mail2news36
-rw-r--r--colors.mutt92
-rw-r--r--mailcap22
-rw-r--r--neomuttrc156
-rwxr-xr-xscripts/m2n-post.sh171
10 files changed, 772 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ec1259b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+# File temporanei mail2news
+/tmp/m2n-*
+
+# Cache NeoMutt (non committare mai)
+*.cache
+
+# Backup editor
+*.bak
+*.orig
+*.swp
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..249985e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,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
+```
diff --git a/accounts/account1 b/accounts/account1
new file mode 100644
index 0000000..28608b8
--- /dev/null
+++ b/accounts/account1
@@ -0,0 +1,30 @@
+# Account 1 - esempio con mail server standard
+# Rinomina questo file con un nome significativo (es. "gmail", "proton", ecc.)
+# e aggiorna neomuttrc di conseguenza
+
+set from = "user@example.com"
+set realname = "Your Name"
+
+# Identificativo account per status bar
+set my_account_info = "[F2 - user@example.com]"
+set status_format = "$my_account_info │ %f %?M?(%M hidden)? %?n?(%n new)?%?d? (%d to delete)?%?t? (%t tagged)? %>─%?p?(%p postponed)?─"
+
+# IMAP (STARTTLS porta 143 oppure imaps:// porta 993 per SSL)
+set imap_user = "user@example.com"
+set imap_pass = "`pass email/account1`" # usa pass(1) per le credenziali
+set folder = "imap://mail.example.com:143"
+set spoolfile = "+INBOX"
+set record = "+Sent"
+set trash = "+Trash"
+set postponed = "+Drafts"
+
+# SMTP (STARTTLS porta 587)
+set smtp_url = "smtp://user%40example.com@mail.example.com:587"
+set smtp_pass = "`pass email/account1`"
+
+# GPG/ECC - imposta qui il fingerprint della tua chiave ECC
+# Generala con: gpg --full-generate-key (scegli ECC/Ed25519)
+set pgp_default_key = "FINGERPRINT_CHIAVE_ECC"
+set pgp_sign_as = "FINGERPRINT_CHIAVE_ECC"
+
+color status cyan default
diff --git a/accounts/account2 b/accounts/account2
new file mode 100644
index 0000000..7a1e409
--- /dev/null
+++ b/accounts/account2
@@ -0,0 +1,28 @@
+# Account 2 - esempio con provider privacy-oriented (Autistici, Riseup, ecc.)
+# Rinomina questo file con un nome significativo
+
+set from = "user@privacy-provider.org"
+set realname = "Your Name"
+
+# Identificativo account per status bar
+set my_account_info = "[F3 - user@privacy-provider.org]"
+set status_format = "$my_account_info │ %f %?M?(%M hidden)? %?n?(%n new)?%?d? (%d to delete)?%?t? (%t tagged)? %>─%?p?(%p postponed)?─"
+
+# IMAP SSL (porta 993)
+set imap_user = "user@privacy-provider.org"
+set imap_pass = "`pass email/account2`"
+set folder = "imaps://mail.privacy-provider.org:993"
+set spoolfile = "+INBOX"
+set record = "+Sent"
+set trash = "+Trash"
+set postponed = "+Drafts"
+
+# SMTP (STARTTLS porta 587)
+set smtp_url = "smtp://user%40privacy-provider.org@smtp.privacy-provider.org:587"
+set smtp_pass = "`pass email/account2`"
+
+# GPG/ECC
+set pgp_default_key = "FINGERPRINT_CHIAVE_ECC"
+set pgp_sign_as = "FINGERPRINT_CHIAVE_ECC"
+
+color status green default
diff --git a/accounts/account3 b/accounts/account3
new file mode 100644
index 0000000..3010491
--- /dev/null
+++ b/accounts/account3
@@ -0,0 +1,36 @@
+# Account 3 - esempio con FOG SMTP (server SMTP proprio su .onion)
+# Adatto per chi gestisce il proprio server SMTP raggiungibile via Tor
+# Rinomina questo file con un nome significativo
+
+set from = "user@yourdomain.tld"
+set realname = "Your Name"
+
+# Identificativo account per status bar
+set my_account_info = "[F4 - user@yourdomain.tld]"
+set status_format = "$my_account_info │ %f %?M?(%M hidden)? %?n?(%n new)?%?d? (%d to delete)?%?t? (%t tagged)? %>─%?p?(%p postponed)?─"
+
+# IMAP clearnet (opzionale, puoi usare anche .onion)
+set imap_user = "user@yourdomain.tld"
+set imap_pass = "`pass email/account3`"
+set folder = "imap://mail.yourdomain.tld:143"
+set spoolfile = "+INBOX"
+set record = "+Sent"
+set trash = "+Trash"
+set postponed = "+Drafts"
+
+# SMTP via FOG (.onion) - sostituisci con il tuo indirizzo onion
+# FOG è un relay SMTP anonimo raggiungibile via Tor
+# Imposta torsocks oppure usa ProxyCommand nella configurazione di sistema
+set smtp_url = "smtp://YOUR_FOG_ONION_ADDRESS.onion:25"
+set smtp_pass = ""
+set ssl_starttls = no
+set ssl_force_tls = no
+
+# GPG/ECC
+set pgp_default_key = "FINGERPRINT_CHIAVE_ECC"
+set pgp_sign_as = "FINGERPRINT_CHIAVE_ECC"
+
+# Nota: per usare SMTP via .onion assicurati che torsocks sia attivo
+# oppure usa SOCKS5 proxy: set smtp_url = "smtp://[socks5h://127.0.0.1:9050/]YOUR_ONION.onion:25"
+
+color status magenta default
diff --git a/accounts/mail2news b/accounts/mail2news
new file mode 100644
index 0000000..e3be1e7
--- /dev/null
+++ b/accounts/mail2news
@@ -0,0 +1,36 @@
+# Account: mail2news (solo SMTP via Tor, nessun IMAP)
+#
+# Questo account usa un indirizzo fisso (mittente anonimo) e una chiave ECC dedicata
+# per firmare tutti i post Usenet inviati via mail2news.
+#
+# Il server SMTP è raggiungibile solo via Tor (.onion) — nessuna connessione clearnet.
+# Il "From" viene settato qui e usato dallo script m2n-post.sh
+
+# Mittente fisso per tutti i post mail2news
+# Usa un indirizzo .invalid per non rivelare email reale
+set from = "anon@anonymous.invalid"
+set realname = "Anonymous"
+
+# Nessun IMAP - solo invio
+set folder = ""
+set spoolfile = ""
+
+# SMTP via Tor (.onion) — mail2news server onion
+# Sostituisci con l'indirizzo .onion del tuo server mail2news preferito
+# Esempio noto: mail2news pubblico su Tor
+set smtp_url = "smtp://MAIL2NEWS_ONION_ADDRESS.onion:25"
+set smtp_pass = ""
+set ssl_starttls = no
+set ssl_force_tls = no
+
+# GPG/ECC — chiave dedicata per mail2news (separata dalle email personali)
+# Genera con: gpg --full-generate-key → ECC/Ed25519
+# Poi esporta la pubkey su keyserver o allegala nei post
+set pgp_default_key = "FINGERPRINT_CHIAVE_ECC_MAIL2NEWS"
+set pgp_sign_as = "FINGERPRINT_CHIAVE_ECC_MAIL2NEWS"
+set crypt_autosign = yes # firma automatica di tutti i post
+
+# Header identificativo
+my_hdr X-Mailer: NeoMutt/mail2news
+
+color status black white
diff --git a/colors.mutt b/colors.mutt
new file mode 100644
index 0000000..2735516
--- /dev/null
+++ b/colors.mutt
@@ -0,0 +1,92 @@
+# ╔══════════════════════════════════════════════════════╗
+# ║ CYBERPUNK NEOMUTT THEME ║
+# ║ Dark background, neon accents ║
+# ╚══════════════════════════════════════════════════════╝
+
+# Reset
+color normal default default
+
+# ─── Index (lista messaggi) ──────────────────────────
+color index color39 default "~N" # Nuovi → cyan neon
+color index color205 default "~F" # Flagged → magenta/pink
+color index color245 default "~R" # Letti → grigio
+color index color196 default "~D" # Da cancellare → rosso
+color index color82 default "~T" # Tagged → verde neon
+color index color214 default "~U" # Unread → arancio
+color index color240 default "~Q" # Replied → grigio scuro
+color index_author color141 default ".*" # Autore → viola
+color index_author color51 default "~N" # Autore nuovi → cyan bright
+color index_date color240 default # Data → grigio
+color index_subject color255 default ".*" # Subject → bianco
+color index_subject color231 default "~N" # Subject nuovi → bianco bright
+color index_size color240 default # Size → grigio
+
+# ─── Status bar ──────────────────────────────────────
+color status color16 color39 # Nero su cyan
+color indicator color16 color205 # Messaggio selezionato → nero su magenta
+
+# ─── Sidebar ─────────────────────────────────────────
+color sidebar_new color51 default # Folder con nuovi → cyan
+color sidebar_flagged color205 default # Folder con flagged → magenta
+color sidebar_indicator color16 color39 # Folder attivo → nero su cyan
+color sidebar_highlight color231 color236 # Hover → bianco su grigio scuro
+color sidebar_ordinary color245 default # Normale → grigio
+color sidebar_divider color236 default # Divisore → grigio scuro
+color sidebar_unread color214 default # Folder con unread → arancio
+
+# ─── Pager (lettura email) ───────────────────────────
+color header color39 default "^From:" # From → cyan
+color header color82 default "^To:" # To → verde
+color header color214 default "^Subject:" # Subject → arancio
+color header color141 default "^Date:" # Date → viola
+color header color245 default "^Cc:" # Cc → grigio
+color header color205 default "^X-" # X-headers → magenta
+color header color82 default "^Reply-To:" # Reply-To → verde
+
+color hdrdefault color240 default # Header default → grigio scuro
+color body color231 default ".*" # Body → bianco
+
+# ─── URL e links ─────────────────────────────────────
+color body color39 default "(https?|ftp)://[^ \"\t\r\n>]*" # URLs → cyan
+color body color82 default "[-a-z_0-9.]+@[-a-z_0-9.]+" # Email → verde
+
+# ─── Quote levels (risposte) ─────────────────────────
+color quoted color141 default # Livello 1 → viola
+color quoted1 color39 default # Livello 2 → cyan
+color quoted2 color82 default # Livello 3 → verde
+color quoted3 color214 default # Livello 4 → arancio
+color quoted4 color205 default # Livello 5 → magenta
+
+# ─── Attachment ──────────────────────────────────────
+color attachment color214 default # Allegati → arancio
+
+# ─── Markers & Tree ─────────────────────────────────
+color tree color39 default # Thread tree → cyan
+color markers color196 default # + markers → rosso
+color tilde color236 default # ~ (righe vuote) → grigio scuro
+color bold color231 default # Bold → bianco bright
+color underline color39 default # Underline → cyan
+
+# ─── GPG/PGP ────────────────────────────────────────
+color body color82 default "Good signature"
+color body color196 default "BAD signature"
+color body color214 default "WARNING:.*"
+color body color82 default "\\[-- .* firma verificata --\\]"
+color body color82 default "\\[-- Begin signature information --\\]"
+
+# ─── Compose ─────────────────────────────────────────
+color compose header color39 default
+color compose security_encrypt color82 default
+color compose security_sign color141 default
+color compose security_both color205 default
+color compose security_none color196 default
+
+# ─── Prompt & Messages ───────────────────────────────
+color prompt color39 default
+color message color82 default
+color error color196 default
+color warning color214 default
+color search color16 color214 # Ricerca → nero su arancio
+
+# ─── Progress bar ────────────────────────────────────
+color progress color16 color39 # Nero su cyan
diff --git a/mailcap b/mailcap
new file mode 100644
index 0000000..dab0cbb
--- /dev/null
+++ b/mailcap
@@ -0,0 +1,22 @@
+# Mailcap per NeoMutt
+
+# HTML - visualizza nel terminale con lynx (dipendenza: lynx)
+text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput
+
+# HTML - apri in browser (sostituisci firefox con il tuo browser)
+text/html; firefox %s; nametemplate=%s.html
+
+# Immagini
+image/*; firefox %s
+image/png; firefox %s
+image/jpeg; firefox %s
+image/gif; firefox %s
+
+# PDF
+application/pdf; firefox %s
+
+# Documenti Office
+application/msword; libreoffice %s
+application/vnd.openxmlformats-officedocument.wordprocessingml.document; libreoffice %s
+application/vnd.ms-excel; libreoffice %s
+application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; libreoffice %s
diff --git a/neomuttrc b/neomuttrc
new file mode 100644
index 0000000..ec3626c
--- /dev/null
+++ b/neomuttrc
@@ -0,0 +1,156 @@
+# NeoMutt Configuration
+# Privacy-focused setup with multi-account support, GPG/ECC signing, and mail2news via Tor
+
+# =====================================================
+# Impostazioni Generali
+# =====================================================
+
+set realname = "Your Name"
+set use_from = yes
+set envelope_from = yes
+
+# Editor per comporre email
+set editor = "vim"
+
+# Permetti editing degli headers durante composizione
+set edit_headers = yes
+set autoedit = yes
+
+# Headers da mostrare in composizione
+my_hdr References:
+my_hdr Reply-To:
+my_hdr X-Newsgroups:
+
+# Formato data
+set date_format = "%d/%m/%Y %H:%M"
+set index_format = "%4C %Z %d %-20.20L %s"
+
+# Inizializza variabile account (verrà sovrascritta dall'account caricato)
+set my_account_info = "[Account]"
+
+# Status bar personalizzata (mostra account corrente)
+set status_format = "$my_account_info │ %f %?M?(%M hidden)? %?n?(%n new)?%?d? (%d to delete)?%?t? (%t tagged)? %>─%?p?(%p postponed)?─"
+
+# Sidebar
+set sidebar_visible = yes
+set sidebar_width = 30
+set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
+set mail_check_stats
+
+# =====================================================
+# Sicurezza
+# =====================================================
+
+set ssl_force_tls = yes
+set ssl_starttls = yes
+
+# =====================================================
+# GPG/PGP (ECC)
+# =====================================================
+
+set crypt_use_gpgme = yes
+set crypt_autopgp = yes
+set pgp_auto_decode = yes
+set crypt_verify_sig = yes
+set crypt_replysign = yes
+set crypt_replyencrypt = yes
+set crypt_replysignencrypted = yes
+
+# Disabilita cifratura opportunistica (attivare manualmente con 'p' in composizione)
+set crypt_opportunistic_encrypt = no
+
+# Scorciatoie GPG
+# Durante composizione (compose mode):
+# p = Menu completo per firmare/criptare
+# e = Cripta messaggio
+# s = Firma messaggio
+
+# Verifica PGP inline
+macro index,pager \Ce "<check-traditional-pgp>" "Verifica PGP inline"
+macro index,pager \Cv "<view-attachments><search>application/pgp<enter><view-mailcap><exit>" "Visualizza firma/chiave PGP"
+
+# =====================================================
+# HTML
+# =====================================================
+
+set mailcap_path = "~/.config/neomutt/mailcap"
+auto_view text/html
+alternative_order text/html text/plain
+set implicit_autoview = yes
+
+macro index,pager \cv "<view-attachments><search>html<enter><view-mailcap><exit>" "Apri HTML in Firefox"
+
+# =====================================================
+# Ordinamento
+# =====================================================
+
+set sort = threads
+set sort_aux = reverse-last-date-received
+
+# =====================================================
+# Cache (velocizza IMAP)
+# =====================================================
+
+set header_cache = "~/.cache/neomutt/headers"
+set message_cachedir = "~/.cache/neomutt/bodies"
+
+# =====================================================
+# Tema colori cyberpunk
+# =====================================================
+
+source ~/.config/neomutt/colors.mutt
+
+# =====================================================
+# Account di default
+# =====================================================
+
+# Carica il primo account all'avvio
+source ~/.config/neomutt/accounts/account1
+
+# =====================================================
+# Scorciatoie per cambiare account
+# =====================================================
+
+macro index,pager <f2> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/account1<enter><change-folder>!<enter>' "Passa a account1"
+macro index,pager <f3> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/account2<enter><change-folder>!<enter>' "Passa a account2"
+macro index,pager <f4> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/account3<enter><change-folder>!<enter>' "Passa a account3"
+
+# F9 = Mail2news via Tor (script interattivo)
+macro index,pager <f9> "<shell-escape>~/.config/neomutt/m2n-post.sh<enter>" "Post mail2news"
+
+# =====================================================
+# Scorciatoie utili
+# =====================================================
+
+bind index,pager B sidebar-toggle-visible
+bind index,pager \Cp sidebar-prev
+bind index,pager \Cn sidebar-next
+bind index,pager \Co sidebar-open
+
+# Vim-like navigation
+bind pager j next-line
+bind pager k previous-line
+bind index j next-entry
+bind index k previous-entry
+bind index G last-entry
+bind index g noop
+bind index gg first-entry
+
+# Risposta e forward
+bind index,pager r reply
+bind index,pager R group-reply
+bind index,pager f forward-message
+
+# Componi email HTML (scrivi in markdown, viene convertito con pandoc)
+macro compose H "F pandoc -s -f markdown -t html<enter>y^T^Utext/html<enter>" "Converti in HTML"
+
+# =====================================================
+# Mail2News
+# =====================================================
+
+# F9 gestisce tutto: nuovo post e reply (se Subject inizia con Re:)
+# Il mittente fisso viene letto da ~/.config/neomutt/accounts/mail2news
+
+# Disable drafts/postponed (avoid IMAP errors)
+set postponed = ""
+set record = ""
diff --git a/scripts/m2n-post.sh b/scripts/m2n-post.sh
new file mode 100755
index 0000000..ad7ffa0
--- /dev/null
+++ b/scripts/m2n-post.sh
@@ -0,0 +1,171 @@
+#!/bin/bash
+# mail2news - Script interattivo per comporre e inviare post Usenet via Tor
+#
+# Flusso: Newsgroup → Subject → [References se Re:] → Messaggio → Revisione → Invio
+#
+# Dipendenze: torsocks, netcat (openbsd-netcat o ncat), vim, gpg
+# Il mittente fisso e la chiave ECC sono configurati in accounts/mail2news
+#
+# Configurazione — adatta questi valori al tuo setup:
+# ----------------------------------------------------------
+SMTP_ONION="MAIL2NEWS_ONION_ADDRESS.onion" # indirizzo .onion del server mail2news
+SMTP_PORT="25"
+MAIL2NEWS_TO="mail2news@MAIL2NEWS_ONION_ADDRESS.onion" # destinatario mail2news
+FROM_ADDR="anon@anonymous.invalid" # deve corrispondere a accounts/mail2news
+FROM_NAME="Anonymous"
+GPG_KEY="FINGERPRINT_CHIAVE_ECC_MAIL2NEWS" # fingerprint chiave ECC per firmare
+SIGNATURE="-- \nAnonymous" # firma in calce al post
+# ----------------------------------------------------------
+
+clear
+echo "========================================"
+echo " MAIL2NEWS - Nuovo Post"
+echo "========================================"
+echo
+
+# 1. Newsgroup (supporta multipli separati da virgola)
+echo -n "Newsgroup(s) (separa con virgola per crosspost): "
+read NEWSGROUP
+
+if [ -z "$NEWSGROUP" ]; then
+ echo "Errore: newsgroup obbligatorio"
+ exit 1
+fi
+
+# Rimuovi spazi attorno alle virgole
+NEWSGROUP=$(echo "$NEWSGROUP" | sed 's/ *, */,/g')
+
+# 2. Subject
+echo -n "Subject: "
+read SUBJECT
+
+if [ -z "$SUBJECT" ]; then
+ echo "Errore: subject obbligatorio"
+ exit 1
+fi
+
+# 3. Se inizia con Re: chiedi References
+REFERENCES=""
+if [[ "$SUBJECT" =~ ^[Rr][Ee]:* ]]; then
+ echo -n "References (Message-ID del post originale, es. <id@host>): "
+ read REFERENCES
+fi
+
+# 4. Corpo del messaggio
+MSGFILE=$(mktemp /tmp/m2n-msg.XXXXXX)
+printf "\n\n%b\n" "$SIGNATURE" > "$MSGFILE"
+
+echo
+echo "Scrivi il messaggio (si aprirà vim)..."
+echo "Premi INVIO per continuare..."
+read
+
+vim "$MSGFILE"
+
+# 5. Costruisci il draft completo
+DRAFTFILE=$(mktemp /tmp/m2n-draft.XXXXXX)
+
+cat > "$DRAFTFILE" << EOF
+To: $MAIL2NEWS_TO
+From: $FROM_NAME <$FROM_ADDR>
+Subject: $SUBJECT
+Newsgroups: $NEWSGROUP
+EOF
+
+if [ -n "$REFERENCES" ]; then
+ echo "References: $REFERENCES" >> "$DRAFTFILE"
+fi
+
+echo "" >> "$DRAFTFILE"
+cat "$MSGFILE" >> "$DRAFTFILE"
+
+# 6. Firma GPG/ECC (clearsign inline — compatibile con Usenet)
+if [ -n "$GPG_KEY" ] && [ "$GPG_KEY" != "FINGERPRINT_CHIAVE_ECC_MAIL2NEWS" ]; then
+ SIGNED_FILE=$(mktemp /tmp/m2n-signed.XXXXXX)
+ # Firma solo il body (dopo la riga vuota degli header)
+ BODY_START=$(grep -n "^$" "$DRAFTFILE" | head -1 | cut -d: -f1)
+ HEADER_PART=$(head -n "$BODY_START" "$DRAFTFILE")
+ BODY_PART=$(tail -n +"$((BODY_START + 1))" "$DRAFTFILE")
+
+ SIGNED_BODY=$(echo "$BODY_PART" | gpg --clearsign --default-key "$GPG_KEY" 2>/dev/null)
+ if [ $? -eq 0 ]; then
+ echo "$HEADER_PART" > "$SIGNED_FILE"
+ echo "" >> "$SIGNED_FILE"
+ echo "$SIGNED_BODY" >> "$SIGNED_FILE"
+ DRAFTFILE="$SIGNED_FILE"
+ echo "[GPG] Messaggio firmato con chiave $GPG_KEY"
+ else
+ echo "[GPG] Attenzione: firma fallita, invio non firmato"
+ fi
+fi
+
+# 7. Revisione
+clear
+echo "========================================"
+echo " REVISIONE EMAIL"
+echo "========================================"
+echo
+cat "$DRAFTFILE"
+echo
+echo "========================================"
+echo "[e] Modifica [s] Spedisci [q] Annulla"
+echo -n "Scelta: "
+read CHOICE
+
+case "$CHOICE" in
+ e|E)
+ vim "$DRAFTFILE"
+ echo
+ echo "[s] Spedisci [q] Annulla"
+ echo -n "Scelta: "
+ read CHOICE2
+ if [[ "$CHOICE2" != "s" && "$CHOICE2" != "S" ]]; then
+ echo "Annullato."
+ rm -f "$MSGFILE" "$DRAFTFILE"
+ exit 0
+ fi
+ ;;
+ q|Q)
+ echo "Annullato."
+ rm -f "$MSGFILE" "$DRAFTFILE"
+ exit 0
+ ;;
+esac
+
+# 8. Invia via SMTP raw su Tor con torsocks + netcat
+echo
+echo "Invio in corso via Tor..."
+
+{
+ sleep 1
+ echo "EHLO localhost"
+ sleep 1
+ echo "MAIL FROM:<$FROM_ADDR>"
+ sleep 1
+ echo "RCPT TO:<$MAIL2NEWS_TO>"
+ sleep 1
+ echo "DATA"
+ sleep 1
+ cat "$DRAFTFILE"
+ echo ""
+ echo "."
+ sleep 1
+ echo "QUIT"
+} | torsocks nc -w 30 "$SMTP_ONION" "$SMTP_PORT" > /tmp/m2n-smtp.log 2>&1
+
+if grep -q "250" /tmp/m2n-smtp.log; then
+ echo "Messaggio inviato a: $NEWSGROUP"
+ cat /tmp/m2n-smtp.log
+else
+ echo "Errore invio. Log SMTP:"
+ cat /tmp/m2n-smtp.log
+ echo ""
+ echo "Draft salvato in: $DRAFTFILE"
+ exit 1
+fi
+
+# Cleanup
+rm -f "$MSGFILE"
+echo
+echo "Premi INVIO per tornare a neomutt..."
+read