Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2021 18:56:31 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Ottavio Caruso <ottavio2006-usenet2012@yahoo.com>
Cc:        Ottavio Caruso via freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Authoritative guide to configuring Sendmail to use a relay for outgoing mail on FreeBSD?
Message-ID:  <20210112185631.b34d393f.freebsd@edvax.de>
In-Reply-To: <rtkl8b$dsu$2@ciao.gmane.io>
References:  <rtkafk$mp8$1@ciao.gmane.io> <D73191D9-2E89-4C81-8636-DBD3CEAF5A6F@boosten.org> <20210112175322.b35d6ea7.freebsd@edvax.de> <rtkl8b$dsu$2@ciao.gmane.io>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 12 Jan 2021 17:11:39 +0000, Ottavio Caruso via freebsd-questions wrote:
> On 12/01/2021 16:53, Polytropon wrote:
> > On Tue, 12 Jan 2021 15:58:35 +0100, Peter Boosten via freebsd-questions wrote:
> >> 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.
> > 
> > In the past, I have been using my ISP's mail relay until they
> > cut support for that. In order to have all outgoing messages
> > to be sent through the ISP's relay (instead of having my own
> > sendmail doing that, especially from behind a dynamic IP), I
> > had the followint setting in /etc/mail/`hostname`.mc:
> > 
> > 	define(`SMART_HOST', `mx.example.com')
> > 
> > where mx.example.com is the mail relay I wanted to use, and
> > it worked for all systems from within the network of the ISP.
> > With a "make install", the setting was activated, and it worked
> > for many happy years. :-)
> 
> How did you create /etc/mail/`hostname`.mc? By copying and editing or by 
> running make in /etc/mail?

Simply run

	# make

in /etc/mail, this will generate the hostname-based files
according to the templates. Do not edit the templates, just
edit the .mc files with your hostname, then run

	# make install

to put them into action. Refer to the commend header of
/etc/mail/Makefile where xou can find an explanation of the
different targets (all, cf, maps, aliases, install, start,
stop, restart).



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210112185631.b34d393f.freebsd>