[SOLVED] Daily spam reports bounced because relay=local

larsen

Active Member
Feb 28, 2020
155
15
38
I noticed that some spam reports bounce, while others do not:

Code:
Oct  7 00:05:15 pmg postfix/local[247078]: 8D03AC11D3: to=<j.doe@example.com>, relay=local, delay=0.1, delays=0.07/0/0/0.02, dsn=5.1.1, status=bounced (unknown user: "j.doe")

Oct  7 00:05:15 pmg postfix/smtp[247081]: C5DA2C1361: to=<mailings@other.com>, relay=192.168.120.2[192.168.120.2]:2525, delay=0.19, delays=0.08/0/0/0.11, dsn=2.6.0, status=sent (250 2.6.0 <20211006220515.C5DA2C1361@example.com> [InternalId=277545081634831, Hostname=exch.company.local] Queued mail for delivery)

I found this in "/etc/postfix/main.cf":
Code:
mydomain = example.com
myhostname = example.com
mydestination = localhost, $myhostname

Also this, although I have not edited these files!
Code:
# diff /var/lib/pmg/templates/main.cf.in.org /var/lib/pmg/templates/main.cf.in
22,23c22,23
< mydomain = [% dns.domain %]
< myhostname = [% dns.hostname %].[% dns.domain %]
---
> mydomain = example.com
> myhostname = example.com

Don't know where PMG got this value from. I couldn't find anything in the config besides the relay domains.

Code:
# hostname --fqdn
pmg.company.local

# cat /etc/hostname
pmg

# cat /etc/hosts
127.0.0.1   localhost
192.168.120.5   pmg.company.local pmg
# --- BEGIN PVE ---
::1 localhost.localnet localhost
192.168.120.5 pmg.company.local pmg
# --- END PVE ---


What could be the reason that "main.cf.in" contains "example.com"?
Should I simply change the domain in "/var/lib/pmg/templates/main.cf.in" to "company.local"?
 
Also this, although I have not edited these files!
Code:
# diff /var/lib/pmg/templates/main.cf.in.org /var/lib/pmg/templates/main.cf.in
this looks like someone edited the template in /var/lib (this is not done by pmg)

I think the simplest fix would be to reinstall pmg-api (which ships the templates):
`apt install --reinstall pmg-api`

if you really need to override the postfix templates - follow the reference documentation:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine

I hope this helps!
 
I was wrong.
I just found out that I indeed edited the file (via puppet) to change the name PMG sends mail under.

Have changed "myhostname" to "pmg.example.com" now. The spam report gets delivered.

Interestingly, the spam report comes from "postmaster@example.com" although "myorigin = $myhostname", which according to this should lead to "postmaster@pmg.example.com".
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!