From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Sun Oct 4 19:35:53 -0400 2020 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id c7806134 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Sun, 4 Oct 2020 16:35:45 -0700 (PDT) Message-ID: <763FCEEB41D2EEBA2CDB9E95648C5D01@eigenstate.org> To: 9front@9front.org Subject: rewrite rules -- explanations? Date: Sun, 04 Oct 2020 16:35:44 -0700 From: ori@eigenstate.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: mobile framework-based engine I'm looking at simplifying our default mail configuration, and I don't understand what some of our rules are doing. I'm aware that email has a messy history, but I don't know enough to know what the goal of some of the rules are and whether they're stil relevant. This one makes sense to me: substitute aliases. # translate local aliases from /mail/lib/namefiles \"(.+)\" translate "/bin/upas/aliasmail '\1'" [^!@.]+ translate "/bin/upas/aliasmail '&'" This one kind of makes sense, though if we encourage people to use 'upasname', it seems unnecessary to put in here by default. The new remotemail script works if we don't do this rewrite. # append the local domain to addresses without a domain local!"(.+)" alias \1@YOURDOMAIN.DOM local!(.*) alias \1@YOURDOMAIN.DOM The following two don't make much sense to me: What generates chains of '@'s, and why do we convert to them before converting to '!'? Is this something old email servers used to generate? Is it still relevant? # convert source domain address to a chain a@b@c@d... @([^@!,]*):([^!@]*)@([^!]*) alias \2@\3@\1 @([^@!]*),@([^!@,]*):([^!@]*)@([^!]*) alias @\1:\3@\4@\2 # convert a chain a@b@c@d... to ...d!c!b!a ([^@]+)@([^@]+)@(.+) alias \2!\1@\3 ([^@]+)@([^@]+) alias \2!\1 And, sending the email makes sense: # send all mail to the gateway or mail server, $smtp, for delivery ([^!]*)!(.*) | "/mail/lib/qmail '\s' 'net!$smtp'" "'\2@\1'"