[comp.soft-sys.andrew] Problem with posting to bulletin boards.

grahamd@otc.otca.oz.AU (Graham Dumpleton) (02/28/90)

I have setup a private bulletin board in my account but I am having
problem when is comes to giving post permissions to particular folders.
The problems are that messages isn't recognising when it cannot post to
a bulletin board and is also not getting the address to send the item to
correct; ie. it doesn't seem to be getting the information out of the
.MS.DirectPost file.

I will explain everything I did; it may even help someone who wishes to
do something similar.

The main reason for creating a private bulletin board was to make all
the mail which I get from the Andrew mailing list readable to other
users at out site. So I followed the procedure detailed in the help
document 'privatebb', namely:

1.  Create a directory for the bboard

I called this .MESSAGES_PUBLIC and put it in my home directory.

2.  Add the directory to your mspath

Added mspath: $MAIL:~/.MESSAGES_PUBLIC

3.  Set the access rights for the directory

Didn't apply as we don't have AFS

4. Create the actual bboard folder

Did this and called it info-andrew

5.  Enable direct posting to the bboard

Didn't do this quite yet

6.  Let people know that you have created a new bboard

Mailed everyone with an invitation to subscribe

I now wanted to have any mail coming from the Andrew mailing list
automatically go into this folder so I created a .AMS.flames file
containing

(defun grahamd-mail-hook	(msg)
  (post-by-keyword
   msg
   "mail"
   '(
     (("to")("info-andrew")("/u/sysdev/grahamd/.MESSAGES_PUBLIC/info-andrew"))
     )))

(load "flib") ; The standard flames library

This all worked fine so I decided to go whole hog with the bulletin
board stuff and set it all up properly. This generally means having an
.AMS.flames file with something like the following:

(defun grahamd-mail-hook (msg)
  (process-mapped-mailbox
   msg
  "/u/sysdev/grahamd/.MESSAGES_PUBLIC/"
   "grahamd\\+"
   '("to" "cc" "resent-to" "resent-cc" "received" "x-bb")
   "mail"
   (ReplyAddr msg "s")
   "grahamd@otc"
   "Message rejected:  could not write to bboard"
  )
)
(load "flib")

Note that we don't have the Andrew delivery system running so
grahamd+info-andrew is not valid, instead we have to have
"grahamd+info-andrew" <grahamd> on the To: line.

The problem is that I couldn't work out how to make both this scripts
work together directly so I ended up with the following; if someone has
a better way then please tell me.

(defun grahamd-mail-hook (msg)
  (progn
   (cond
    ((a-pat-in-any-str "info-andrew" (getheadercontents msg "to"))
     (addheader msg "X-bb: grahamd+info-andrew"))
    (T NIL)
   )
   (process-mapped-mailbox 
    msg 
    "/u/sysdev/grahamd/.MESSAGES_PUBLIC/"
    "grahamd\\+"
    '("to" "cc" "resent-to" "resent-cc" "received" "x-bb")
    "mail" 
    (ReplyAddr msg "s")
    "grahamd@otc" 
    "Message rejected:  could not write to bboard"
    )
   )
  )

(load "flib") ; The standard flames library

This all worked fine, info-andrew mail went into the correct folder as
did anything which was sent to grahamd+*. I now went to set up
.MS.DirectPost files and I started getting problems.

I created a new folder called 'test' and placed in it an .MS.DirectPost
file containing the following:

0
"grahamd+*" <grahamd>

as described in the privatebb help file.  When I went to post something
though it did not get the address correct, it would put up To:
test@otc.otca.oz, I tried making the second line just "grahamd+test" and
it sill wouldn't work. I then tried other things such as putting some of
the 'post nopost createsub nocreatesub' options on the first line also
but couldn't make anything work. It just wouldn't get the address nor
would it stop me from posting to a bulletin board which I couldn't.

Does anyone have any ideas about what I have missed. I have up to patch
level 3 applied using Version 3 of Andrew.

Graham Dumpleton (grahamd@otc.otca.oz.au)

nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) (03/01/90)

Hmm...  One obvious possibility is that "test" is already a legitimate
user id or global or personal alias on your system.  Another possibility
is that you've got AMS_OnlyMail: 1 set in your configuration, though I
don't *think* that would explain this one.   Another possibility is that
you don't have your *.mspath preference right.

I suggest trying the following:  Run the cui program and type:

set level wizard
set term 0
set debug 0 0 0 -1
whois test

The "whois" command is simply a test/probe into the address validation
routines.  Doing this with messagserver debugging turned on will produce
some voluminous output.  If the output doesn't make the problem clear,
then you could at least post the output to this mailing list and it is
more likely that someone will be able to diagnose it better.  Good luck.
 -- Nathaniel

tom@ICASE.EDU (Tom Crockett) (03/03/90)

Excerpts from info-andrew: 28-Feb-90 Problem with posting to bul..
Graham Dumpleton@uunet.u (3876)

> Does anyone have any ideas about what I have missed.

I don't know about your specific problem, but if I try to post to a
bulletin board from sendmessage, it puts the wrong thing in the "To:"
field after it validates the address (seems to be getting stuff from
/etc/passwd for the owner of the bulletin board).  If I send mail to the
bboard from within messages, then everything is fine and it gets sent to
exactly what I specify in the second line of the .MS.DirectPost file. 
Is this a bug, or a feature, and if so, what is the rationale?

-Tom

nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) (03/03/90)

What's going on here is a mismatch between the way AMS runs with and
without AMDS (the AMS Delivery system, useful only if you have the
Andrew File System).    Not surprisingly, the mechanisms were optimized
for the AMDS environment; I have found it possible to make them work,
albeit with a few oddities, in a non-AMDS environment.

First, you have to understand a wee bit about the process of AMS address
validation.  If you put a bboard name on a To: or CC: line in
sendmessage, this will get transformed into a posting address according
to the proper .MS.DirectPost file.  All this stuff works just fine.  The
oddity only begins to happen if your direct post file sends stuff back
to a "local" user -- e.g. your bboard account.

In that case, what happens under various circumstances is that the
address can get RE-validated.  That is, the output of the validation
process becomes the input for another validation process.  This turns
out to be fine in AMDS-style bboards, where the "local" address  is
something like "bb+bboard-name", because the software knows that the
+suffix is something important and to be preserved.  However, in
non-AMDS situations, we typically run a bboard system with posting
addresses like

"bb+foobar" <bb@mysite>

Unfortunately -- and I guess this could be considered a bug to be
patched, ITC people -- the validation software considers the route
phrase "bb+foobar" to be something it can safely throw away.  

Fortunately, there is a workaround.  Just use a posting address that
doesn't precisely match your local value of ThisDomain.  For example, at
Bellcore ThisDomain is "thumper.bellcore.com".  This means that I might
have problems if I put either of the following in my .MS.DirectPost file:

"bb+foobar" <bb>
"bb+foobar" <bb@thumper.bellcore.com"

However, the trick I use is to use a host name that AMS doesn't think of
as local, but that sendmail does.  In my case, my .MS.DirectPost files
read more like

"bb+foobar" <bb@thumper>

This is validated as an external address, and hence not rewritten at all
-- just what the doctor ordered!

So, the bottom line is:  there is a bug in validation in that it throws
away route phrases (and comments!) in local RFC822 addresses when it
validates them.  This should be fixed, but meanwhile the workaround is
to set up your .MS.DirectPost files so that they don't look like "local"
addresses, which you can do by using some alias for your local host name.

Hope that's helpful and clarifying.  -- Nathaniel