Configure Email correctly for second domain

Hello, on my Proxmox server I have set up a 2 container with Ubuntu 18.04.

I have successfully installed MIAB on the one container (a big THANK to Josh at this point for the great work) and it works wonderfully.

I installed LAMP on the other container and the phpbb forum. As a name server, I gave that from MIAB. then I created a user and the DNS settings were created automatically by MIAB. As far as everything works.

My questions now.

1.) How do I set it that makes the “Forum CT” the email traffic through the MIAB. e.g. That if new users should register in the forum which receive an email and should not land in SPAM if possible.

2.) I also have Fail2ban installed on the “Forum Container” and would like to be notified by email.

Many Thanks

Sakis

This is just a random guide from the internet explaining how to use a SMTP relay:

Please note that MiaB uses port 587, not 465! You will need to add the email address that you want to use for the forum as a user of MiaB before you change the settings on PhpBB.

Fail2Ban may also support a SMTP relay - I do not know…

Thank you for your Answer.

I’m trying to create relaying following this tutorial https://mailinabox.email/advanced-configuration.html.

The problem is that the “Forum Container” always takes the FQDN to send the email and therefore always this error message comes:

<root@forum.example.com>: Sender address rejected: Domain not found

What should I do so he always example.com instead forum.example.com takes.

Create an email account using the FQDN. i…e. forum@forum.example.com

Hello this is a solution but not the best. I want to use info@example.com, not info@forum.example.com

somehow the problem can be regulated with the Postfix settings (main.cf, aliases etc.) but I do not know exactly which settings I have to make.

Are you certain that you have the sending email address correctly configured in PhpBB? You need to determine why the “Forum Container” always takes the FQDN and solve that issue. You have a ‘garbage in, garbage out’ issue.

I am not suggesting that there is no other fix by manipulating postfix, however if you do so then it will be an unsupported modification and will break every time you upgrade MiaB - so that would not be recommended.

Now phpbb is handling the emails correctly via the Relay, only I can not get any notifications for eg. fail2ban.

With the changes to the Postfix, I actually meant the “Forum Container” and not the “MIAB Container”.

I did a little poking around when you made your OP … Fail2ban seemingly does not support smtp cleanly. There are a couple of tutorials out there that you can possibly use to solve this issue.

fail2ban can log to /var/mail/root right? if so then just have the root account forward to name@domain.com

Thank you for your help and the tips.
The error was due to the hostname or when setting up the Proxmox container.

After I created a new container with the hostname “example.com” everything ran without problems.

1 Like

I wonder if just adding

127.0.0.1    example.com

to /etc/hosts would have been enough to resolve the issue?

Unfortunately, I can not give it a try anymore because I’ve already deleted the container, but now that you say it, it should normally work!

What I noticed, according to this manual “https://mailinabox.email/advanced-configuration.html” is the following should be entered in the main.cf

mydestination
smtp_tls_security_level = verify
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash: / etc / postfix / relay_password
smtp_sasl_tls_security_options =

but the entry “mydestination =” is already available to me, should take the way and instead of the instructions?