rewrite.direct 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #
  2. # sample rewrite file for systems that send and receive mail directly.
  3. #
  4. # by default, the return address points to this system; if you have multiple systems
  5. # and don't want them all to be mail recipients, set $site to a generic
  6. # name (e.g., plan9) or system name in /rc/bin/termrc and /rc/bin/cpurc
  7. # and put an MX DNS record in /lib/ndb to point to that system.
  8. #
  9. # replace YOURDOMAIN.DOM in the following rules with your domain name.
  10. # translate local aliases from /mail/lib/namefiles
  11. \"(.+)\" translate "/bin/upas/aliasmail '\1'"
  12. [^!@.]+ translate "/bin/upas/aliasmail '&'"
  13. # deliver mail without a domain locally
  14. local!"(.+)" >> /mail/box/\1/mbox
  15. local!(.*) >> /mail/box/\1/mbox
  16. # your local names
  17. \l!(.*) alias \1
  18. \l\.YOURDOMAIN\.DOM!(.*) alias \1
  19. # convert source domain address to a chain a@b@c@d...
  20. @([^@!,]*):([^!@]*)@([^!]*) alias \2@\3@\1
  21. @([^@!]*),@([^!@,]*):([^!@]*)@([^!]*) alias @\1:\3@\4@\2
  22. # convert a chain a@b@c@d... to ...d!c!b!a
  23. ([^@]+)@([^@]+)@(.+) alias \2!\1@\3
  24. ([^@]+)@([^@]+) alias \2!\1
  25. # queue all mail for delivery
  26. ([^!]*)!(.*) | "/mail/lib/qmail '\s' 'net!\1'" "'\2'"