From owner-freebsd-questions@freebsd.org Tue Jan 12 17:15:05 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 102BE4DF9C4 for ; Tue, 12 Jan 2021 17:15:05 +0000 (UTC) (envelope-from freebsd-questions@m.gmane-mx.org) Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFcdh3X0Dz3rN0 for ; Tue, 12 Jan 2021 17:15:04 +0000 (UTC) (envelope-from freebsd-questions@m.gmane-mx.org) Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kzNG1-0004g3-UG for freebsd-questions@freebsd.org; Tue, 12 Jan 2021 18:15:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Ottavio Caruso Subject: Re: Authoritative guide to configuring Sendmail to use a relay for outgoing mail on FreeBSD? Date: Tue, 12 Jan 2021 17:11:39 +0000 Message-ID: References: <20210112175322.b35d6ea7.freebsd@edvax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 In-Reply-To: <20210112175322.b35d6ea7.freebsd@edvax.de> Content-Language: en-GB X-Rspamd-Queue-Id: 4DFcdh3X0Dz3rN0 X-Spamd-Bar: +++++ X-Spamd-Result: default: False [5.25 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_REJECT(2.00)[yahoo.com : SPF not aligned (relaxed), No valid DKIM,reject]; FORGED_SENDER(0.30)[ottavio2006-usenet2012@yahoo.com,freebsd-questions@m.gmane-mx.org]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[116.202.254.214:from]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[ottavio2006-usenet2012@yahoo.com,freebsd-questions@m.gmane-mx.org]; ASN(0.00)[asn:24940, ipnet:116.202.0.0/16, country:DE]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.75)[-0.747]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[116.202.254.214:from:127.0.2.255]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_COUNT_TWO(0.00)[2]; GREYLIST(0.00)[pass,meta]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 17:15:05 -0000 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? -- Ottavio Caruso