Solved

BLAT mail program setup

Posted on 2000-02-23
12
316 Views
Last Modified: 2010-05-18
Can someone tell me how to install BLAT correctly on my server? In the instructions it says to run BLAT with the "-install" parameter, but how do I do this on a remote server? I am using Windows NT. I have simply uploaded the BLAT execute and attempted to email a message with it. The results indicate that all went well and that the message was sent, but I never receive an email, so I know I must not have set it up correctly. Hope someone understands the trouble I'm having.
0
Comment
Question by:microboard
  • 5
  • 4
  • 3
12 Comments
 
LVL 10

Expert Comment

by:makerp
Comment Utility
blat uses a mail server, it doesnt actually do the emailing.

blat -install <mail.server.address> <your@email.address>

will install blat on your machine.

then test it with the following

blat temp.txt -t your@mail.address -s "test mail"

where test.txt is a file that will make up the body of the mail

the -q option will suppress output but leave this off while you testing. your need it on if its in a cgi etc because otherwise it will mess your html output up.
0
 

Author Comment

by:microboard
Comment Utility
makerp, you have skipped over the very point I was asking: How do I use the INSTALL parameter on a remote server? If it were on my computer it would be easy but how do I send a command line to run the install option when the only way I can use the file is through FTP? So, how do I send this line:
blat -install <mail.server.address> <your@email.address>

to the server?
0
 

Author Comment

by:microboard
Comment Utility
makerp, I've got to reject your answer so I can let others respond
0
 
LVL 25

Expert Comment

by:clockwatcher
Comment Utility
The 'correct' way to install it would be to call up the people who are managing your server and have them install it for you.

One 'incorrect' and possibly hazardous way would be to try installing it via CGI.  If it's not an interactive install then you might be able to get away with the following script:

  $mailserver = "10.0.0.1";
  $emailaddress = "a\@b.com";

  print "Content-Type: text/html\n\n";
  $results = `blat -install $mailserver $emailaddress`;
  print $results;

Whether it will work or not will depend upon what kind of priveleges they've left the anonymous webserver account.  It could end up screwing up their machine-- probably nothing serious, but depending upon what the install does it might not be the best idea. ;-)
0
 
LVL 10

Accepted Solution

by:
makerp earned 50 total points
Comment Utility
sorry !!

clockwatcher is right but his syntax is wrong. its not an interactive install so it should work fine.

$mailserer = "<mail.server.com>";
$mailaddress = "<your@mail.address>";

$commandline = "blat -install ".$mailserver." ".$emailaddress." \n\r";

system($commandline);

its the system command which will execute the blat -install on the remote machine.

the \r\n is the equivelent of pressing return after a command is entered on the command line.

providing the blat exe is in the same dir as the script you are executing there should not be a prob with permissions ! you can execute a script so blat will be able to execute.

the output returned from the system command goes to the stdout so you will get it in your response.

you should get
'SMTP sever set' or somting like that

when you want to send a mail you will have to use the system command again but you will proably want to supress the output so it dont screew up your response. do this with the -q option, for testing though you can get the output in the response.    

0
 
LVL 25

Expert Comment

by:clockwatcher
Comment Utility
There's nothing wrong with my syntax.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:microboard
Comment Utility
Thanks makerp I know what you given will work however everytime I try it, I either get this response : "CGI ERROR: DID NOT RETURN THE PROPER HEADERS  - to set the SMTP server's address and the user name at that address do:
blat -install server username" or I get a download box as if the file is trying to be put on my computer.

Would you mind showing me how to implement the code so that it does not get the CGI error or attempt to download itself.
0
 
LVL 10

Expert Comment

by:makerp
Comment Utility
okay, first off clockwatchers syntax will just display the the line blat -install blah blah..... not actually execute the command on the remote server !!.

to use the script i have written put a file called test.txt in the dir and put some test text in it. also the variable $testmail needs to contain your mail address.... or the senders address $mailaddress if its the same...  

code :

print("Content-Type: text/html\n\n");
print("<HTML><HEAD>Blat installation script..</HEAD><BODY><H1>Attempting to install blat</H1>");

$mailserer = "<mail.server.com>";
$mailaddress = "<your@mail.address>";

$commandline = "blat -install ".$mailserver." ".$emailaddress." \n\r";

print("The system command ".$commandline." produced the following out put<BR>");

system($commandline);

print(<HR>"I will now try to send a mail to you .......<BR><BR>");

$testmail = "<your@mail.address>";

$commandline = "blat test.txt -t ".$testmail." -s \"A test mail with blat\" \n\r";

print("blat produced the following output using commandline ".$commandline."  ....<BR>");

system($commandline);

print("<BR>hopefully you got something like<BR>sending test.txt to ".$testmail."<BR>subject:A test mail with blat<BR>login name is ".$mailaddress."</BODY></HTML>");

end of code

if it dont work for any reason check the variable names and that ive put a $ in front of em all, im used to C programming!!

do i get some points now ?

cheers
0
 
LVL 10

Expert Comment

by:makerp
Comment Utility
oh .. also

ive left the -q option off of the test mail bit. -q suppresses output. ive done this so you can check its working. you will probably want to have this on for real as otherwise your output will get stuffed up !!

if you dont get a mail do a script with just the test mail bit in, its being a bit ambitious to expect the server to set you up so quickly ??
0
 
LVL 25

Expert Comment

by:clockwatcher
Comment Utility
makerp,

My code will do no such thing.  Those are backticks, not normal quotes.  $results will contain the result of executing the blat command.  I think you need to brush up on your perl syntax.
0
 

Author Comment

by:microboard
Comment Utility
makerp, after a bit of trial and error and resettling some parts of your code, it worked fine. You get the points, however, if not for clockwatcher's backticks I wouldnt have been able to figure out the problem I was still having. I don't know how to separate points or I would gladly give both of you the points.

Thanks again.
0
 
LVL 10

Expert Comment

by:makerp
Comment Utility
sorry clockwatcher, didnt note the backticks. ive only been doing perl for a little while.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now