[AOLSERVER] ns_sendmail

2002-11-01 Thread Wes James
I am trying to get ns_sendmail to work on redhat 8.0 with aolserver 3.5.

in the adp file I am using:
%
set formdata [ns_conn form $conn]

if {$formdata == } {
ns_return $conn 200 text/plain Need form data!
return
}

# Build up a human-readable representation of the form data.

set hrformdata pre
set size [ns_set size $formdata]
for {set i 0} {$i  $size} {incr i} {
append hrformdata [ns_set key $formdata $i]: [ns_set value
$formdata $i]\n
}

set tolist some valid To: e-mail
set from some valid From: e-mail
set subject Request

append hrformdata /pre

ns_return $conn 200 text/html \
HTML
HEAD
TITLERequest Results/TITLE
/HEAD
BODY
H1Results/H1

The form data has been e-mailedBR
$hrformdatabr
/BODY/HTML
ns_sendmail $tolist $from $subject $hrformdata
%

When I submit the form aolserver spits this out:

[01/Nov/2002:08:58:12][4944.32773][-conn0-] Error:
Expected a 250 status line; got:
501 5.0.0 Invalid domain name
while executing
_ns_sendmail $smtp $smtpport $timeout $tolist $bcclist  $from $subject
$body $extraheaders
(procedure ns_sendmail line 59)
invoked from within
ns_sendmail $tolist $from $subject $hrformdata
invoked from within chunk: 0 of adp:
/usr/local/aolserver/servers/server1/pages/bsc/porequest.adp

I have tried using in the ns/params smtphost and mailhost.  when I set
the smtphost aolserver seg faults and I set mail host I still get the
error above.

Any help would be great.

wes



Re: [AOLSERVER] ns_sendmail

2002-11-01 Thread Jamie Rasmussen
Wes,
  On line of 166 of your sendmail.tcl there is a line with Helo AOLserver
[ns_info hostname].
Could you try changing this to Helo [ns_info hostname] ?
Thanks,

Jamie

At 09:31 AM 11/1/2002 -0700, you wrote:

I am trying to get ns_sendmail to work on redhat 8.0 with aolserver 3.5.

in the adp file I am using:
%
set formdata [ns_conn form $conn]

if {$formdata == } {
ns_return $conn 200 text/plain Need form data!
return
}

# Build up a human-readable representation of the form data.

set hrformdata pre
set size [ns_set size $formdata]
for {set i 0} {$i  $size} {incr i} {
append hrformdata [ns_set key $formdata $i]: [ns_set value
$formdata $i]\n
}

set tolist some valid To: e-mail
set from some valid From: e-mail
set subject Request

append hrformdata /pre

ns_return $conn 200 text/html \
HTML
HEAD
TITLERequest Results/TITLE
/HEAD
BODY
H1Results/H1

The form data has been e-mailedBR
$hrformdatabr
/BODY/HTML
ns_sendmail $tolist $from $subject $hrformdata
%

When I submit the form aolserver spits this out:

[01/Nov/2002:08:58:12][4944.32773][-conn0-] Error:
Expected a 250 status line; got:
501 5.0.0 Invalid domain name
while executing
_ns_sendmail $smtp $smtpport $timeout $tolist $bcclist  $from $subject
$body $extraheaders
(procedure ns_sendmail line 59)
invoked from within
ns_sendmail $tolist $from $subject $hrformdata
invoked from within chunk: 0 of adp:
/usr/local/aolserver/servers/server1/pages/bsc/porequest.adp

I have tried using in the ns/params smtphost and mailhost.  when I set
the smtphost aolserver seg faults and I set mail host I still get the
error above.

Any help would be great.

wes



Re: [AOLSERVER] ns_sendmail

2002-11-01 Thread Daniel P. Stasinski
Make sure you have in your nsd.tcl file:

ns_section ns/parameters
ns_param   MailHost127.0.0.1
ns_param   SmtpPort25


Daniel P. Stasinski
Software Engineer
Mayor Pharmaceutical Laboratories
[EMAIL PROTECTED]



Re: [AOLSERVER] ns_sendmail

2002-11-01 Thread Wes James
Thanks!  This did the trick.  I had tried ns_param mailhost $hostname,
but there is a difference in mailhost and MailHost.  I also left the
double quotes off of 127.0.0.1 and it seems to work.

wes

On Fri, 2002-11-01 at 09:57, Daniel P. Stasinski wrote:
 Make sure you have in your nsd.tcl file:

 ns_section ns/parameters
 ns_param   MailHost127.0.0.1
 ns_param   SmtpPort25




Re: [AOLSERVER] ns_sendmail

