Link to home
Start Free TrialLog in
Avatar of Chris S
Chris SFlag for India

asked on

5 questions

Hello

I have the following 5 questions/clarifications

 1) how to change permissions for a file in windows using PERL?
 
 for eg
 
 c:\\dir1\\file1
 
 dir1 has 777 permissions
 
 file1 has 666 or 444 or 755 or whatever permissons
 
 I want to change file1 to 777
 
 I tried chmod (777 , "file1")  
 
 and chmod (0777 , "file1")
 
 both didnt work--- please advise

 
 2) Is there a sendmail program for windows ?

 where can I download it ??
 
 I want to use it as  $MAIL = "/usr/bin/sendmail"  -- as in unix ...

 
 3) I have two computers connected on network  -- windows 98

 I have apache win95 version  running in both of them ..

Is it possible to send email from one computer to another computer ..

 I have configured their IPs as 128.0.0.5 and 128.0.0.6
 
 so is it possible to send a mail from  128.0.0.5  to  somebody@128.0.0.6

 and the somebody@128.0.0.6 must be able to use a browser to read the mail ...

 If it is not possible in windows to windows machines  is it atleast possible in windows to linux machine .. (I mean one machine running linux and the other windows both connected on network)


Is there any sofware , modules I have to install etc ..


If it is possible at all .. what will be the pop and smtp configurations etc

4) In PERL what is the  windows equivalent for unix ...

1) $$ and

2) $!


5) Is there any website which compares the progamming aspects of programming PERL in windows and UNIX ?
 
thanks

chris
Avatar of cadabra
cadabra

Are you using ActiveState Perl on the windows machines ?
1) Win32::FileSecurity;

3) You need a mail server (SMTP/POP) accessible on your network
Avatar of Chris S

ASKER

is there a mail server available for download .. can I install them in my machine .. either linux or windows
Avatar of Chris S

ASKER

which module cotains

Win32::FileSecurity


================================================================================

First of all, I recommend using ActiveState perl for windows environment. (www.activestate.com)

To install Win32::FileSecurity you can do this with PPM (Perl Package Manager):

PPM> install Win32-FileSecurity
Install package 'Win32-FileSecurity?' (y/N): y
....'Retrieving package 'Win32-FileSecurity
Installing C:\Perl522\site\lib\auto\Win32\FileSecurity\FileSecurity.dll
Installing C:\Perl522\site\lib\auto\Win32\FileSecurity\FileSecurity.exp
Installing C:\Perl522\site\lib\auto\Win32\FileSecurity\FileSecurity.lib
Installing C:\Perl522\html\lib\Win32\FileSecurity.html
Installing C:\Perl522\htmlhelp\pkg-Win32-FileSecurity.chm
Installing C:\Perl522\htmlhelp\pkg-Win32-FileSecurity.hhc
Installing C:\Perl522\site\lib\Win32\FileSecurity.pm
Writing C:\Perl522\site\lib\auto\Win32\FileSecurity\.packlist
>PPM


You can see which packages are available for ActiveState perl in:

http://www.activestate.com/packages/zips/


To deal with mail issues, you can do

PPM> install MailTools

Then check the ActivePerl->OnlineDocumentation

You will see lots of new mail stuff like:

  Mail::Send
  Mail::Sender
  Mail::POP3Client





> 2) Is there a sendmail program for windows ?

There is a program called "blat" for windows I know of, but when I tried using it , it crashed in several circumstances.

What works best is using Mail::Sender.pm, as discussed in:

https://www.experts-exchange.com/jsp/qShow.jsp?ta=perl&qid=10245859 

If you would like to work with it, tell me and I will post more info on this, as configuring this could be somewhat tricky.


 
> 5) Is there any website which compares the progamming aspects of programming PERL in windows and UNIX ?

When you install ActiveState Perl, the online documentation installed contains the following FAQs, dealing with programming perl on windows platforms.  


    perlwin32faq: Overview of the Win32 Perl FAQ (this document) (Updated: 3/3/99)
    perlwin32faq1: Availability and Installation
    perlwin32faq2: PerlIS
    perlwin32faq3: Documentation and Support
    perlwin32faq4: Windows NT and Windows 95 (Updated: 3/11/99)
    perlwin32faq5: Implementation Quirks
    perlwin32faq6: Web Server Configuration and Troubleshooting
    perlwin32faq7: Web Programming (CGI and PerlIS)
    perlwin32faq8: General programming
    perlwin32faq9: Modules/sample scripts (Updated: 3/11/99)
    perlwin32faq10: Embedding and Extending
    perlwin32faq11: Using PPM to install modules (Updated: 3/3/99)
    perlwin32faq12: Using OLE with Perl  (Updated: 3/11/99)




Note that there are all sorts of quirks in the windows95 implementation.

Also note that I have not worked with win98, and all the info I am commenting is tested on WinNT plaform.

You can make the linux machine a mail server for itself and the other 2 windows machines on the network.

To get the linux machine to be your mail-server, it needs to handle
the protocols SMTP POP3 IMAP.

My platform is redhat-linux 5.1, so the info below may be specific
to redhat linux.

Redhat linux installation contains support for these protocols,
so there is no need for you to get 3rd party software.

You can do telnet to the linux box to ports 25 - STMP, 110 - POP3
and see what answer you are getting.

You can try configuring OUTLOOK / OUTLOOK express against the
linux box which can serve as an SMTP/POP3 server.

The mail accounts are someuser@linuxbox (unix users on the linux box),
to which you can connect from outlook / outlook express, or your own
custom mail client software running on the windows machines
(written in perl for example).

If you are having trouble, try looking at
 /var/log/messages
 /var/log/secure
 /var/log/maillog
on the linux box.

You can also use
   /usr/sbin/tcpdump port 110  
    or
   /usr/sbin/tcpdump port 25

To see network traffic on specific ports of your linux box.

If you have redhat 6.1, look at

  http://www.redhat.com/support/docs/gotchas/6.1/gotchas-6.1-6.html 

(search for POP3 on this page)


Cadabra.


BTW- How are you getting along ?
ASKER CERTIFIED SOLUTION
Avatar of cadabra
cadabra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
================================================================================

Have a look at:


http://www.activestate.com/ActivePerl/docs/Perl-Win32/perlwin32faq4.html#How_do_I_send_email_from_Perl_fo


BTW-
I have a similar setup to yours:
A linux (redhat 5.1) box acting as a mail server.

Three windows machines, reading mail using outlook express.

Avatar of Chris S

ASKER

Do you know of any web based admin script ?

For adding pop3 users ?

For adding system users etc ?

email  me at christopher_sagx@yahoo.com
You could write a perl-CGI that would accept input and call the linux command "adduser" to create new unix users.
 Once a unix user is added, he will be able to receive mail.
 I am assuming you don't need this to be highly secure.