rewrite.gateway 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #
  2. # sample rewrite file for systems that send mail to a mail server or gateway
  3. # for delivery. we assume the mail server handles incoming messages.
  4. #
  5. # by default the return address points to this system; set $site
  6. # to the name of the mail server that receives your mail in
  7. # /rc/bin/termrc and /rc/bin/cpurc.
  8. #
  9. # replace YOURDOMAIN.DOM with the name of your domain.
  10. #
  11. # in the last rule, $smtp is the name of the mail server. set it
  12. # in the DNS database in /lib/ndb (see ndb(6)).
  13. # translate local aliases from /mail/lib/namefiles
  14. [^!@.]+ translate "/bin/upas/aliasmail '&'"
  15. # append the local domain to addresses without a domain
  16. local!(.*) alias \1@YOURDOMAIN.DOM
  17. # convert source domain address to a chain a@b@c@d...
  18. @([^@!,]*):([^!@]*)@([^!]*) alias \2@\3@\1
  19. @([^@!]*),@([^!@,]*):([^!@]*)@([^!]*) alias @\1:\3@\4@\2
  20. # convert a chain a@b@c@d... to ...d!c!b!a
  21. ([^@]+)@([^@]+)@(.+) alias \2!\1@\3
  22. ([^@]+)@([^@]+) alias \2!\1
  23. # send all mail to the gateway or mail server, $smtp, for delivery
  24. ([^!]*)!(.*) | "/mail/lib/qmail '\s' 'net!$smtp'" "'\2@\1'"