Phplist failing on mbox file to process bounced email


I’m getting into the following error :

Cannot open mailbox file Can't open mailbox /var/spool/mail/listbounces: no such mailbox
Identifying consecutive bounces
Nothing to do
total of 0 subscribers processed                            

The file seems to be accessible to the www-data user. The threads about this in the old forum recommend using pop (which is not possible in my case), it this a bug ? or am I missing something ?

I don’t think it’s a bug, but probably indicates a configuration error.

First, you need to setup the bounce email box, and then figure out what the settings are to read it. Once that is done, you can setup your phpList in the config.php file.

If you are having trouble figuring out what the mailbox reading settings are, it is helpful to use outlook, or thunderbird to figure out the settings.

Why would pop not be available in this case?

@danwaterloo thanks for your reply

POP is not available, I don’t think the reasons are relevant here. If phplist provides two ways of handling bounces, they should both work.

Any further indications on how to debug this problem ?

have you done these things @arthurlogilab?

The error you are getting says that phpList cannot read that mailbox file.

Cannot open mailbox file Can’t open mailbox /var/spool/mail/listbounces: no such mailbox

I would focus on that.

1 Like

I have a bounce email setup yes. I have set it up in config.php with the mbox approach.

No need to look at thunderbird since I’m not using the pop approach to this feature.

I am focussing on this, but the file exists, and is readable by the user of the web server. Am happy to debug further if you can point me in the right direction.

It could be a Unix permissions issue. You might want to momentarily set the permissions to 777 for the file and directory to verify that is or isn’t the case.

no luck. chmod 777 doesn’t change the error.

The php imap extension uses a library c-client that provides the imap functions, and it is that library which I think is causing the problem, not phplist nor php.
On my system, linux mint, the library has been compiled with a setting that stops direct access to file paths beginning with ‘/’.

enable compile-time option restrictedBox to disallow paths beginning
with … or /

So in effect only files within the current user’s home directory can be accessed.
That is what I had begun to conclude after writing a test program, and the only way to open and read a file was by specifying a path relative to my home directory and running php from the command line. The same test program didn’t work when run as a web page.

What might work is to create a symbolic link within your home directory to the spool file, e.g.

ln -s /var/spool/mail/listbounces /home/me/listbounces

and specify the relative path in config.php

$bounce_mailbox = 'listbounces';

Then run processbounces from the command line or a cron job so that it runs as your user.

This Drupal support topic explains more coherently the problem, and then [later down the page] ( is confirmation that the symlink approach should work, even for the www-data user.

@duncanc thanks for the tip. Putting the relative path in config.php and listbounces file in /var/www/ did the job (altough I don’t think it’s the prettiest solution). Maybe the documentation should reflect that.

1 Like

Can you specify which bit of documentation this might go in - I don’t fully understand the discussion. Did you read some doc’s where it would have been useful?

Two places I would give a more precise information : the config.php comments that are deployed by default and (the example in both cases is misleading)

Ah, ok, so those old docs will be removed in the next few weeks anyway. Can you suggest a change to the config.php comments, either on mantis or directly as a pull request on github?