2002-11-01 Thread Wes James
Well, I went back to testing and was getting the invalid domain again.
This is the trick that seems to work.  I had tried both suggestions I
thought it was the other suggestion of putting the ns_params in, but
this is what finally seem to fix the problem.

thanks,

wes

On Fri, 2002-11-01 at 09:49, Jamie Rasmussen wrote:
 Wes,
On line of 166 of your sendmail.tcl there is a line with Helo AOLserver
 [ns_info hostname].
 Could you try changing this to Helo [ns_info hostname] ?
 Thanks,




Re: [AOLSERVER] ns_sendmail

2002-11-01 Thread Peter M. Jansson
But I'd avoid using ns_sendmail for a production system, unless you build
around it the mechanisms to handle retries on failures.  If you're calling
ns_sendmail from a .adp, and the sendmail server, for some reason, isn't
up, you'll just get an error, and lose what would have been in the message.
  I think you're probably better off invoking a sendmail process and
writing the email contents to it.

If you're generating email from a scheduled procedure, and you have a way
to track successes and failures, then ns_sendmail is fine.

On Friday, November 1, 2002, at 12:38 PM, Wes James wrote:


but this is what finally seem to fix the problem.

On Fri, 2002-11-01 at 09:49, Jamie Rasmussen wrote:

   On line of 166 of your sendmail.tcl there is a line with Helo
AOLserver [ns_info hostname].
Could you try changing this to Helo [ns_info hostname] ?



Re: [AOLSERVER] ns_sendmail

2002-11-01 Thread David Walker
This should be fixed.  While it is convenient to know that your mail came from
aolserver I believe having a space in the HELO line is not compliant with the
RFC.  I've had to change this on my servers that send mail through my
client's mail server.

On Friday 01 November 2002 11:38 am, You wrote:
 Well, I went back to testing and was getting the invalid domain again.
 This is the trick that seems to work.  I had tried both suggestions I
 thought it was the other suggestion of putting the ns_params in, but
 this is what finally seem to fix the problem.

 thanks,

 wes

 On Fri, 2002-11-01 at 09:49, Jamie Rasmussen wrote:
  Wes,
 On line of 166 of your sendmail.tcl there is a line with Helo
  AOLserver [ns_info hostname].
  Could you try changing this to Helo [ns_info hostname] ?
  Thanks,



[AOLSERVER] Chat Log - 11/01/2002

2002-11-01 Thread Nathan Folkman
I've uploaded into the files section on SourceForge. Enjoy!

- n


[AOLSERVER] AOLserver Documentation

2002-11-01 Thread Nathan Folkman
Shaz will be sending out another message shortly with the list of the API's we need people to sign up to document. We're going to use SorceForge's tasks manager to keep track of these. I went ahead and added the nsv commands. Thanks to David Siktberg for signing up for these! 

Here's an interesting snippet from a post to comp.lang.tcl.

"BTW: I've been extremely pleased with the quality of the Tcl manpages.
 Tcl is the only scripting language for which I have been able to
write extentions using only the manpages as a reference. 
Perl/Python... needed to by a book and even then the documentation was
very thin."

We'll know we've succeeded when we get the same sort of praise for the AOLserver docs. Have a great weekend!

- n


[AOLSERVER] AOLserver Tcl Command Documentation

2002-11-01 Thread shahzad chaudhri
Hello,

Here's a list of the top 40 or so commands that we'll be documenting at
AOL:

ns_adp_argv
ns_adp_break
ns_adp_dir
ns_adp_eval
ns_adp_include
ns_adp_parse
ns_adp_puts
ns_adp_return
ns_cond
ns_config
ns_conn
ns_db
ns_eval
ns_fmttime
ns_getchannels
ns_httptime
ns_info
ns_localtime
ns_log
ns_logroll
ns_mutex
ns_normalizepath
ns_parsehttptime
ns_puts
ns_queryexists
ns_queryget
ns_quotehtml
ns_register_proc
ns_returnunauthorized
ns_schedule_proc
ns_server
ns_set
ns_stats
ns_thread
ns_time
ns_url2file
ns_urldecode
ns_urlencode


Dave Sitberg signed up for the nsv_* commands, but the other
150+ Tcl commands  are up for grabs. I've grouped them into
batches of five and attached them to the end of this email. Each
person can take a group. You can respond directly to Nathan
([EMAIL PROTECTED]) or myself  ([EMAIL PROTECTED]) and we'll
assign the task to you on Sourceforge.

