Using MBOX for handling bounces

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

Using MBOX for handling bounces

Postby secretions » 2:36am, Sat 15 Mar, 2008

I was trying to figure this out myself, and found a solution that worked for me.

I found something claiming that the debian version of the c-client library (part of the imap library) was compiled with some option so it absolutely will not read an mbox file outside of a user's home directory. So without a recompile of the library, you can only give it paths to the mbox file that start from the home directory and don't contain any "../" in the path.

While I haven't verified the statement above myself, I did find that if I created a user and symlinked the mbox file to the user's home directory, I could set $bounce_mailbox=nameofmbox, and it worked fine.

What I did in the end was create a user for the bounces (phplist-bounces), and set their home directory to /var/mail, and now bounce processing works fine via mbox.
secretions
phpList newbie
 
Posts: 1
Joined: 2:26am, Sat 15 Mar, 2008

Postby WinstonN » 7:14am, Mon 17 Mar, 2008

Good one brother!
glad you fixed it!

Wins
Winston Nolan
http://www.buyxonline.com
eCommerce and Email Marketing
WinstonN
PL Master
 
Posts: 158
Joined: 3:31pm, Sun 04 Feb, 2007
Location: Cape Town, South Africa

Re: Using MBOX for handling bounces

Postby johnh530 » 6:22pm, Wed 09 Apr, 2014

This pointer is quite helpful for setting up mbox on local machines.
Here are a few additional points:

1) The "home" directory is going to be not for the user you may have set up but for the user associated with apache - in my case "home" was /var/www.

2) I set up a directory Bounce in /var/www and then in that directory set up a symlink to /var/mail/"user" where user is what you set up (listbounces is what is by default).

3) I then configured config.php to have:
$bounce_mailbox = 'Bounce/"user"';
where user is user you set up (listbounces is what is by default).

4) I made sure persmissions on the /var/mail/"user" were so the web server could read and write.

Hope this helps.
johnh...
johnh530
phpList newbie
 
Posts: 2
Joined: 1:01am, Sat 05 Apr, 2014

Re: Using MBOX for handling bounces

Postby hatch789 » 5:00pm, Fri 20 Mar, 2015

Guys ok the REALLY big item here that everyone keeps missing is that this variable needs to be pathed from the user's root directory. Not from the root of the system.

The directions should be changed in the config file and the example of /var/mail/listbounces is totally misleading.

1. Create a phplist user on your server so that user can get mail and have a mailbox created. I made user [phplist-bounces] as my username. You can use 'useradd -s /usr/sbin/nologin phplist-bounces' to do this.

2. The setting below in config.php is referring to the Apache user. Not this phplist user you just made. Ubuntu uses www-data for its apache user so grep your /etc/passwd file to find your apache user's root directory.

3. Then make a symlink ( ln -s ) from the real mailbox file to the root directory of your apache user. NOTE: You can create a directory in the apache user's root folder if you like but then you'd need to give that folder first in the variable below. Example: 'folder/phpuser-bounces'. I just let my link sit in the root of my apache user's home directory (/var/www).

4. This file that you link to (the real mail file at /var/mail/xxxxx) needs to have rw permissions on it for the apache user. I just did chmod 666 on this file and that was fine.

# when the protocol is mbox specify this one
# it needs to be a local file in mbox format, accessible to your webserver user
$bounce_mailbox = 'phplist-bounces';
hatch789
phpList newbie
 
Posts: 1
Joined: 4:48pm, Fri 20 Mar, 2015


Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest