Postfix configuration, OpenVZ container

IceManSpy

Member
Apr 15, 2015
4
0
21
Poland
Hi

I need help with Proxmox configuration and mail server-container based on OpenVZ. I made many conbination to run, but not successful.

I would like to configure container as a mail server. I have installed postfix and dovecot from this tutorial:
https://www.howtoforge.com/perfect-server-debian-wheezy-nginx-bind-dovecot-ispconfig-3-p3

Also, I've installed ISPConfig 3 and roundcube.

I've forward 110, 143, 465, 587, 993, 995 ports to container.

When I forward 25 port to container, I can or can't receive or send mail.

if I forward this port I can receive but I can't send mail. If I don't forward, situation is opposite.

I've read that Proxmox has preinstalled postfix to send by him - smarthost.

I don't know, which I have to configure as smarthost - host or container ?
How can I create container to receive and send mail ?

Please, I need any tips or advice to configure this.
 
I don't know your network configuration, but I've done this using a bridged network interface in the CT so it appears to the network like any other computer (and I set it with a static address too.) This skips anything the host might otherwise be doing to the network traffic.
 
I have only 1 public IP address, so I can't bridged network.
I have default configuration after Proxmox install in OVH.
Containers connect over NAT.
 
Hi

When I forward 25 port to container, I can or can't receive or send mail.

if I forward this port I can receive but I can't send mail. If I don't forward, situation is opposite.

Sounds like your ISP is filtering outgoing communication on port 25.
Many ISPs nowdays do that. This is to prevent compromised computer systems from becoming spam bots.

Check your ISP's FAQ page or tech support docs.

You are suppose to use 587 now... but even then best of good luck to ya, buddy! :)
Some ISPs choose to black list their own "residential" service IP ranges in DNS blacklists. As in to designate that these IPs shouldn't be sending out emails.

Depending on SMTP config on receiving end, you may never be able to successfully deliver emails to some domains.
Running your own email server from home is pretty much no-go thanks to spammers.
 
Last edited:
My provider doesn't block 25 port.
I ask the same question on another forum and the solution is:
iptables -t nat -A PREROUTING -i vmbr0 -p tcp -d PUBLIC_IP --dport 25 -j DNAT --to-destination CONTAINER_IP:25

At now, I can receive and send mails :)
 

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!