aboutsummaryrefslogtreecommitdiff
path: root/mail/lib/rewrite
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-02-12 19:45:56 +0000
committerrsc <devnull@localhost>2006-02-12 19:45:56 +0000
commit4db31855e7fde9a087fb59e761743420aaa3743b (patch)
tree61b21e62b9a5b50170897a26a96e2c2e2b8a5e29 /mail/lib/rewrite
parenteadb18a3357b9b735b2f7da478854a39fb0c73c6 (diff)
downloadplan9port-4db31855e7fde9a087fb59e761743420aaa3743b.tar.gz
plan9port-4db31855e7fde9a087fb59e761743420aaa3743b.tar.bz2
plan9port-4db31855e7fde9a087fb59e761743420aaa3743b.zip
initial tree
Diffstat (limited to 'mail/lib/rewrite')
-rwxr-xr-xmail/lib/rewrite29
1 files changed, 29 insertions, 0 deletions
diff --git a/mail/lib/rewrite b/mail/lib/rewrite
new file mode 100755
index 00000000..eb3b2691
--- /dev/null
+++ b/mail/lib/rewrite
@@ -0,0 +1,29 @@
+#
+# sample rewrite file for systems that send mail to a mail server or gateway
+# for delivery. we assume the mail server handles incoming messages.
+#
+# by default the return address points to this system; set $site
+# to the name of the mail server that receives your mail.
+#
+# replace YOURDOMAIN.DOM with the name of your domain.
+#
+# in the last rule, $smtp is the name of the mail server. set it
+# in the DNS database in $PLAN9/lib/ndb (see ndb(7)).
+
+# translate local aliases from /mail/lib/namefiles
+[^!@.]+ translate "$PLAN9/bin/upas/aliasmail '&'"
+
+# append the local domain to addresses without a domain
+local!(.*) alias \1@swtch.com
+
+# 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
+
+# send all mail to the gateway or mail server, $smtp, for delivery
+([^!]*)!(.*) | "$PLAN9/mail/lib/qmail '\s' 'tcp!holo.morphisms.net!5356'" "'\2@\1'"
+