Mailserver in Jail

trek102

Dabbler
Joined
May 4, 2014
Messages
46
Has anyone created a Jail with a mail server for Truenas?
Should not be too difficult but I thought someone mut have done that.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Create jail. Mail server included. Seriously - FreeBSD comes with Sendmail.

It depends on what precisely you mean by "mail server". If you want something with SMTP and IMAP, including user management and authentication, possibly a web UI - then, no. FreeBSD does not include that out of the box. So what are you looking for?
 

rvassar

Guru
Joined
May 2, 2018
Messages
972
Sendmail is a bit of a chore to configure.

But more to the point, it's getting difficult to run a small mail server these days. You need to be more specific in what you intend to do.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
E.g. if you want a "everything and the kitchen sink" commercial product, may I recommend Axigen? You would need a Linux VM (I'd use Ubuntu) to run it, but then you get a slick modern admin and user interface and about everything people commonly associate with "mail server". I'm mentioning them because they have a free edition (free as in beer, no source) as long as 5 domains, 5 users, 5 groups are sufficient for you.
 

trek102

Dabbler
Joined
May 4, 2014
Messages
46
I am looking for an SMTP/IMAP server that I can point my domain to (incl TLS). Thats all.
No need for web UI. Once the server is configured it should just run.
There are rarely any new users being added so I can do this via CLI.
 

rvassar

Guru
Joined
May 2, 2018
Messages
972
I am looking for an SMTP/IMAP server that I can point my domain to (incl TLS). Thats all.

You need:
1. A static IP address capable of exchanging email. Residential ISP's will block this straight away.
2. A domain with correct SOA & "glue", MX record, acceptable rDNS PTR record (i.e no "dsl-" or "pppoe-" anything in the PTR record), etc...
3. Postfix & Dovecot are probably the easiest MTA & IMAP to configure.
4. You will need OpenDKIM and publish a DKIM record in your domain's DNS.
5. You will need to publish a SPF record in your domain's DNS.

After all that, it will take a month or so of good behavior for the major ISP's to accept email from your server. Get any of it wrong, and they drop you on the floor. I'm not making any of this up either... Storage is a second career for me. I have 16+ years in telco scale email.
 

trek102

Dabbler
Joined
May 4, 2014
Messages
46
thanks. 1-2 and 4-5 is all fine. Only issue might be point 3.
Is there a Jail for Dovecot/Postfix available?
Do I put this into a virtual machine or Jail?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Install standard vnet jail. Execute pkg install dovecot postfix inside the jail. Proceed from there.
Vnet jails are complete standard FreeBSD runtime environments. No need for a special "dovecot/postfix jail".
I run Nextcloud, Gitea, Guacamole, MineOS, Monit, Observium, ... each in their own jail. Just pkg install ...

Got to get your networking right, of course. So if you struggle with that, just come back.
 
Top