9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* (no subject)
@ 2000-07-04 15:44 bobf
  0 siblings, 0 replies; only message in thread
From: bobf @ 2000-07-04 15:44 UTC (permalink / raw)
  To: 9fans

Re: [9fans] /mail/lib/rewrite

> In /mail/lib/rewrite we will find the line:
> ([^!]*)!(.*) 		| 		"/mail/lib/qmail '\s' 'net!$smtp'" "'\2@\1'"
>
> The corresponding line of second edition was:
> ([^!]*)!(.*) 		| 		"/mail/lib/qmail '\s' 'net!\1'" "'\2'"
>
> In man page, we will find examples of usage of /mail/lib/qmail:
>          ([^!]*.bell-labs.com)!(.*)  |  "/mail/lib/qmail '\s' 'net!\1'" "'\2'"
> and
>          /mail/lib/qmail presotto net!plan9.bell-labs.com ken rob
>
> Where and how can we define $smtp ?

$smtp is defined in the ndb network database; see ndb(6).

$smtp need only be set if your plan 9 system passes all outgoing mail
to another gateway system for delivery.  both prototype rewrite files in
/mail/lib contain a rewrite rule to do this.  however, if you wish
for your system to deliver all mail directly, then replace the rule:

([^!]*)!(.*) 		| 		"/mail/lib/qmail '\s' 'net!$smtp'" "'\2@\1'"

with

([^!]*)!(.*) 		| 		"/mail/lib/qmail '\s' 'net!\1'" "'\2'"

in the rewrite file.

further, if you wish for your plan 9 server to receive messages from other
systems, you will need to use /mail/lib/rewrite.gateway as your prototype
file and add the following rules behind the rule that does local delivery:

# our names
\l!(.*)					alias		\1
(\l\.)?YOURDOMAIN\.DOM!(.*)		alias		\2

these rules strip your system/domain name from the recipient address
to allow the user name to resolve to a mailbox.  replace YOURDOMAIN.DOM
by your domain name and don't forget to escape the '.' characters.

finally, /mail/lib/remotemail is needlessly complex.  i suggest that
you replace

> fd=`{/bin/upas/aliasmail -f $sender}
> switch($fd){
> case *.*
> 	;
> case *
> 	fd=yourdomain.dom
> }


with

fd=YOURDOMAIN.DOM

where YOURDOMAIN.DOM is the domain that you want in the From: line of
outgoing mail.  this should be the same as the YOURDOMAIN.DOM string
in the rewrite rules given above.

i haven't been able to test these changes, so you might have to play
with them a little.

i hope to reorganize the prototype rewrite files and put all of the
changes in the next update to the distribution.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-07-04 15:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-04 15:44 bobf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).