From owner-freebsd-questions@freebsd.org Wed Jan 25 20:42:33 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 532D1CC11B0 for ; Wed, 25 Jan 2017 20:42:33 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.fagskolen.gjovik.no", Issuer "Fagskolen i Gj??vik" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C1A73230 for ; Wed, 25 Jan 2017 20:42:32 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.15.2/8.15.2) with ESMTPS id v0PKgLa1024845 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 25 Jan 2017 21:42:22 +0100 (CET) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.15.2/8.15.2/Submit) with ESMTP id v0PKgLAV024842 for ; Wed, 25 Jan 2017 21:42:21 +0100 (CET) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Wed, 25 Jan 2017 21:42:21 +0100 (CET) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: FreeBSD questions Subject: Envelope rewrite by sendmail? Message-ID: User-Agent: Alpine 2.20 (BSF 67 2015-01-07) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.fig.ol.no Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2017 20:42:33 -0000 Hi, I have users with email addresses ending in a long suffix. Combine this with long names in front of the @ sign, and it immediately gets very tedious to type an email address. We have a shorter domain name, and I was thinking of creating a small SMTP server to serve this short domain name and simply forward email to the main SMTP server. It is not possible to switch the main SMTP server to serve the short domain name. Here's an example: A mail messages arrives on the small SMTP server addressed to shorty@short.tld. Sendmail, though the aliases mechanism, forwards the message to long.name@some.incredible.long.domain.name.tld. Antispam measures such as SPF will flag the small SMTP server as not allowed to send email on behalf of the originator. Thus, prior to forwarding each message, the small SMTP server will need to masquerade as the originator and rewrite the envelope's from address to an address within the short.tld domain. Can this be accomplished using sendmail? Would the short address of the receiver suffice or should I use a fixed address regardless of the originator and/or the ultimate receiver? The OS on the small SMTP server will be FreeBSD 11. Any pointers are appreciated. -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ From owner-freebsd-questions@freebsd.org Wed Jan 25 21:44:31 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6937ACC162E for ; Wed, 25 Jan 2017 21:44:31 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from mail-in7.apple.com (mail-out7.apple.com [17.151.62.29]) (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 4ADB6132 for ; Wed, 25 Jan 2017 21:44:30 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from relay4.apple.com (relay4.apple.com [17.128.113.87]) by mail-in7.apple.com (Apple Secure Mail Relay) with SMTP id 4B.D4.14588.4B819885; Wed, 25 Jan 2017 13:29:24 -0800 (PST) X-AuditID: 11973e16-fa0ae9a0000038fc-b5-588918b435d9 Received: from [17.150.217.18] (Unknown_Domain [17.150.217.18]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by relay4.apple.com (Apple SCV relay) with SMTP id 62.1A.29672.3B819885; Wed, 25 Jan 2017 13:29:24 -0800 (PST) From: Chuck Swiger Message-Id: <05907976-C22E-4654-ADE2-40742929E975@mac.com> Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: Envelope rewrite by sendmail? Date: Wed, 25 Jan 2017 13:29:23 -0800 In-Reply-To: Cc: FreeBSD - To: =?utf-8?Q?Trond_Endrest=C3=B8l?= References: X-Mailer: Apple Mail (2.3259) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJLMWRmVeSWpSXmKPExsUi2FAYrrtFojPCYOUKDouXXzexWLxtE3Jg 8piw/g2bx4xP81kCmKK4bFJSczLLUov07RK4Mvo697MXfAmpuNT6iLWB8YZXFyMHh4SAiUTP ciCTi0NIYC+jxM32LtYuRk6w+JWpDxghElOZJBpOvGcESbAJqEgsnvWfGcTmFbCSuDC3gwXE ZhZIknh+aiELRFxfYvaZS2C2sICWxL//zWC9LAKqEv++NLOCLOYUcJA4fc4WolVXounGW7AS EQEvifP9u5hAbCEBe4mbZ7eyQdwjK/H21xJmkHskBBrZJKb0trBPYBSYhWT1LCSrIeLaEssW vmaGsDUl9ncvxyKuIdH5bSLrAka2VYxCuYmZObqZeeZ6iQUFOal6yfm5mxhBYT3dTmwH48NV VocYBTgYlXh4D+zoiBBiTSwrrsw9xCjNwaIkzrvpbnuEkEB6YklqdmpqQWpRfFFpTmrxIUYm Dk6pBkatI982VC2IfVlczKz4e9kS932GHsmXzlnb1kiYBijl1y2qKZx7M2lDYbcGpymD+U7n h4mqxy56LDDMyLrpM4e5bvPJO9vP3tykuP982yG193fn/EtbXGtyT6104WPdrR37Z+nxbOb4 uic9dc4E5baMuxG6kleLxc6ut8u78MlAbtX+b30B+/2VWIozEg21mIuKEwEmX6vJTAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJLMWRmVeSWpSXmKPExsUiOO2mkO4Wic4Ig+0nGS1eft3EYvG2TciB yWPC+jdsHjM+zWcJYIrisklJzcksSy3St0vgyujr3M9e8CWk4lLrI9YGxhteXYycHBICJhJX pj5ghLDFJC7cW8/WxcjFISQwlUmi4cR7sASbgIrE4ln/mUFsXgEriQtzO1hAbGaBJInnpxay QMT1JWafuQRmCwtoSfz73wzWyyKgKvHvSzNrFyMHB6eAg8Tpc7YQrboSTTfegpWICHhJnO/f xQRiCwnYS9w8u5UN4h5Zibe/ljBPYOSbhWTbLCTbIOLaEssWvmaGsDUl9ncvxyKuIdH5bSLr Aka2VYwCRak5iZUmeokFBTmpesn5uZsYQQHaUBi+g/HfMqtDjAIcjEo8vAd2dEQIsSaWFVfm HmKU4GBWEuF9wt0ZIcSbklhZlVqUH19UmpNafIhRmoNFSZy3TBKoWiA9sSQ1OzW1ILUIJsvE wSnVwLi5reDow7uPt/T/ucx92Wq2VPl8B/cX1ZUV1dGxR86pfNf4yb5R4Iqbc19g67efGUIH N19/FM9Qt6j1n3LHtKbKZadXW2i+f77zx6kNDUZ65tnr/Re8kbsTEbhN6yC/07NtVjsU/A4x xF8oimoSd5TheH11gVOwseH5Bq7DN759CY7lf7NDhkuJpTgj0VCLuag4EQBVZZGFTAIAAA== Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2017 21:44:31 -0000 On Jan 25, 2017, at 12:42 PM, Trond Endrest=C3=B8l = wrote: > A mail messages arrives on the small SMTP server addressed to > shorty@short.tld . Sendmail, though the = aliases mechanism, forwards > the message to long.name@some.incredible.long.domain.name.tld = . >=20 > Antispam measures such as SPF will flag the small SMTP server as not > allowed to send email on behalf of the originator. Yes. You will need the admins of some.incredible.long.domain.name.tld = to agree and whitelist your short.tld mailserver if you want it to be a = trusted relay. > Thus, prior to forwarding each message, the small SMTP server will > need to masquerade as the originator and rewrite the envelope's from > address to an address within the short.tld domain. Try not do that, unless both domains belong to you and share a common = namespace for delivery including aliases. Otherwise, =46rom header munging will break = various things, most commonly mailing lists and bounce handling processing. Regards, --=20 -Chuck