Authoritative guide to configuring Sendmail to use a relay for outgoing mail on FreeBSD?

freebsd at boosten.org freebsd at boosten.org
Tue Jan 12 14:58:44 UTC 2021



> Op 12 jan. 2021, om 15:07 heeft Ottavio Caruso via freebsd-questions <freebsd-questions at freebsd.org> het volgende geschreven:
> 
> Hi,
> 
> For educational purposes [1], I have to answer the question: "Configure Sendmail [...] to use a relay for outgoing mail.
> 
> It has be sendmail and not a substitute smtp client such as ssmtp or similar.
> 
> According to [2], it seems I have to edit sendmail.cf; however. according to an older post on this list [3], one would have to run "make" in /etc/mail and then edit the generated file, presumably `hostname`.mc.
> 
> On IRC (freenode/#freebsd), I have been told that I can edit any .mc files, then run "make" and that will generate an .cf file. For example freebsd.mc >> freebsd.cf.
> 
> So, I am basically confused and I wonder if there is a canonical way to do that on FreeBSD.
> 


Basically all my jails use another jail as mail hub:

Change /etc/mail/freebsd.submit.mc to reflect the correct mail hub

FEATURE(`msp', `[your.smart.host]', `MSA’)dnl

Also configure the confDOMAIN_NAME and confHELO_NAME to reflect your host/domain.

Then run ‘make install’. 

In my /etc/rc.conf there’s this:

sendmail_enable="NO"
sendmail_msp_queue_enable="YES"
sendmail_outbound_enable="NO"
sendmail_submit_enable=“NO"

Then run ‘make restart’ in your /etc/mail directory.

This basically makes the machine not accept email from outside (only from the machine itself) and forwards everything to your smart host.

Peter

—
It never hurts to help 
      - Eek the Cat!






More information about the freebsd-questions mailing list