Relaying for my other VPS, wrong "from"

Hello, it s me again… Advancing on my configuration :slight_smile:
all the DNS thingy seems ok now…
I can receive and send email.
So now, I try to send email from my other vps, in the same domain, that hosts the website, nextcloud, and later a mailing list. (nextcloud, set up in smtp, with the good parameter, sends email ok )

when I do the command :
echo "relay test" | mail -s "relay test" destinationuser@destinationdomain
i get in the log : (/var/log/mail.log)

from=<user@hostname>

Why is the mail is from user@hostname and not the one in the file set up in /etc/postfix/relay_password
it seems that s slowing email and setting it up as a spam. some server even decline it.
thanks for your help !

Because you did not indicate a ‘from’ user in the command with the -r flag.

The authenticated user is just that, the user who is trusted to authenticate on the MiaB server. It does not effect the envelope (senders) address.

You are trying to use SMTP relay from the other machine? I presume that you have set up postfix on that vps or are you using a different MTA?

Send me a test mail using the command line like you just did … I think I know the problem, but want to confirm it first. I will PM you the address. :slight_smile:

This is because you are sending via CLI (also, as you noticed whoever you sent the mail as plus the hostname). As @alento has pointed out, if you use -r.

Example:

echo "relay test" | mail -s "relay test" -r 'First Last <you@example.com>' destinationuser@destinationdomain

This will set the “From:” address (to resolve the issue) and also the “Envelope name” (IE what would display in the client.)

OK if I use the -r, the from is OK
@alento : I sent you 2 tests email.

Yes I installed postfix as in this guide https://mailinabox.email/advanced-configuration.html
you I leave the default config, and jsut add the 7 lines ?
or empty the default config file and just have the 7 lines in it ?

I have my other mail at neomaibox service. it seem s they are delaying mail coming for my box :

Aug 23 15:57:39 nuage postfix/smtp[5450]: 8011717C4D3: Server certificate not verified
Aug 23 15:57:39 nuage postfix/smtp[5450]: server certificate verification failed for mail2.neomailbox.net[5.148.176.58]:25: certificate has expired
Aug 23 15:57:39 nuage postfix/smtp[5450]: 8011717C4D3: to=<xxx@xxx.xx>, relay=mail2.neomailbox.net[5.148.176.58]:25, delay=80198, delays=80197/0.03/1.2/0, dsn=4.7.5, status=deferred (Server certificate not trusted)

and to a gmail adress , it seem to be the same ?

relay=gmail-smtp-in.l.google.com[74.125.133.27]:25, delay=0.67, delays=0.01/0/0.4/0.25, dsn=2.0.0, status=sent (250 2.0.0 OK DMARC:Quarantine 1566568488 x14si2118454wmj.156 - gsmtp)

In one of the test email, the log sent me to this link : http://postgrey.schweikert.ch/help/
but not anymore …

Mail sent to the gmail adress are marked as spam, how can I solve that ?
DNNSEC is activated for this domain…
I guess it is not related to relaying anymore, let me know if you prefer me to open an another topic
Thank you for your help !!!

@Feydreva

Hi, I received your test emails … and had a response to you bounce.

I am going to take a look at your settings but first a clarification please …

the two test emails that you sent were indeed sent from a DIFFERENT vps than your MiaB install, correct?

Let’s take this over to PM as it is going to be long … we can report on the end result here in this thread later. :slight_smile:

I did again the config for relaying the mail :
I get this error message on the miab vps :

Aug 23 23:14:26 box postfix/smtpd[19601]: connect from XXXXXX
Aug 23 23:14:26 box postfix/smtpd[19601]: warning: restriction `reject_authenticated_sender_login_mismatch' ignored: no SASL support
Aug 23 23:14:27 box postgrey[1184]: action=pass, reason=triplet found, delay=5803, client_name=XXXXXX, client_address=XXXXXX, sender=A@A.com, recipient=recipeintemail@jdsqlkjd.com
Aug 23 23:14:27 box postfix/smtpd[19601]: NOQUEUE: reject: RCPT from XXXXX: Relay access denied; from=<YYYYY> to=<WWWWW> proto=ESMTP helo=<domain.com>
Aug 23 23:14:27 box postfix/smtpd[19601]: disconnect from XXXXXX ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=6/8

All the name / domain / IP looks good.
any idea ?
I check the credential in /etc/postfix/relay_password and they work fine…
thnak you :slight_smile:

Pm me the actual log entry … I think I know what it may be.