sendmail config for jails

alexr

Explorer
Joined
Apr 14, 2016
Messages
59
Pretty much every "how do I" recipe I've seen for common jail needs (plex, etc.) does not configure sendmail. In most cases, it's "disabled," but the reality is that administrative mail is accumulating in each such jail in /var/spool/clientmqueue. (Thousands of them in my experience.)

Since this should be a FAQ, why don't we use this thread to establish a bare minimum sendmail configuration for jails to send to another host?

Note: common advice is to setup a different mailer like ssmtp, but that adds another package to each, whereas sendmail is already present.
 

alexr

Explorer
Joined
Apr 14, 2016
Messages
59
Changes I've had to make thus far:
In /etc/mail/freebsd.submit.mc:
FEATURE(`msp', `[127.0.0.1]') changes to FEATURE(`msp', `mail.mydomain.com') to point at my postfix jail.

In /etc/mail/freebsd.mc:
define(`SMART_HOST', `mail.mydomain.com')

In /etc/hosts:
Fix then entry for 127.0.0.1 to have the proper FQDN for the jail in addition to the short name.

And then:
Code:
sudo -s
cd /etc/mail
make
make install
make restart

Corrections/improvements welcome.
 
Last edited:

diem

Cadet
Joined
Nov 18, 2020
Messages
3
Hi @alexr ,

Bit of a necropost, but given that the thread is a FAQ I figure okay to do so. The only element I'm not sure I understand is your reference to a postfix jail. Is it that you have a local jail setup up purely as a mailserver, whose FQDN is mail.mydomain.com (I appreciate this might be a placeholder for your real domain)?

If that's the case, I assume I won't have success if I instead insert the FQDN of my mail host's SMTP server (Fastmail)?

Thanks,

Ian
 

alexr

Explorer
Joined
Apr 14, 2016
Messages
59
Bit of a necropost, but given that the thread is a FAQ I figure okay to do so. The only element I'm not sure I understand is your reference to a postfix jail. Is it that you have a local jail setup up purely as a mailserver, whose FQDN is mail.mydomain.com (I appreciate this might be a placeholder for your real domain)?
Correct.
If that's the case, I assume I won't have success if I instead insert the FQDN of my mail host's SMTP server (Fastmail)?
I don't see why that couldn't be made to work.
 

diem

Cadet
Joined
Nov 18, 2020
Messages
3
Hi again,

I'm working through configuring sendmail to perform SMTP authentication (seems it needs a SASL library and recompilation for support). In the meantime I think the following is a typo in your first post:

Code:
FEATURE(`map', `mail.mydomain.com')


Should it instead be:

Code:
FEATURE(`msp', `mail.mydomain.com')


Cheers,

Ian
 

alexr

Explorer
Joined
Apr 14, 2016
Messages
59
Hi again,

I'm working through configuring sendmail to perform SMTP authentication (seems it needs a SASL library and recompilation for support). In the meantime I think the following is a typo in your first post:

Code:
FEATURE(`map', `mail.mydomain.com')


Should it instead be:

Code:
FEATURE(`msp', `mail.mydomain.com')


Cheers,

Ian
You are correct; I've updated the post. I'll just blame autocorrect for that substitution, although I can't begin to recall if it was at fault or not. Certainly, it's 'msp' in the files in question and only incorrect on here.
 
Top