rewrite.gateway 1.1 KB

12345678910111213141516171819202122232425262728293031
  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 '\1'"
  15. [^!@.]+ translate "/bin/upas/aliasmail '&'"
  16. # append the local domain to addresses without a domain
  17. local!"(.+)" alias \1@YOURDOMAIN.DOM
  18. local!(.*) alias \1@YOURDOMAIN.DOM
  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. # send all mail to the gateway or mail server, $smtp, for delivery
  26. ([^!]*)!(.*) | "/mail/lib/qmail '\s' 'net!$smtp'" "'\2@\1'"