Proxmox Mail Gateway as a relay mail server

jmjosebest

Renowned Member
Jan 16, 2009
192
38
93
Hello, Proxmox Mail Gateway can be configured as a relay server in order to filter spam-out?
Thanks!
 
Thanks Tom,

I just ordered and installed, I've been added the sender IP on Mail Proxy > Networks

Code:
root@pmg:~# cat /etc/pmg/mynetworks
185.47.128.0/22 #
188.213.4.0/22 #
5.134.112.0/21 #
root@pmg:~#


But I'm getting error Relay access denied

What is wrong?

Thanks


Code:
LOG: MAIN
  cwd=/usr/local/cpanel/whostmgr/docroot 4 args: /usr/sbin/exim -v -M 1eh97F-00027l-6s
delivering 1eh97F-00027l-6s
LOG: MAIN
  Sender identification U=ginernet D=ginernet.com S=jm@ginernet.com
Connecting to pmg.ginernet.com [188.213.5.77]:25 from 5.134.116.16 ... connected
  SMTP<< 220 pmg.ginernet.com ESMTP Proxmox
  SMTP>> EHLO ginernet.com
  SMTP<< 250-pmg.ginernet.com
         250-PIPELINING
         250-SIZE 10485760
         250-VRFY
         250-ETRN
         250-STARTTLS
         250-ENHANCEDSTATUSCODES
         250-8BITMIME
         250 SMTPUTF8
  SMTP>> STARTTLS
  SMTP<< 220 2.0.0 Ready to start TLS
LOG: MAIN
  [188.213.5.77] SSL verify error: depth=0 error=self signed certificate cert=/OU=Proxmox Mail Gateway/O=ginernet.com/CN=*.ginernet.com
  SMTP>> EHLO ginernet.com
  SMTP<< 250-pmg.ginernet.com
         250-PIPELINING
         250-SIZE 10485760
         250-VRFY
         250-ETRN
         250-ENHANCEDSTATUSCODES
         250-8BITMIME
         250 SMTPUTF8
  SMTP>> MAIL FROM:<jm@ginernet.com> SIZE=1833
  SMTP>> RCPT TO:<ginernet@outlook.com>
  SMTP>> DATA
  SMTP<< 250 2.1.0 Ok
  SMTP<< 454 4.7.1 <ginernet@outlook.com>: Relay access denied
  SMTP<< 554 5.5.1 Error: no valid recipients
  SMTP>> QUIT
  SMTP(close)>>
LOG: MAIN
  == ginernet@outlook.com R=smarthost_dkim T=remote_smtp_smart_dkim defer (-44) H=pmg.ginernet.com [188.213.5.77]: SMTP error from remote mail server after RCPT TO:<ginernet@outlook.com>: 454 4.7.1 <ginernet@outlook.com>: Relay access denied
 
Did you add your internal IP on:

"Configuration/Mail Proxy/Networks: Trusted Networks"
 
Also, the default port for outgoing mail (trusted) is 26. If you want to relay mails, you need toö connect to that port.
 
On my source server, I've changed the port to 26, and I get a Connection refused error:

Code:
LOG: MAIN
  cwd=/usr/local/cpanel/whostmgr/docroot 4 args: /usr/sbin/exim -v -M 1eh97F-00027l-6s
delivering 1eh97F-00027l-6s
LOG: MAIN
  Sender identification U=ginernet D=ginernet.com S=jm@ginernet.com
Connecting to pmg.ginernet.com [188.213.5.77]:26 from 5.134.116.16 ... failed: Connection refused
LOG: MAIN
  H=pmg.ginernet.com [188.213.5.77] Connection refused
LOG: MAIN
  == ginernet@outlook.com R=smarthost_dkim T=remote_smtp_smart_dkim defer (111): Connection refused
 
maybe a firewall in between?

Yes, my mistake.
And all this relayed emails are filtered by the antispam?

I've tried to forward a spam email and has not been blocked.
Also, in Statics > Spam Score all counts are zero, including the Score 0 value.

Maybe relayed emails are not scanned?
 
Yes, my mistake.
And all this relayed emails are filtered by the antispam?

I've tried to forward a spam email and has not been blocked.
Also, in Statics > Spam Score all counts are zero, including the Score 0 value.

Maybe relayed emails are not scanned?
I have the same problem where relayed mails are not filtered by the antispam and proxmox is consdering them as all outbound mail.

How did you resolve this?
 
I have the same problem where relayed mails are not filtered by the antispam and proxmox is consdering them as all outbound mail.
a) next time please open a new thread than replying to one that has not seen any activity in a long time ..

b) If PMG sees the mails as outbound then they arrive on the internal port (GUI->Configuration->Mail Proxy)
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#chapter_deployment

Make sure you have the correct ports configured and that the FIrewall and NAT rules in your network are correct

I hope this helps!
 

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!