From owner-freebsd-questions@freebsd.org Tue Jan 12 14:58:44 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 AD9C04DB38F for ; Tue, 12 Jan 2021 14:58:44 +0000 (UTC) (envelope-from freebsd@boosten.org) Received: from smtpq1.tb.mail.iss.as9143.net (smtpq1.tb.mail.iss.as9143.net [212.54.42.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFYcM1mqvz3NsT for ; Tue, 12 Jan 2021 14:58:42 +0000 (UTC) (envelope-from freebsd@boosten.org) Received: from [212.54.42.134] (helo=smtp10.tb.mail.iss.as9143.net) by smtpq1.tb.mail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzL84-0004xA-Rx; Tue, 12 Jan 2021 15:58:40 +0100 Received: from 84-25-247-31.cable.dynamic.v4.ziggo.nl ([84.25.247.31] helo=smtp.boosten.org) by smtp10.tb.mail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1kzL84-0001v1-K6; Tue, 12 Jan 2021 15:58:40 +0100 Received: from mailserver.boosten.org (localhost [127.0.0.1]) by smtp.boosten.org (Postfix) with ESMTP id E506416976; Tue, 12 Jan 2021 15:58:39 +0100 (CET) X-Virus-Scanned: amavisd-new at boosten.org Received: from amon.boosten.org (amon.boosten.org [192.168.13.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.boosten.org (Postfix) with ESMTPSA id 4C4AE1694C; Tue, 12 Jan 2021 15:58:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 smtp.boosten.org 4C4AE1694C From: freebsd@boosten.org Message-Id: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: Authoritative guide to configuring Sendmail to use a relay for outgoing mail on FreeBSD? Date: Tue, 12 Jan 2021 15:58:35 +0100 In-Reply-To: Cc: freebsd-questions@freebsd.org To: Ottavio Caruso References: X-Mailer: Apple Mail (2.3654.40.0.2.32) X-SourceIP: 84.25.247.31 X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.4 cv=SvcuVNC0 c=1 sm=1 tr=0 ts=5ffdb920 a=JWBJsaPp29SgP5DpYRBqZw==:17 a=EmqxpYm9HcoA:10 a=6I5d2MoRAAAA:8 a=GzhXGCvBx0YeCvzuIyMA:9 a=QEXdDO2ut3YA:10 a=XBvu2zEkEnPKBy_nCJoA:9 a=iM0vjlT1qPGpCuBO:21 a=_W_S_7VecoQA:10 a=IjZwj45LgO3ly-622nXo:22 X-Ziggo-Spam-Status: No X-Spam-Status: No X-Spam-Flag: No X-Rspamd-Queue-Id: 4DFYcM1mqvz3NsT X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:212.54.32.0/19]; DKIM_TRACE(0.00)[boosten.org:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[boosten.org,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[yahoo.com]; RECEIVED_SPAMHAUS_PBL(0.00)[84.25.247.31:received]; SUBJECT_ENDS_QUESTION(1.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.54.42.164:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:33915, ipnet:212.54.32.0/20, country:NL]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(-0.20)[boosten.org:s=myselector]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; SPAMHAUS_ZRD(0.00)[212.54.42.164:from:127.0.2.255]; RCVD_IN_DNSWL_LOW(-0.10)[212.54.42.164:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NO_DN(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.54.42.164:from]; MAILMAN_DEST(0.00)[freebsd-questions] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 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 14:58:44 -0000 > Op 12 jan. 2021, om 15:07 heeft Ottavio Caruso via freebsd-questions = het volgende geschreven: >=20 > Hi, >=20 > For educational purposes [1], I have to answer the question: = "Configure Sendmail [...] to use a relay for outgoing mail. >=20 > It has be sendmail and not a substitute smtp client such as ssmtp or = similar. >=20 > 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. >=20 > 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. >=20 > So, I am basically confused and I wonder if there is a canonical way = to do that on FreeBSD. >=20 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=E2=80=99)dnl Also configure the confDOMAIN_NAME and confHELO_NAME to reflect your = host/domain. Then run =E2=80=98make install=E2=80=99.=20 In my /etc/rc.conf there=E2=80=99s this: sendmail_enable=3D"NO" sendmail_msp_queue_enable=3D"YES" sendmail_outbound_enable=3D"NO" sendmail_submit_enable=3D=E2=80=9CNO" Then run =E2=80=98make restart=E2=80=99 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 =E2=80=94 It never hurts to help=20 - Eek the Cat!