Gossamer Forum
Home : Products : Links 2.0 : Discussions :

sendmail probs

Quote Reply
sendmail probs
recently i declined to add a link to the site .. so i hit delete ... it went through the motions and returned an error (sendmail path something or other not found) yet i know that sendmail path is fine ... what can i do? (i can't login using telnet.)

Quote Reply
Re: sendmail probs In reply to
Add the following code to a file and name it sendmail.cgi....

#!/usr/bin/perl

sendmail();

sub sendmail {
# ------------------------------------------------------------------
# Try and figure out where sendmail is located.
#
-x '/usr/sbin/sendmail' and return '/usr/sbin/sendmail';
-x '/usr/lib/sendmail' and return '/usr/lib/sendmail';
-x '/bin/sendmail' and return '/bin/sendmail';
return '';
}

.....execute it from your browser and it will tell you where sendmail is.

Then edit the path to sendmail in links.cfg

Paul Wilson.
NEW website coming soon...
Quote Reply
Re: sendmail probs In reply to
I've never seen this code before, how does it work? Or more to the point, why doesn't it work? I tried it as a script called sendmail.cgi, and executed it from my browser, and i got a 500 Error!!!

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Just tried it via telenet, and that didn't work either!!! Frown

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Oops...try printing the header at the top.....

It is from the Links SQL install script

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
Ok this works.........


#!/usr/bin/perl

sendmail();

sub sendmail {
# ------------------------------------------------------------------
# Try and figure out where sendmail is located.
#
print "Content-type: text/html\n\n";

-x '/usr/sbin/sendmail' and print "/usr/sbin/sendmail";
-x '/usr/lib/sendmail' and print "/usr/lib/sendmail";
-x '/bin/sendmail' and print "/bin/sendmail";
}




Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
Erm...telnet?.....who's server?

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
My one....

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Hi Andy:

The code that Paul provided is sound - the x operator tests if the operand (sendmail in defined path) can be executed. You run the script from the browser. What do your server error logs tell you?


Dan Cool


Quote Reply
Re: sendmail probs In reply to
Don't worry, got it working now. Can this be used for other functions like finding out the installed modules on your server (like PerlDiver)???

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Hi Andy:

Use the following code to locate installed modules:

#!/usr/bin/perl

use strict;
print "Content-type: text/html\n\n";

use File::Find;
my (@mod, %done, $dir);

find (\&get_module, grep { -r and -d } @INC);
@mod = grep (!$done{$_}++, @mod);
foreach $dir (sort { length $b <=> length $a } @INC) {
foreach (@mod) { next if s,^\Q$dir,,; }
}
foreach (@mod) { s,^/(.*)\.pm$,$1,; s,/,::,g; print "$_
\n"; }

sub get_module {

/^.*\.pm$/ && /$ARGV[0]/i && push @mod, $File::Find::name;
}


Dan Cool


Quote Reply
Re: sendmail probs In reply to
Great, i'll try that later!!! Cool

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
If you want to check out the php environment make a php3 file called info.php3 and add the following code...

<? phpinfo(); ?>

Ooops......sorry off topic.



Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
That code didn't seem to work forme!! Any ideas? (IS Error)

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Hi Andy:

Works for me - I just copy and pasted the code exactly into a test script. I then tested it and all a-okay. Perhaps you don't have the File::Find module installed. What does your server error log tell you?


Dan Cool


Quote Reply
Re: sendmail probs In reply to
You may also have to change the perl path.

Regards,

Eliot Lee
Quote Reply
Re: sendmail probs In reply to
Right, i got it working now. Is there anyway to make it get displays in a downwards collumn (rather than just a mess of different modules installed!!!) Cool

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Hi Andy:

There was a br HTML tag in there but it was lost in translation Wink

Change:
print "$_\n";

To:
print "$_{br}\n";

where you replace the {} curly braces with the HTML tag angular brackets.



Dan Cool


Quote Reply
Re: sendmail probs In reply to
Thanks... Cool

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Right, this is the code i am now using (just gives me blank pages now, not IS Errors);


#!/usr/bin/perl

use strict;
print "Content-type: text/html\n\n";

use File::Find;
my (@mod, %done, $dir);

find (\&get_module, grep { -r and -d } @INC);
@mod = grep (!$done{$_}++, @mod);
foreach $dir (sort { length $b <=> length $a } @INC) {
foreach (@mod) { next if s,^\Q$dir,,; }
}
foreach (@mod) { s,^/(.*)\.pm$,$1,; s,/,::,g; print "$_{br}\n"; }

sub get_module {

/^.*\.pm$/ && /$ARGV[0]/i && push @mod, $File::Find::name;
}


Any ideas??? Frown

Thanks

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Here is a copy of the Mod that jerry su wrote and it works fine for me across different browsers (initially when jerry su released the Mod, it would only work in Netscape).

Code:

#!/usr/local/bin/perl
#
#############################################################
# File Name: modules.cgi
# Written by Widgetz, Jerry, Gossamer Threads Scripts User
# Last Modified: November 08,1999
#############################################################

use strict;
use File::Find;
my (@mod, %done, $dir);
find(\&get, grep { -r and -d } @INC);
@mod = grep(!$done{$_}++, @mod);
foreach $dir (sort { length $b <=> length $a } @INC) {
foreach (@mod) { next if s,^\Q$dir,,; }
}
print "Content-type: text/html\n\n";
foreach (@mod) { s,^/(.*)\.pm$,$1,; s,/,::,g; print "$_
\n"; }
print "Done! ($#mod modules!)\n\n";
sub get { /^.*\.pm$/ && /$ARGV[0]/i && push @mod, $File::Find::name; }


Regards,

Eliot Lee
Quote Reply
Re: sendmail probs In reply to
Still shows all the found modules as one line (e.g. B::Asmdata B::Assembler B::Bblock B::Bytecode B::C B::CC B::Debug B::Deparse B::Disassembler B::Lint B::Showlex).

Any ideas?

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Same issue with both - you must add a BR tag $_. My code does just that, and the modules are listed one per line. It doesn't show up in the code here because the forum script parses out HTML tags. Did you do as I said, change {} to HTML tag angular brackets? {br} is meaningless and will not produce line breaks.



Dan Cool
Quote Reply
Re: sendmail probs In reply to
As does mine....

Code:

print "$_\n


Same difference...Wink

Regards,

Eliot Lee
Quote Reply
Re: sendmail probs In reply to
DID you not read the post.......he said use a br tag with square brackets...... not {br}......surely you should know that!

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
I think you will find that \n doesn't work in the code that Dan provided - you have to use the br tag.

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
If you are that desperate to see what modules I have on the server.....go here....

http://odp.wiredon.net/cgi-bin/pm.cgi

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
UH YEA, PAUL!

AND LIKE I MENTIONED...THE CODES WORK IN ALL BROWSERS WITH A LIST OF MODULES ON SEPARATE LINES!!!! MadMad

Like you said before,"Leave your comments to yourself!"

Regards,

Eliot Lee
Quote Reply
Re: sendmail probs In reply to
Thanks, that worked....Smile

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Noooo, i just wondered how it worked....

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Sorry, I've changed it now! I wondered why he used {br} as i have never seen this make a break in a link; i don't even know it as a Perl function....

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Hi Andy:

I did explain in my initial post. The forum script parses out some HTML tags like the br one (but not all). That is why I placed them in curly braces with the added notation that you had to replace the curly braces with angular (not square as one posted) brackets.

For example, here is the HTML br tag -


Did you see it? That is why I placed the br tag in curly braces so you could see it.


Dan Cool


Note:
=====
[] Square Brackets (=Brackets)
{} Curly Braces (colloquial?)
() Parentheses
<> Angular Brackets


Quote Reply
Re: sendmail probs In reply to
Thanks... lol.... I didn't see the bit where you said to change to square brackets...

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com
Quote Reply
Re: sendmail probs In reply to
Erm.......

NO Anthro.......I have tested both codes and \n does NOT work in the code Dan gave.....myself and youradds have both tried it and it doesn't work so you may want to check your facts before you shout your mouth off.



Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
Well...it works just fine for me, PAUL!

Go here:

http://www.anthrotech.com/cgibin/misc/modules.cgi

Regards,

Eliot Lee
Quote Reply
Re: sendmail probs In reply to
WELL it doesn't work for me and it doesn't work for youradds.

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: sendmail probs In reply to
Just tried it, and it does work now....

Andy

http://www.ace-installer.com
webmaster@Ace-installer.com