All you need to do is edit the man page located in /doc  under
your AOLserver source directory Files with extension .1 are
for programs (for example, nsd.1); files with extension .3 are for
C library procedures; and files with extension .n describe Tcl
commands.  The file doc/nsd.1 gives a quick summary of the
AOLserver configuration.  To view any of the man pages on Unix,
cd to the doc directory and invoke your favorite variant of troff
using
the normal -man macros, for example:

groff -Tascii -man nsd.1 | more

Thanks for your help,

Shaz




Remaining Commands:

ns_accesslog
ns_addrbyhost
ns_adp_abort
ns_adp_argc
ns_adp_bind_args
--
ns_adp_debug
ns_adp_debuginit
ns_adp_dump
ns_adp_exception
ns_adp_mimetype
--
ns_adp_registeradp
ns_adp_registertag
ns_adp_stream
ns_adp_tell
ns_adp_trunc
--
ns_after
ns_atclose
ns_atexit
ns_atshutdown
ns_atsignal
--
ns_browsermatch
ns_buildsqldate
ns_buildsqltime
ns_buildsqltimestamp
ns_cache_flush
--
ns_cache_keys
ns_cache_names
ns_cache_size
ns_cache_stats
ns_cancel
--
ns_checkurl
ns_chmod
ns_column
ns_configsection
ns_configsections
--
ns_conncptofp
ns_connsendfp
ns_cp
ns_cpfp
ns_critsec
--
ns_crypt
ns_dbconfigpath
ns_dberrorcode
ns_dberrormsg
ns_dbquotename
--
ns_dbquotevalue
ns_dbreturnerror
ns_env
ns_event
ns_findset
--
ns_formvalueput
ns_ftruncate
ns_get_multipart_formdata
ns_getcsv
ns_getform
--
ns_geturl
ns_gifsize
ns_gmtime
ns_guesstype
ns_headers
--
ns_hostbyaddr
ns_hrefs
ns_htmlselect
ns_httpget
ns_httpopen
--
ns_issmallint
ns_jpegsize
ns_kill
ns_library
ns_link
--
ns_localsqltimestamp
ns_markfordelete
ns_mkdir
ns_mktemp
ns_module
--
ns_modulepath
ns_openexcl
ns_paren
ns_parseheader
ns_parsequery
--
ns_parsesqldate
ns_parsesqltime
ns_parsesqltimestamp
ns_parsetime
ns_pause
--
ns_pooldescription
ns_purgefiles
ns_querygetall
ns_quotelisttolist
ns_rand
--
ns_register_adptag
ns_register_filter
ns_register_trace
ns_rename
ns_requestauthorize
--
ns_respond
ns_resume
ns_return
ns_returnadminnotice
ns_returnbadrequest
--
ns_returnerror
ns_returnfile
ns_returnforbidden
ns_returnfp
ns_returnnotfound
--
ns_returnnotice
ns_returnok
ns_returnredirect
ns_rmdir
ns_rollfile
--
ns_rwlock
ns_schedule_daily
ns_schedule_weekly
ns_sema
ns_sendmail
--
ns_set_precision
ns_setexpires
ns_share
ns_shutdown
ns_sleep
--
ns_sockaccept
ns_sockblocking
ns_sockcallback
ns_sockcheck
ns_socketpair
--
ns_socklisten
ns_socklistencallback
ns_socknonblocking
ns_socknread
ns_sockopen
--
ns_sockselect
ns_sourceproc
ns_striphtml
ns_symlink
ns_table
--
ns_tagelement
ns_tagelementset
ns_tcl_abort
ns_tmpnam
ns_truncate
--
ns_unlink
ns_unregister_proc
ns_unschedule_proc
ns_updateheader
ns_uudecode
--
ns_uuencode
ns_var
ns_write
ns_writecontent
ns_writecsv
ns_writefp
--



[AOLSERVER] crashes related to insufficient stack space

2002-11-01 Thread David Walker
is there any way to catch crashes related to insufficient stack space and add
a relevant entry in the server log to remove the guesswork from
troubleshooting these?



Re: [AOLSERVER] crashes related to insufficient stack space

2002-11-01 Thread Jim Davidson
In a message dated 11/1/2002 5:45:34 PM Eastern Standard Time, [EMAIL PROTECTED] writes:

is there any way to catch crashes related to insufficient stack space and add
a relevant entry in the server log to remove the guesswork from
troubleshooting these?


It might be possible to modify the thread create code to use user-allocated stacks with guard zones. Haven't tried it myself.
-Jim


Re: [AOLSERVER] crashes related to insufficient stack space

2002-11-01 Thread Jeff Hobbs
 is there any way to catch crashes related to insufficient stack space and
