Question
Please instruct me how to find the right value for SMTPSENDERHOST. Under item 8. Email in the
WindowsInstallCookbook I edit SMTPSENDERHOST in
TWikiPreferences and get this message every time when saving:
Insecure directory in $ENV{PATH} while running with -T switch at ../lib/TWiki/Store.pm line 518.
I followed the
WindowsInstallCookbook very carefully (twice) installing Twiki on
Windows XP Pro together with cygwin and apache (I'm a novice). I have tried to put these 3 values (used in the setup of Windows Outlook Express) in the variable SMTPSENDERHOST: mail1.stofanet.dk | stofanet.dk | localhost
- My Twiki webserver is set up on a privat local network with i Sygate Home Network 4.2 firewall (installed on separat PC) between my webserver and the internet.
- As I have no fixed IP-address from my ISP I have got http://www.DynDNS.org
providing me with a fixed IP.
- I can connect to my windows apache server from outside the firewall with http://MyDynDNSname:1711/bin/testenv
or just http://MyDynDNSname:1711/
for getting to Twiki startpage. Internally on my privat network I have to use http://localmachine:1711/bin/testenv
or just http://localmachine:1711/
for access. These call gives me these warnings from bin/testenv:
- Since your CGI script is not running as user nobody you need to change the locks in the *,v RCS files of the TWiki distribution from nobody to SYSTEM.
- Mail program /usr/sbin/sendmail not found. Check the path.
- My mail account is a POP3 at the ISP http://www.stofanet.dk
(incoming POP3 and outging SMTP)
- TWiki version: 01 Dec 2001 (TWiki20011201.zip)
- Web server: apache_1.3.27-win32-x86-no_src
- Server OS: Windows XP Pro
- Web browser: IE 6.0
- Client OS: Windows XP Pro
--
PeterLorenzen - 01 Dec 2002
Answer
This will happen with any topic save and is probably due to permissions on various directories - see
InsecureDirectory and
AnotherInsecureDirectory for details. Seems to be happening somewhat more in the last month or so. If you could post your setup (output of latest testenv,
CVSget:bin/testenv
, and your
TWiki.cfg), as per
SupportGuidelines, that would be helpful. Thanks for providing the detail in your report.
You don't have to set SMTPSENDERHOST unless you have problems sending mail, but something based on your DNS name would be good, e.g. mydyndnsname.dk - the idea is that the receiving mail host may want to validate where the mail is coming from, so it should match what is in your From: header (i.e. WIKIWEBMASTER).
--
RichardDonkin - 02 Dec 2002
I have now uploaded my
Twiki.cfg and the output of latest testenv after downloading
CVS:bin/testenv
. Also the white paper about Mail Exchangers from
http://DynDNS.org
has been uploaded. Should I add
mail1.stofanet.dk as the Mail Exchanger for my site
http://pelo.mine.nu
? (setup file at
DynDNS).
I have not started experimenting with directory permissions since
InsecureDirectory and
AnotherInsecureDirectory are not stating any result for Windows XP.
--
PeterLorenzen - 03 Dec 2002
You don't need to change your Mail Exchanger (MX) DNS setup at all - just take your SMTP host as used in Outlook or whatever and specify the same in TWiki's SMTPMAILHOST. Probably
mail1.stofanet.dk will work if that's what you are using. You don't need SMTPSENDERHOST unless your mail host starts complaining.
Downloading the latest testenv from
CVSget:bin/testenv
would be useful since this has some more diagnostics for Windows setups - also it would be good to attach the output as HTML so it's easier to read.
You will need to do something about directory permissions for the directories in your $safeEnvPath setting - I don't have access to Windows XP so you will need to experiment a bit. The topics mentioned are a good starting point. As a temporary measure, you can remove the -T switch (or change -wT to -T) from the scripts in 'bin', but this is not recommended for a network-accessible TWiki since it removes all
TaintChecking, and is quite a security hole potentially.
Running through the tests in
WindowsInstallCookbook would be a good idea as this would help you clarify the point that it's not the mail settings causing this message - try editing some test topics instead and you'll see what I mean.
--
RichardDonkin - 04 Dec 2002
Thank you for the quick responses. I downloaded your newest
CVSget:bin/testenv
as mentioned above. It took me some time to recognize that the new testenv file didn't work (as the browser had cached the output of the "old"/first testenv). There is no output to the screen and the apache log has this entry:
[...] [error] [client 10.11.12.2] (2)No such file or directory: couldn't spawn child process: c:/twiki/bin/testenv
My first testenv from the installation has this entry in the log (this testenv attached now and screen output also attached as html file):
[...] [error] [client 10.11.12.2] Name "main::wikiHomeUrl" used only once: possible typo at c:\twiki\bin\testenv line 70.
I have also removed the -T switch from most of the scripts in 'bin'. First I did it on all files ... and nothing worked. So I started to look in the apache log every time an error occured (log from 4th and 5th december attached - I put an entry in the log every time I changed something). I also had to change some permissions to obtain functionality clicking the links in Twiki ... but I think this is a very unsecure way of getting on ... as I do not understand some of the log entries.
I have also attached my twiki.cfg again since the first one had a little mistake (the portnumber was missing at $wikiHomeUrl).
--
PeterLorenzen - 05 Dec 2002
Did you change the first line of the new
testenv script to read as for your other scripts, i.e.
#!c:/cygwin/bin/perl if you are using the
WindowsInstallCookbook? This seems to be an error from Apache failing to start the script altogether.
The error from the original testenv is just a warning and can be ignored.
Removing the -T switch is just a workaround and not recommended in general - it would be better to get the permissions fixed. Really you just need to make the directory read-only by everyone except the owner, but see the topics linked for details.
By the way, the
TWikiAlphaRelease has new support for internationalised characters in
WikiWords, e.g. EnKæmpemæssigHøne is a valid wiki link. See
InternationalisationEnhancements for details.
--
RichardDonkin - 07 Dec 2002
Thanks - I have been very busy last month - here are my results until now: I started from the beginning again and deleted c:\apache, c:\cygwin and c:\twiki (saving some of the important config files). I followed the updated
WindowsInstallCookbook reinstalling apache, cygwin and twiki. The output of the newest
CVSget:bin/testenv
is attached and has this error message:
Warning: 'Digest::SHA1' not installed - check TWiki documentation to see if this is required.
I have tried to reinstall it with CPAN tool without result. I get this message:
Checking if your kit is complete...
Looks good
Writing Makefile for Digest::SHA1
can't spawn "c:/cygwin/bin": No such file or directory at /usr/lib/perl5.6.1/cygwin-multi/CPAN.pm line 4434
C:/cygwin/bin -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Is there a workaround to avoid another reinstallation?
I also studied the apache.org site and decided to update Windows XP SP1, since I was not sure that this was done (update document attached - please check at
http://www.apache.jp/dist/httpd/binaries/win32/
). After this I reconfigured network setup and share permissions on my server. No change of output from /bin/testenv was detected.
I will continue working on the problem ...
--
PeterLorenzen - 10 Jan 2003
There is something odd about your Cygwin setup, or perhaps the Perl/CPAN tool setup - it is trying to run "c:/cygwin/bin" rather than "c:/cygwin/bin/make" or whatever. Also, it's quite unusual to see this format of pathname within the Cygwin world, usually it is /bin/make or similar. The spawning problem was also seen in your earlier comment, so perhaps there is something odd about the command shell - are you running all the CPAN commands from the normal Cygwin prompt (i.e. bash, type
echo $0 to find shell name)?
--
RichardDonkin - 08 Feb 2003
I had this same problem on a Mandrake hosted account. What I did was add an assignment
$ENV{'PATH'} = "/bin:/usr/bin"; to the
setlib.cfg file in the
bin directory.
--
WalterMundt - 09 Feb 2003
For a fix for inscure directory errors on cygwin also see
AnotherInsecureDirectory
--
MattWilkie - 29 Jun 2003