Accesso al relay del destinatario della posta negato

Trying hard to enable replies by email using the mail-receiver container. I consistently get errors:

NOQUEUE: reject: RCPT from ... 454 4.7.1 <...>: Relay access denied

Why is this? How can I get into the mail-receiver container and examine the postfix config and debug it? I have disabled the postfix server on the system on which this is running, because of clash with port 25. Is that wrong?

I am reasonably sure DNS MX records are right, and this happens from any server sending mail inbound, I am using Amazon SES for outbound in the app container and that works fine.

I am a Discourse newbie and I dont know how to debug the ecosystem. I am an expert in postfix, but I don’t know how to configure it in this containerized universe.

First thing first, if You already have a postfix instance running, You don’t really need the mail receiver container.

You can configure postfix as an email receiver for the replies email and configure discourse to poll that email.

This howto from 2014 shall give you enough idea to get started and I assume you can figure postfix on your own.

I don’t agree with this at all, the benefit of the mail-receiver is that emails are pushed via the API, rather than polled. There’s a significant difference in the time taken for email to arrive in Discourse using the mail-receiver (minutes versus seconds).

There’s also a huge difference in simplicity in configuration, mail-receiver requires three lines of a yml file be updated, the postfix OOBE requires… more.

That error implies the mail domains don’t match.

As you’re obfuscating parts of the message we can’t easily troubleshoot this for you.

3 Mi Piace

If you’re getting any mail delivered as you expect, then this implies that someone is trying to use your mail server to deliver mail to some other domain. If, for example, someone pointed their MX record to your IP address. Or, and I’ve never heard of this :wink: , someone was trying to nefariously have your mail server deliver unwanted mail.

Are all of these errors from the same IP? Can you see in the logs what domain they the errant messages are intended for?

The easiest thing to do is to ignore it.

3 Mi Piace

I had this issue on a previously working mail-receiver which I’d made some changes to. I had thought I’d rebuild the container but clearly something hadn’t gone right as I got multiple ’ Relay access denied’ errors for all recipients. DNS was correctly configured.

In the end a good old git pull and launcher rebuild mail-receiver fixed it. Just posting this in case it works for anyone else.

2 Mi Piace

Ho lo stesso errore con i report di mail-receiver: Relay access denied (in reply to RCPT TO command).

La ricezione della posta non funziona per la nuova installazione, ma l’ho già fatta funzionare in precedenza. Credo che tutte le impostazioni siano corrette, ma potrei aver tralasciato qualcosa.

Questo di solito significa che la posta viene recapitata a un dominio che non è quello che il destinatario è configurato per accettare.

L’ho impostato per lo stesso sottodominio del sito discourse.

Per il valore del record MX è “sottodominio.dominio”, e l’host dovrebbe essere solo “sottodominio” o @?

Qualcuno sa cosa causa l’errore “Accesso al relay negato”?

Si verifica quando il dominio del destinatario non corrisponde al dominio configurato in mail-receiver.yml.

1 Mi Piace

È quello l’indirizzo a cui stai inviando l’email?

Stesso indirizzo, ora funziona dopo la ricostruzione del ricevitore di posta.
Credo di averlo ricostruito prima, ma non funzionava, è un bene che ora funzioni.

devo consentire ulteriormente la porta 25 affinchĂŠ mail-receiver funzioni correttamente?

In questo caso, funzionare correttamente significherebbe che le email in arrivo che appaiono in .\launcher logs mail-receiver raggiungano l’interfaccia di amministrazione di Discourse.

SĂŹ, devi aprire la porta 25. Potrebbe essere aggiunta a questa guida come regola opzionale.

1 Mi Piace

Beh, non ne ho 25 aperte. Quindi, no.

Ma ufw status non è cosÏ interessante. Invece nft list ruleset lo è.

1 Mi Piace

Aggiornamento: ufw deny 25 è stato applicato e mail-reciver funziona correttamente (07/02/2025)

Posso confermare che è corretto, anche se ho commesso un altro errore. Si tratta del mio secondo forum per implementare mail-receiver, e sul primo avevo il record MX del dominio che riceve le email Value come DISCOURSE_BASE_URL

Ora ricevo le email nel mio (secondo) forum UI, piuttosto che solo nel primo :tada:

Nota: questa convinzione di correttezza potrebbe essere dovuta al fatto di non aver eseguito ./launcher rebuild mail-receiver dopo aver modificato lo yml (06/02/2015)

Immagino che non sia necessario consentire la porta 25, ad esempio, su un firewall del pannello Azure o VPS, quindi pre-Ubuntu

perchĂŠ il valore del record MX dovrebbe puntare al sito Web, non al dominio di posta elettronica, interessante

La guida ufficiale menziona che la porta 25 deve essere aperta:

Io stesso ho riscontrato un problema con il ricevitore di posta perché ho dimenticato di aprire la porta 25 nel mio firewall. L’aggiunta della regola ha risolto il problema.

una soluzione migliore potrebbe essere quella di consentire solo l’indirizzo IP pertinente?

Non diciamo questo al mio ricevitore di posta :wink:

L’invio avviene tramite Amazon SES. La ricezione avviene tramite mx al dominio del forum e ora entra in gioco Docker.

Il motivo è Docker e il suo modo di funzionare interno. Semplicemente non si preoccupa di ufw. Se vuoi una spiegazione esatta e dettagliata, aspetta un secondo: una volta ho chiesto perchÊ Discourse non si preoccupa del mio firewall, e il motivo era il traffico dei pacchetti. Ma capire a fondo cosa sta succedendo non è la mia tazza di tè. Per me è sufficiente che le cose funzionino. E fidati di me: ufw ha aperte solo le porte 22, 80 e 443.

Suppongo che tu abbia citato una situazione in cui il ricevitore di posta si occupa anche dell’invio di e-mail utilizzando postfix.

1 Mi Piace