add
 a relevant entry in the server log to remove the guesswork from
 troubleshooting these?

These are most often related to infinite loops in Tcl.  In general the
recursion limit (default 1000 - note that this is for infinite loop
recursion, and as such is fairly high) is not too high to be caught
without blowing stack.  However, AOLServer uses a threaded Tcl, and many
machines have a much lower per-thread stack.  You can either up this, or,
starting in Tcl 8.4, lower the recursion limit (via interp recusionlimit)
in order to move the problem back into being a Tcl error (not a crash).

  Jeff Hobbs The Tcl Guy
  Senior Developer   http://www.ActiveState.com/
  Tcl Support and Productivity Solutions



Re: [AOLSERVER] crashes related to insufficient stack space

2002-11-01 Thread Jeff Hobbs
 It might be possible to modify the thread create code to use
 user-allocated stacks with guard zones.  Haven't tried it myself.

Along these lines, there is a TclpCheckStackSpace call that isn't
implemented on most unix platforms to prevent the crash.  The reason
is that implementations on Unix are not very portable, and can also
be more costly than desired.

Another alternative farther down the road is to look into porting
up the non-recursive bytecode engine that ActiveState has in place
for embedded porting work done for Cisco (where they are putting
Tcl on all routers).  This has reduced stack requirements (as can
be expected for embedded environments).

Jeff



Re: [AOLSERVER] crashes related to insufficient stack space

2002-11-01 Thread Patrick Spence
Except in my recent experiences the ONLY clearly insufficient stack space
errors I have received come back to one of two things... 1)PHP and 2) the
glibc upgrade in redhat doing something funky to the memory requirements
causing DNS lookups (al la hosts.allow in nsperm or gethostbyaddr)...

This tells me that writing bad code in TCL isn't the only way, or even the
most prolific way that happens in the real world that I have seen.. thus
it would be a good idea to at least attempt to signal that the stack space
is insufficient..  heck, even a high water mark procedure that you can
turn on that could be accessed the same way other stuff is in
nstelemetry.adp would be a benifit.. because then we could just keep an eye
on that value as a guideline when to consider upping the value.

Heck, even Borland Pascal from the dos age tried (emphasis on tried) to
handle stack issues gracefully... so why not aolserver?


--
  Patrick Spence arivenATarivenDOTcom
  www.RandomRamblings.com
  www.Ariven.com

- Original Message -
From: Jeff Hobbs [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 01, 2002 3:52 PM
Subject: Re: [AOLSERVER] crashes related to insufficient stack space


  is there any way to catch crashes related to insufficient stack space
and
 add
  a relevant entry in the server log to remove the guesswork from
  troubleshooting these?

 These are most often related to infinite loops in Tcl.  In general the
 recursion limit (default 1000 - note that this is for infinite loop
 recursion, and as such is fairly high) is not too high to be caught
 without blowing stack.  However, AOLServer uses a threaded Tcl, and many
 machines have a much lower per-thread stack.  You can either up this, or,
 starting in Tcl 8.4, lower the recursion limit (via interp recusionlimit)
 in order to move the problem back into being a Tcl error (not a crash).

   Jeff Hobbs The Tcl Guy
   Senior Developer   http://www.ActiveState.com/
   Tcl Support and Productivity Solutions



Re: [AOLSERVER] AOLserver

2002-11-01 Thread Scott Goodwin
I have a request to all posters to the AOLserver discussion group:

please take the time to use reasonably good subject lines in your
messages. The subject line above doesn't tell me anything about the
content, but it could. I better line might have been:

   AS 3.4 and PG 7.2.1 - occasional crash

Having good subject lines makes it a lot easier to both determine if
you're interested in reading the message, and helps when you go to
listserv to search all messages.

Didn't mean to pick on you personally, Nate; you just gave me a
convenient example. I am also guilty of creating useless subject lines.
I am changing my ways...  :)

thanks,

/s.


-Original Message-
From: AOLserver Discussion [mailto:AOLSERVER;LISTSERV.AOL.COM] On Behalf
Of Nate Haggard
Sent: Wednesday, October 30, 2002 5:16 PM
To: [EMAIL PROTECTED]
Subject: [AOLSERVER] AOLserver


I am using AOLserver 3.4 and PostgreSQL 7.2.1.  Occasionally AOLserver
will just crash.  I get an error like this in the serverlog:
[25/Oct/2002:15:50:00][1413.883783][-conn633-] Error:  It has
something to do with the database driver because I can duplicate the
behavior if I do a query without single quotes '.  Is this normal
behavior?  I would rather see a descriptive error about a failed query
because it is difficult to debug this way.

Nate Haggard