From owner-freebsd-questions@freebsd.org Tue Jan 12 17:56:37 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 5631A4E0BF9 for ; Tue, 12 Jan 2021 17:56:37 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFdYc1g4hz3wLV for ; Tue, 12 Jan 2021 17:56:35 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.27.40]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPA (Nemesis) id 1MDQmW-1kq0Fd3up4-00AaEQ; Tue, 12 Jan 2021 18:56:32 +0100 Date: Tue, 12 Jan 2021 18:56:31 +0100 From: Polytropon To: Ottavio Caruso Cc: Ottavio Caruso via freebsd-questions 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: References: <20210112175322.b35d6ea7.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:2zB9MLt9BsvIja672eTl2j+BzMwUjF7tbNI+tOrL3VQfVEuuu18 0HY8ORy2dpHbjyNIQ4XzYp1v6qxroJHLmYfRjTHjHgaiGQXYTNby+CkEY0TU2d95yYMIEAA DQ9UZAz2BicJBvjDuIQIxIV4N/ShddHdyMgm2dyNixUBf8emDpkYwmMXugvmdQwf3yim//q Hq/GmW+lk+P6FC8k7PTLw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:FAsRZCM/3uY=:bkF4bRqJ5amgVGdGiIFipT 35hNy/0qIzNfhoRhDyFFHWSBB1gria4xJY08h1KWx3p3Zi41wswA/u0omhJsf4dZOFZubE9KL 1EfSzs8F0k7MuvN9LIX4oyAwvv/30uzXaKZe/AtuqZlKbyega+QCCS/+mcTQfzOfCtwRDQ//U PhkTM2tCXFE9dyzrBF80l4y0mn88o0yMThOtN+ODVYu2AOrgIBmSSyLYqychoWsExpa9M0c1m g7ukKJ1B/lRaXr+iV/f8oHyLbuiweDcd3XgzAjvo+ClYjKEbya6RoIdJMiNVr80O9BCoU2mF5 KaS9OUoQh3OoC15Wq4hQUd0097ETnDa9uzEqOv0PxaJOwVnyxWTEJmhgU8hM1XPFeVkBoJiWh c4NjLs6+p4oNb4Ja++aj3jPOpYSxjsZ2KYnSseg/HhgJUIry7GwLetAguQR8v X-Rspamd-Queue-Id: 4DFdYc1g4hz3wLV X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 217.72.192.73) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [1.01 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[217.72.192.73:from]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.39)[-0.388]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[yahoo.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:217.72.192.0/20, country:DE]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[217.72.192.73:from]; RECEIVED_SPAMHAUS_PBL(0.00)[94.222.27.40:received]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; SPAMHAUS_ZRD(0.00)[217.72.192.73:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[217.72.192.73:from]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_TWO(0.00)[2]; 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:56:37 -0000 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, ...