/    Sign up×
Community /Pin to ProfileBookmark

tfmail_error_bad logfile name

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:

use constant DEBUGGING => 1;
use constant LIBDIR => ‘/home/sitename/tfmail/’;
use constant MAILPROG => ‘/usr/sbin/sendmail -oi -t’;
use constant POSTMASTER => ‘[email protected]‘;
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 (when it worked). 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 for you experts…smile…

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. i know this is probably simple stuff for people who understnad fully but it is daunting for me.

please and thank you.,
zak

to post a comment

7 Comments(s)

Copy linkTweet thisAlerts:
@fireartistOct 05.2005 — bad logfile name [ ] at TFmail.pl line 1048
Check out what's at the line no. quoted.

Figure out exactly what filename it's trynig to open, and why it's failing that test.

Check that the webserver user has write permissions on the folder.

If it's failing to open the file, the program would normally create the file if it doesn't already exist, so it's probably a path or permissions error.
Copy linkTweet thisAlerts:
@albuckNov 01.2006 — I also got the bad logfile name error from TFmail.pl, and nothing I could do with changing LOGFILE_ROOT was changing that. Looking at the code, it seemed that this error was coming from reading a template but before actually trying to write a log file. After tracking down some other Google hits and (duh!) reading the long README file included in the package, I found it.

Buried in the README on page 13 of 16, there is a section called "Writing to a Log File", which shows the two necessary lines in the .trc file:

logfile: foo

log_template:

%{= date =} <etc...>

I think that once LOGFILE_ROOT is anything other than '' (empty), the code must fine the logfile: entry or it bombs. When it comes time to write the logfile, it will be named from the logfile: configuration line, something like foo.log above.

The log_template can be an arbitrary number of lines beginning with %, as can the confirmation_template, also sparsely documented.

But it all works very nicely now.

Best regards,

Lester
Copy linkTweet thisAlerts:
@jaredotiDec 08.2016 — Hi,

I have read your reply on the same issue but still dont understand how to change my log file on my TFmail.pl line 1048.

my line 1048 script looks like this:

$file =~ m#^([/-w]{1,100})$# or die "bad logfile name [$file]";

Now kindly advice, what should i change it to look like for it to work? Secondly, do I change it on the TFmail.pl or their is a place to configure the same?

Regards

Jared
Copy linkTweet thisAlerts:
@linhdr15Jan 10.2017 — I think that once LOGFILE_ROOT is anything other than '' (empty), the code must fine the logfile: entry or it bombs. When it comes time to write the logfile, it will be named from the logfile: configuration line, something like foo.log above.
Copy linkTweet thisAlerts:
@acheterMar 17.2017 — The above example from the

README was supposed to be a snippet from the .trc file - if you want to

use the similar format in a separate log.trt then you would have:

%% NMS email template file %%

{= date =}<x>{= env.REMOTE_ADDR =}<x>{= param.email =}
Copy linkTweet thisAlerts:
@reshyamMar 28.2017 — Hi Guys,

Well come to forum site.We also got the bad log file name error from TF mail.pl, and nothing. We could do with changing LOG FILE_ROOT was changing that. So looking at the code, it seemed that this error was coming from reading a template but before actually trying to write a log file. tracking down some other Google hits and (duh!) reading the long READ ME file included in the package.We think that once LOGFILE_ROOT is anything other than ''. This code must fine the logfile: entry or it bombs. When it comes time to write the logfile, We will be named from the logfile: configuration line
×

Success!

Help @zakaro spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...