code: fqa.9front.org

Download patch

ref: b9b1559f2ac6386a4534400d7ae8babf97d803bd
parent: 2845288628f9012f00d698bb1728254f229fc94d
author: glenda <[email protected]>
date: Wed May 25 21:14:09 EDT 2022

fqa8.ms: 8.4.1.1.2: add steps for rewrite (thanks, chris frschl)

--- a/fqa8.ms
+++ b/fqa8.ms
@@ -982,6 +982,50 @@
 	-a -h $fd $addr $sender $*
 .P2
 
+Read:
+.ihtml a <a href="http://man.9front.org/6/rewrite">
+.CW rewrite(6)
+.ihtml a
+
+To actually use the gateway you have to setup your
+.CW /mail/lib/rewrite
+by including the contents of
+.CW /mail/lib/rewrite.gatway :
+
+.P1
+# by default the return address points to this system; set $site
+# to the name of the mail server that receives your mail in 
+# /rc/bin/termrc and /rc/bin/cpurc.
+#
+# in the last rule, $smtp is the name of the mail server.  set it
+# in the DNS database in /lib/ndb (see ndb(6)).
+
+# translate local aliases from /mail/lib/namefiles
+\"(.+)\"		translate	"/bin/upas/aliasmail '\1'"
+[^!@.]+			translate	"/bin/upas/aliasmail '&'"
+
+# append the local domain to addresses without a domain
+local!"(.+)"		alias		\[email protected]
+local!(.*)		alias		\[email protected]
+
+# convert source domain address to a chain a@b@c@d...
+@([^@!,]*):([^!@]*)@([^!]*)		alias	\e2@\e3@\e1
+@([^@!]*),@([^!@,]*):([^!@]*)@([^!]*)	alias	@\e1:\e3@\e4@\e2
+
+# convert a chain a@b@c@d... to ...d!c!b!a
+([^@]+)@([^@]+)@(.+)	alias		\e2!\e1@\e3
+([^@]+)@([^@]+)		alias		\e2!\e1
+
+# send all mail to the gateway or mail server, $smtp,  for delivery
+([^!]*)!(.*) 	| 	"/mail/lib/qmail '\es' 'net!$smtp'" "'\e2@\e1'"
+.P2
+
+And adjust your
+.CW /lib/ndb/local :
+.P1
+echo smtp=gmail.com >> /lib/ndb/local
+.P2
+
 Before this will work you need to retrieve the certificate hash. This can be done
 by trying to send an e-mail and then looking for the hash in the log:
 .P1