Search code examples
perlemailcgiunlink

Perl script not sending mail and not unlink - ing


I have some scripts that I didn't write... they search a Squid log database and then create a spreadsheet and email it and then delete the .pid and .xls files it created.

The scripts were using NTLM for one of it's variables (request_user)... I changed it to a manually entered text field.

I don't know perl and the scripts are not working.

The .pid and .xls are getting created but nothing gets emailed and the files don't get deleted (unlink)

Here is are the links to the request and generate files

http://www.the-greenes.net/spreadsheet_request-test.txt

http://www.the-greenes.net/spreadsheet_gen.txt

Can anyone help a limited guy with very limited perl skills?

Thanks


Solution

  • In the spreadsheet_gen script you have this line to setup address to smtp server:

    my $mail_server=`10.0.1.98`;
    

    Using backticks make it run command named 10.0.1.98 and assign its output into $mail_server variable. This is most likely wrong, try to replace backticks with regular apostrophes to create string:

    my $mail_server = '10.0.1.98';
    

    Can you see any error in your error.log? If $message->send ... fails, it dies with error message and nothing gets sent nor unlinked.