[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-mailbox
Subject:    Re: runaway log message, Folder groupie is already open.
From:       Greg Matheson <lang () ms ! chinmin ! edu ! tw>
Date:       2003-03-25 13:16:44
[Download RAW message or body]

On Tue, 25 Mar 2003, Mark Overmeer wrote:

> * Greg Matheson (lang@ms.chinmin.edu.tw) [030325 00:32]:
> > I have filled up my /home filesystem with this line to my log:
> > 	Folder groupie is already open.

> Maybe you can show me a small code extract.  Apparently, it is more
> than once or twice.... Besides: you use log-level NOTICE, which
> is lower than the default WARNING, which produces a few more messages...

The program is 200 lines long. I'll send it off list and post a few
sections here.

	while ( 1 )
	{
		print "Targets: '";
		my @targets;
		push @targets, $targets->pop_members 
						while $targets->get_members;

		I accept some input for the targets and then
		push it back in the object.

		$targets->push_members( $_ ) foreach @targets;
		last;
	}

	Then I call a recursive method to give me the addresses
	of the students. It is recursive because the targets may
	in fact be not just groups of students, but groups of
	(groups of) groups of students.

	my @students;

	@students = Entity::Person->rollCall( $targets
						, addressrc => 'addresses'
						, grouprc => 'groups' );

	Then I create the email for each student and save it in
	archives, one archive for each group, but by this stage I
	don't have any group information left. This is why I
	try to open the same folder more than once,
	presumably.

	
	foreach my $student ( @students )
	{
		my $body = Mail::Message::Body->new( data => $text );
		my $job = Mail::Message->buildFromBody(
				$body
				, To => $student->address->format
				, From => 
				$maildb{channel}\@localhost.localdomain
				, Subject => 'hi'
				);
		$job->send( via => 'exim' );

		my $circle = Entity::Group::Circle->new( {
					memberNames => $student->memberNames
					, addressrc => 'addresses'
					, grouprc => 'groups'
						} );

		my $archive = $mailroom->open(
					folder => "$dir"
					. $circle->nameCircle
					, create => 1
					, save_on_exit => 1
					, access => 'rw'
					);

		$archive->addMessages($job) or die "add job? $!\n";
	}

        $mailroom->closeAllFolders or die "close AllFolders? $!\n";

	goto START;

> I cannot see that this method produces more than one message each time
> open() is called, so I think it is a problem in the calling program.

I did not have any mail loops. I was not getting lots of mail in
the folders. The length of @students was 6, I think. Or was it 1?

-- 
Greg Matheson                Where do I have to be to get to
Dr Bean's Penpal Pool        where I want to be?
Address: palpool             --Dr Bean
Domain:  @cn91.chinmin.edu.tw

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic