Guida

Un server di posta self-hosted che raggiunge davvero la casella di posta

AvanzatoLettura di 45 minAggiornato 4 giugno 2026
Risposta breve

Installare un server di posta è facile; essere attendibili per i destinatari non lo è. Devi avere la porta 25 in uscita, un record PTR che corrisponda al nome host del tuo banner, SPF, DKIM e DMARC pubblicati correttamente, un spazio di indirizzi senza storia di spam e un aumento graduale del volume. Se manca uno di questi, la posta finisce nello spam.

01 Imposta prima hostname e DNS inverso

Do this before installing anything. The PTR must resolve to the hostname the server announces, and that hostname must have a forward record pointing back to the same address.

hostnamectl set-hostname mail.example.com
# then set the PTR to mail.example.com in the OnionVPS panel

02 Installa lo stack

Mailcow gives you a complete Docker-based stack. Stalwart is a single Rust binary if you prefer fewer moving parts.

git clone https://github.com/mailcow/mailcow-dockerized /opt/mailcow
cd /opt/mailcow && ./generate_config.sh
docker compose up -d

03 Pubblica SPF, DKIM e DMARC

All three are DNS records. DKIM keys are generated by the mail stack; copy the public key from its admin interface.

example.com.            TXT  "v=spf1 mx -all"
dkim._domainkey        TXT  "v=DKIM1; k=rsa; p=MIGfMA0..."
_dmarc                 TXT  "v=DMARC1; p=none; rua=mailto:[email protected]"

04 Riscalda l'indirizzo

A few dozen messages a day for the first week, then roughly double weekly. A volume spike from a new IP is indistinguishable from a compromised host, and receivers treat it accordingly.

05 Rafforza DMARC una volta che i report sono puliti

Read aggregate reports for a fortnight at p=none, fix whatever is failing, then move to p=quarantine and eventually p=reject. Going straight to reject reliably breaks systems you forgot were sending mail.

Domande frequenti

Perché la mia posta va nello spam?

In ordine di probabilità: PTR mancante o non corrispondente, DKIM mancante, un nuovo IP che invia troppo troppo presto, o un spazio di indirizzi con una storia di abusi precedenti. I primi tre dipendono da te; il quarto è del provider.

Devo avere un IP statico?

Sì, e uno su cui puoi impostare il DNS inverso. Entrambe sono standard su ogni istanza OnionVPS.