Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

tfmail_application error_bad logfile name

by Anonymous Monk
on Oct 04, 2005 at 19:37 UTC ( [id://497373]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

i have finally gotten tfmail to work. i had everything in the cgi-bin and all worked. i then moved the location of the trt and trc files (for added security reasons) to: home/sitename/tfmail/

the tfmai.pl script: is in the cgi-bin

the missing fields template still works but when all fields are filled out the error message i receive is:

-----------------
Application Error An error has occurred in the program bad logfile name [ ] at TFmail.pl line 1048.
----------------

my tfmail.pl script is configured as follows: </c>

use constant DEBUGGING => 1; use constant LIBDIR => '/home/sitename/tfmail/'; use constant MAILPROG => '/usr/sbin/sendmail -oi -t'; use constant POSTMASTER => 'terra@sitename.com'; use constant CONFIG_ROOT => '/home/sitename/tfmail/'; use constant SESSION_DIR => '.'; use constant MAX_DEPTH => 0; use constant CONFIG_EXT => '.trc'; use constant TEMPLATE_EXT => '.trt'; use constant ENABLE_UPLOADS => 0; use constant USE_MIME_LITE => 1; use constant LOGFILE_ROOT => '/home/sitename/tfmail/log/'; use constant LOGFILE_EXT => '.log'; use constant HTMLFILE_ROOT => ''; use constant HTMLFILE_EXT => '.htm'; use constant CHARSET => 'iso-8859-1';

the logile_ext and logfile_root fields were left blank. i recently tried filling the fields out (as they are above now) and this still did not solve the error message problem.

i created a log folder under the tfmail folder and saved a notpad file as .log...... i hope this is not too amusing...

I do not understand how to create a logfile template (i think i need a template?!) and the actual logfile itself. i have searched and searched google and forums for information on how to do this. is a log file simply a notepad file saved with a .log extension?

at this point if anyone can please help i will even pay you something if you want. i know this is probably simple stuff for people who understnad fully but it is daunting for me.

please and thank you.,
zak

Replies are listed 'Best First'.
Re: tfmail_application error_bad logfile name
by graff (Chancellor) on Oct 04, 2005 at 21:31 UTC
    Based on what the error message says, your full "TFmail.pl" script is over 1000 lines long (the error occurs at line 1048 in that script) -- so I guess it's just as well that you don't try to show us the whole script.

    Still, we can't answer your question without knowing what some of your perl code looks like, especially the part that includes line 1048 in that file. The message says you are trying to use a bad logfile name, and it looks like the value you have for the file name may be an empty string, or something that is not a visible character (e.g. space, tab, carriage-return or line-feed, or some control-character maybe).

    Your config data shows that you have a directory path and a file name extension for the log file. So how are you setting the actual file name (the part that goes between the path and the extension)? Is this being stored in a scalar variable? How/where is that scalar value set in your code?

    Look at line 1048 in your script, figure out how the log file name is being supplied there, and then, if it's a scalar variable that is supposed to be holding the file name, search around in the script to see whether a value is being assigned to that variable. If you find that, show us the relevant parts of the code (just the parts that determine how the file name is assigned). If you don't find it, that's probably the root cause of the problem -- a file name value needs to be provided.

    I don't think this has anything at all to do with using Notepad to create an initial log file. Don't worry about that. The logging process should create the file if it does not exist, and append to it when it does exist.

      Just for the record, tfmail comes from http://nms-cgi.sourceforge.net/, and the support page is here.

      You can see it TFmail.pl here.

      Apparently the logfile name comes from a config file.

      From the error message it looks like the OP has chosen a space as the logfile name, which apparently isn't allowed (as you can see, the error message isn't exactly cryptic).

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

      Hi

      In the process of installing and configurring the tfmail, i have come accross this error that i dont know how to correct:

      An error has occurred in the program bad logfile name [ ] at /home/actercoa/safefoodkenya.com/cgi-bin/TFmai +l.pl line 1048. My TFmail.pl line 1048- 1053 looks like this: my $file = $treq->config('logfile', ''); $file = $treq->process_template("\%$file",'email', undef); return unless $file; $file =~ m#^([\/\-\w]{1,100})$# or die "bad logfile name [$file]"; $file = $1; open LOG, ">>@{[ LOGFILE_ROOT ]}/$file@{[ LOGFILE_EXT ]}" or die "o +pen [$file]: $!"; flock LOG, LOCK_EX or die "flock [$file]: $!"; seek LOG, 0, 2 or die "seek to end of [$file]: $!";

      Kindly assist me to resolve this.

      Kindest regards

      Jared Otieno

        The error message is bad logfile name, so most likely you configured the logfile name in a way that is incompatible with the permissions on your machine.

        Which is the same error that was already discussed in the three preceeding posts in this thread.

        What steps have you taken to ensure that your situation is different from the situation posted previously? Where did you encounter problems?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://497373]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found