PDA

View Full Version : vBouncer (PHP): reduce server load by unsubscribing bouncing members from threads


tamarian
06-25-2005, 10:00 PM
There's also a vB 3.5 version: https://vborg.vbsupport.ru/showthread.php?s=&threadid=83486

vBouncer is a handy tool for busy forums (or those that do not require email verification) to control the amounts of bogus emails sent from and to your server. This was initially released for vB 2.x and vB 3.0.x as a Perl script, and is now fully integrated with vB as scheduled tasks with admin panel control.

What vBouncer does: vBouncer monitors your mail spool file, and identifies members responsible for large amounts of bounced emails. It then issues a PM warning, and when the unsubscribe threshold is met, it will will unsubscribe them for all threads, and sets them to the "no email" subscription level.

After a couple of runs, this should significantly reduce your server load.

Features:
Manual or auto processing option
Collect logs via IMAP/POP or mail spool file
Uses vB's cron files (Scheduled tasks)
Custom filters to match patterns in bounced emails
Encryption header to authenticate bounces.
Stats on members with bouncing emails, and error codes
Tuning options
Verbose cron logs for diagnostics
Option to send PM warning prior to reaching the limit
Option to send PM notifications after reaching the limit
Option to change the member's subscription default
Option to all thread subscriptions to "no email"
Option to all forum subscriptions to "no email"
Option to move offenders to a different primary usergroup
Option to process 5.0.0/550 errors (email unknown) upon a single email, isntead of observing the bounce limit

Installation:
1. Extract the files into the corresponding directories (admincp => admincp, includes/cron => includes/cron)
2. Run the installation script in the admincp
3. Fill out the settings menu in the vBouncer section of the admin panel (see the how-to post below)
4. Edit includes/mail.php
Find:if ($minusf)
{
$this->success = @mail($toemail, $subject, $message, trim($headers), "-f $fromemail");
}
else
{
$this->success = @mail($toemail, $subject, $message, trim($headers));
}
Replace with:

global $vboptions;
if (is_valid_email($vboptions['vbouncer_spool_account'])) {
if ($vboptions['vbouncer_header_return_key'])
$headers .= 'X-Return-ID: ' . md5($vboptions['vbouncer_header_return_key'] . $toemail) . "\n";
$this->success = @mail($toemail, $subject, $message, trim($headers), '-f' . $vboptions['vbouncer_spool_account']);
}
else
$this->success = @mail($toemail, $subject, $message, trim($headers), "-f $fromemail");

In admincp/index.php, find:
if (can_administer('canadmincron'))
Add before::
if (can_administer('canadmincron'))
{
construct_nav_option('vBouncer Settings', 'options.php?do=options&dogroup=vBouncer', '|');
construct_nav_option('Stats', 'vbouncer.php?do=stats', '<br />' );
construct_nav_option('Diagnostics', 'vbouncer.php?do=diag', '<br />');
construct_nav_group('vBouncer');
}
5. Once ready, add the cron scripts to your scheduled tasks: vbouncer-collect.php (should be run daily, or more frequently) and vbouncer-clean.php (weekly, equal to Bounce limit period)

Change log:

- July 11, 2005 v1.2 Bug fix for some server/PHP setups; resolve aliases for return keys, otherwise some aliases would be considered forged.

- July 5, 2005 v1.1 Bug fix in standard report pattern matching

- July 4, 2005 v1.0 Added encrypted header for authentication (suggested by Paul M).

- July 3, 2005 v0.9.1 added fixed a bug preventing IMAP/POP log collection.

- July 2, 2005 v0.9 added IMAP/POP option and custom filters file vbouncer.ini

- June 27, 2005 v0.51 for 3.0.7 Corrected installer file.

- June 27, 2005 v0.5 for 3.0.7 Add setting for custom header strings.

- June 26, 2005 v0.2 for 3.0.7 Initial release No changes, just removed the plugin

Screenshots from 3.5 beta, but it looks the same on 3.0.7...

tamarian
06-26-2005, 03:57 PM
This post will be used for an updated FAQ and How-To's

How it works
1. vBouncer makes your forum send emails with a modified "Return-Path" header including the vBouncer emaila ddress, so most ISP's will send bounce notices to that email (instead of the webmaster email).
2. When ISP's send the bounced notices, those notice emails are stored in the mail spool of vBouncer. Most will tag those notices with a "Final-Destination" header stating the email address that bounced.
3. The vBouncer cron task (vBouncer-collect.php) checks the spool file and extracts all email adresses that are bouncing, and store them into a database table, if they belong to a forum member. It wil then empty the spool file.
4. If you selected auto processing, the vBouncer cron task (vBouncer-clean.php) reads the table and stats, and executes the options you chose to apply in your vBouncer settings. The database table will pruned from any old data.

Email setup: For vBouncer to work, you need to:
1. Create a new email account on your server, and that email account has to be unique, and only used for this purpose, collecting bounced emails.
2. This account should not be POP'ed or deleted by any user, only vBouncer should delete them.
3. The vBouncer emails should be in a regular spool file (text file). This is standard on SendMail and PostFix. Not sure about Qmail, Exim or Windows, but they should able to do it. (Anyone with experience in those systems, please let me know)
Please check with your server admin how to accomplish this.

Tips:
If you can't make your mail server spool to a single text file, you may want to try the (dot)forward file method:
http://publib16.boulder.ibm.com/pseries/en_US/files/aixfiles/forward.htm
See post #3 below for further details on mail servers.


vBouncer Settings The comments on the vBouncer settings page are verbose, but here are the important ones with additional comments.

Post notification sender email
This is the email vBouncer will use to send new reply notification. You need to create a unique email address for this. Bounced emails will be returned to this email address on your site/server domain. This email account should not be downloaded, and must be left waiting, vBouncer will pick it up.
Example: subscriber_notify@mydomain.com

Full path to email spool file
This is the full path to where the mail spool file resides. This is where bounced email notifications are sent back to the post notification email.
Example: /var/spool/mail/subscriber_notify
(Use the diagnostics option to sure the file is readable and writable)

Maximum unique members to process per run
Processing the mail log file will stop when this limit is reached. If your logs repeatedly excede this number, it is better to run the scheduled vBouncer collect task more frequently, instead of making this limit too high, for performance reasons. Example 100

Auto processing mode?
You have the option to either let vBouncer automaticly change subscription levels for members with bouncing emails, or choose no if you prefer to simply decide based on the stats of bouncing emails.
Yes No
(Choose no, if you just want to monitor the stats)

Bounce limit
If you selected auto-processing, how many bounced email notices should be acted upon?. (Only works in auto mode) Example: 50

Bounce limit period
Enter the number of days in which the bounce limit set above will be applied. (Only works in auto mode) Example: 7

The above two options results in setting a limit of X email bouncer per Y days period.

Send Notification PM
PM Sender ID
PM Sender Username
Send PM warning
Warning Limit
Change default subscription level to no email
Change subscribed threads to no emails
Change subscribed forums to no emails
Change usergroup for bouncing members?
Destination usergroup
Protected usergroups
Untouchable usergroups
These options control what actions to do with members who excede the set limits.

tamarian
06-26-2005, 03:58 PM
Note: If you use vBouncer's IMAP/POP method, you do not need to follow the instructions here. This is only for those who prefer to use mail spool files.

Spool files How-To

This post addresses the location and setup of spool files on different mail server software. You will only need it if you can't find your mail spool file, or don't have one.

Sendmail: Sendmail by default spools the emails for each email address into a text file. Usually found in /var/spool/mail/account_name (account_name is the account in the email address, like subscriber_notify, for example)


Postfix: Postfix, like Sendmail, spools the emails for each email address into a text file. Usually found in /var/spool/mail/account_name (account_name is the account in the email address, like subscriber_notify, for example)

QMail: (Thanks to Merk for testing and providing the information) QMail, by default stores emails in Maildir format, new file for each email. In order to spool emails to a single file, you need to do the following steps:

In the home directory of the user account (subscriber_notify), create a file called .qmail the content of that file should be a single line indicating the file path where you want the emails to be stored:

/var/spool/mail/subscriber_notify

Or any path you choose. The file needs to exist, so we can first create it by using the touch command:

touch /var/spool/mail/subscriber_notify

And it needs be readable and writable by PHP, so use the chmod command:

chmod 666 /var/spool/mail/subscriber_notify


Vpopmail+QMail: (Thanks to Merk for testing and providing the information) For vpopmail, a user doesnt have a home directory, and it dosent go into the users virtual mail directory either, it sits just below that in the domain's "root" directory. /home/vpopmail may be different for some users.

/home/vpopmail/domains/domain.com/.qmail-subscriber_notify for subscriber_notify@domain.com (contents as above)

The contents of the .qmail file are still the same described above for QMail. You just need to follow the same steps to create .qmail file and the file to spool the emails too.



Exim+cPanel: (thanks to Paul M for this tip)

Note, before you do this, check this post:

https://vborg.vbsupport.ru/showpost.php?p=753409&postcount=101

It may be best to avoid changing the config of Exim, and just use the IMAP/POP option in vBouncer.

In the exim config file ( /etc/exim.conf ), near the bottom is a section that begins with virtual_userdelivery: - in that section is a line which says mode = 0660 - change this to mode = 0666

In your cpanel account, for address rejects@domain.com

The path needs to be " /home/<cpaccount>/mail/domain.com/rejects/inbox "

The mail, domain.com & rejects folders all need chmod'ing to 755.

The mailbox file can then be set to 666, and it will work.


Windows Mail Servers: Still waiting for testers and information


----------------------------

If your server is running Exim or a Windows mail server, please post here:

https://vborg.vbsupport.ru/showthread.php?t=83407

Once the information is provided (in that thread), and we get you up and running, the instructions for those specific mail servers will be posted here.

Note that it may actually work out of the box even if you don't have SendMail or PostFix. If you have a text file on your server that can store the emails for a specific account, then you're all set. It's just that I have no experience with those systems, so I don't know.

ImportPassion
06-26-2005, 04:34 PM
i will install with Exim. let u know.

tamarian
06-26-2005, 05:32 PM
i will install with Exim. let u know.

Great, I look forward to the results. :)

buro9
06-26-2005, 06:45 PM
Great, I look forward to the results. :)
I've installed the PHP version as I loved the PERL version but was always too lazy about running it.

I've got a Cpanel server with Exim, and I've setup an account (for the old vbouncer) named subscription_bounces@example.com (obviously not example.com, use your imagination and insert domain name for the rest of this post ;)).

The old one used this file:
/home/example/mail/example.com/subscription_bounces/inbox

Which worked fine, and was run from SSH under the example account.

The diagnostics for the PHP version doesn't like this though.

It tells me that the file does not exist, that it is not writable nor readable. But logged on via SSH I can see it, and I've given read permissions to everyone for the file.

The PHP process tends to run as nobody as I'm running eaccelerator and that requires PHP to run as a module rather than CGI. However I'm unconvinced that's the issue as the file is world readable.

Any ideas why the diagnostics doesn't like it?

ImportPassion
06-26-2005, 07:15 PM
when i run diagnostics, it tells me that the files doesn't exist and is not readable or writeable.

appears Exim is one file.

/home/name/mail/domain/subscriber_notify/inbox

edit: just read the post above. same issue here.

Paul M
06-26-2005, 07:22 PM
buro9 and 7thgenCivic.Com - the reason is in my post here (problem 1).

https://vborg.vbsupport.ru/showthread.php?p=726338

tamarian
06-26-2005, 07:49 PM
However I'm unconvinced that's the issue as the file is world readable.

The file should be also writable by the apache process. Use chmod 666

Paul also mentioned this might be due to restrictions of PHP access outside the HTML root.

You might want to try a sym link

ln -fs /home/example/mail/example.com/subscription_bounces/inbox /path/to/admincp/subscriber_notify

Now you should be able to use /path/to/admincp/subscriber_notify as the file location (also make it chmod 666

Let me know if this fixes the problem

buro9
06-26-2005, 08:58 PM
The file should be also writable by the apache process. Use chmod 666

Paul also mentioned this might be due to restrictions of PHP access outside the HTML root.

You might want to try a sym link

ln -fs /home/example/mail/example.com/subscription_bounces/inbox /path/to/admincp/subscriber_notify

Now you should be able to use /path/to/admincp/subscriber_notify as the file location (also make it chmod 666

Let me know if this fixes the problem
The symlink didn't work. I set the permission for both the file and the link as 666. Diagnostics still failed.

I've also tried disabling the open_basedir setting for PHP within httpd.conf but that fails.

How much effort do you reckon for creating a PHP POP3 variant of this hack for those who have trouble reaching the spool file?

tamarian
06-26-2005, 09:10 PM
The symlink didn't work. I set the permission for both the file and the link as 666. Diagnostics still failed.

I've also tried disabling the open_basedir setting for PHP within httpd.conf but that fails.

How much effort do you reckon for creating a PHP POP3 variant of this hack for those who have trouble reaching the spool file?

I'd consider that option, but first we need to know why the file can't be read. What are the apache error logs showing?

buro9
06-26-2005, 09:46 PM
I'd consider that option, but first we need to know why the file can't be read. What are the apache error logs showing?

Not a thing unfortunately. It's not logged as an error in Apache.

The vBulletin scheduled task log says this for the Collect task though:

Status: Mail spool file not found, exiting.

tamarian
06-27-2005, 01:02 PM
version 0.5 released: Option to use custom header strings to identify bouncers. (Example, some Exim users may need to enter 'X-Failed-Recipients:'.

To upgrade: uninstall, then re-install :)

tamarian
06-27-2005, 02:42 PM
I posted this in the 3.5 thread, but maybe soemone here can test it:

---

I would like someone using Exim+Cpanel to test the .forward (dot-forward) file method :)

Here's how it works:

1. Create a file somewhere in your public_html directory /path/to/forum/admincp/subscriber_notify
this file should be readable/writable (666)

2.In your (subscriebr_notify) user home directory, create a .forward file. The .forward file should have one line in it:
/path/to/forum/admincp/subscriber_notify

The theory is that Exim will start forwarding emails to that file.

Not sure what Exim considers "home" directory, so you may need to try creating it in different directories for that user account (subscriber_notify) to test which directory is the right place for .forward

Send an email to subscriber_notify, and check if it was copied to that file. Exim manual states that this should work, so let's keep our fingers crossed. :)

tamarian
06-27-2005, 04:28 PM
Another request for Cpanel+Exim users. I'm writing a POP maodule as an option instead of reading files. I'll need to test my code (from my home server) with your bouncer email box. If you'd like to volunteer :) please PM me the new account's (subscriber_notify) POP username and password.

psico
06-27-2005, 04:32 PM
- June 27, 2005 v0.5 for 3.0.7 Add setting for custom header strings.

I don?t see that option...

tamarian
06-27-2005, 04:50 PM
I don?t see that option...

My bad. Updated zip 0.51 should have it.

ImportPassion
06-27-2005, 05:12 PM
i am moving servers, so I am going to wait. but it will still be cpanel.

|Jordan|
06-27-2005, 06:56 PM
When i run the install file it says:

Fatal error: Call to a member function on a non-object in **********/public_html/forums/admin_cp/vbouncer_install.php on line 20

And line 20 is $vbulletin->input->clean_array_gpc('r', array(

And when i uncomment that line i get an error; Any ideas what's wrong?

And im using 3.0.6 with security fix from 3.0.7

tamarian
06-27-2005, 07:20 PM
When i run the install file it says:

Fatal error: Call to a member function on a non-object in **********/public_html/forums/admin_cp/vbouncer_install.php on line 20

And line 20 is $vbulletin->input->clean_array_gpc('r', array(

And when i uncomment that line i get an error; Any ideas what's wrong?

And im using 3.0.6 with security fix from 3.0.7

I made the 0.51 update, but forgot to upload the file. Get the new zip, and let me know how it goes.

|Jordan|
06-27-2005, 08:11 PM
That error came from the 051 update

tamarian
06-27-2005, 08:42 PM
That error came from the 051 update

That just can't be :) Line 20 is not the same as the one you posted.

Is it possible you downloaded the 3.5 version?

psico
06-27-2005, 09:07 PM
Tnx! Now it?s working!
My bad. Updated zip 0.51 should have it.

tamarian
06-27-2005, 09:54 PM
The next version will have a POP/IMAP option. This will be useful to those in chroot environments, or those on multiple servers, or using external mail servers.

I have it working, but I need some test volunteers. If you have a POP account for the subscriber_notify account, send me the POP access info by PM. (The worst I can do is delete a couple of bounced emails!) :)

I can't install Exim on my system, since I never used it, and would be time consuming for me.

psico
06-28-2005, 06:36 PM
The next version will have a POP/IMAP option. This will be useful to those in chroot environments, or those on multiple servers, or using external mail servers.

I have it working, but I need some test volunteers. If you have a POP account for the subscriber_notify account, send me the POP access info by PM. (The worst I can do is delete a couple of bounced emails!) :)

I can't install Exim on my system, since I never used it, and would be time consuming for me.
I have a problem to get the email address of certain bounced mails, for example this:


From MAILER-DAEMON Tue Jun 28 17:22:58 2005
Return-Path: <>
Delivered-To: psicofxp-bounce@psicofxp.com
Received: (qmail 10394 invoked for bounce); 28 Jun 2005 17:22:58 -0000
Date: 28 Jun 2005 17:22:58 -0000
From: MAILER-DAEMON@mx11.elserver.com
To: bounce@psicofxp.com
Subject: failure notice

Hi. This is the qmail-send program at mx11.elserver.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<Marto04@hotmail.com>:
65.54.253.99 does not like recipient.
Remote host said: 550 Requested action not taken: mailbox unavailable
Giving up on 65.54.253.99.


I don?t know what custom header have to use for this bounce...

Can u help me?
Tnx in advance.

Psico.

tamarian
06-28-2005, 06:50 PM
Can u help me?

Yes, this is currently what I'm working on for the POP part, where some MTA's don't show full error-code headers, just content. What is your server's email software? Exim?

If you can send a large file containing all the bounces, it would help me test the new code. Better yet, temporary access to the subscriber_notify POP account. :)

psico
06-28-2005, 06:56 PM
Here is the bounce file.

I can´t give u access to the pop account because i´m using qmail with something like vpopmail, so the mail ends in the file not in the pop folder...

I really need this hack...badly...my server have too much load because of bounced mails...

Tnx a lot!

tamarian
06-28-2005, 07:03 PM
Here is the bounce file.

I can?t give u access to the pop account because i?m using qmail with something like vpopmail, so the mail ends in the file not in the pop folder...

I really need this hack...badly...my server have too much load because of bounced mails...

Tnx a lot!

No problem, I'll send you temp copy to test. Please save me a copy the bounced email file, as the bigger the sample the beter.

psico
06-28-2005, 10:42 PM
No problem, I'll send you temp copy to test. Please save me a copy the bounced email file, as the bigger the sample the beter.
The sample above is not enough?

Here is another...

tamarian
06-28-2005, 11:20 PM
The sample above is not enough?

Here is another...

I prever something really big, just to see how your MTA rewrites headers from different ISP's. Think something in the tune of 100 megs :)

psico
06-29-2005, 02:57 AM
I prever something really big, just to see how your MTA rewrites headers from different ISP's. Think something in the tune of 100 megs :)
No, impossible...this will take weeks or more...

Spinball
06-29-2005, 06:31 PM
Hello tamarian.
I've set this hack up using the latest version.
My host has set all emails with the particular email address to go to /var/mail/admin.
It's 1,547,032 bytes in size at the moment and -rw-rw-rw-.
I've gone through the vbounce settings and selected my preferences and I have added collector and cleaner to the scheduled tasks.
Everything passes the diagnostics.
To speed things along I have run the collector but in the vbouncer report it shows nothing has happened.
Is there any way I can check to see why nothing is happening?

tamarian
06-29-2005, 06:53 PM
Hello tamarian.
I've set this hack up using the latest version.
My host has set all emails with the particular email address to go to /var/mail/admin.
It's 1,547,032 bytes in size at the moment and -rw-rw-rw-.
I've gone through the vbounce settings and selected my preferences and I have added collector and cleaner to the scheduled tasks.
Everything passes the diagnostics.
To speed things along I have run the collector but in the vbouncer report it shows nothing has happened.
Is there any way I can check to see why nothing is happening?

Are you using Exim? Was the mail file exclusively full of bounced emails? (I mean not SPAM and stuff, just hard and soft bounces). Was the scheduled task log really empty, no text or status header?

I'm working on handling Exim reports (or those with bounce messages without bounce reports). If you have a decent sized sample, please email it to me :)

Spinball
06-29-2005, 07:17 PM
Sorry, I don't know what Exim is or how to view the contents of the mail file. Though we've sent some test emails to that account.
The scheduled task log for collect reports 'No matches found'.

tamarian
06-29-2005, 07:37 PM
Sorry, I don't know what Exim is or how to view the contents of the mail file. Though we've sent some test emails to that account.
The scheduled task log for collect reports 'No matches found'.

What email software is installed on your server?

A couple of things might be happening:

1. The file does not contain bounced emails, just regular emails, spam and the usual viruses, etc.

2. The file contain bounced emails, but no MTA bounce reports.

If it's #1, you may need to create a new email account for the sole purpose of using for vBouncer, so the file will contain only bounced emails.

If it's #2, your MTA doesn't generate bounce reports. This should be handled by the next version I'm working on.

adhari_com
06-30-2005, 12:30 PM
Working perfectly .. Thanks alot dude :)

tamarian
06-30-2005, 03:48 PM
psico and spinball: PM me your email addresses. I'll send you a copy of vbouncer-collect.php to test and see if it works on your setup. If all goes well, I'll release it along with the POP/IMAP code.

Spinball
06-30-2005, 07:59 PM
psico and spinball: PM me your email addresses. I'll send you a copy of vbouncer-collect.php to test and see if it works on your setup. If all goes well, I'll release it along with the POP/IMAP code.
I emailed your last message to my host and he 'tweaked' and the hack now works!! Yeah!! Thanks for your help. 893 bounced emails right there!
I'm not sure I understand how altering the Bounce Limit and Bounce Limit Period affect how this hack works. For example, if a user has just a few bounced emails - say 5, I want to deactive their emails right away. I don't understand what the bounce period does.

One other thing - and was it you I had this conversation with re vbusy? The graphics don't appear in the chart because the specified location in the template is 'http://www.mydomain.com/forums/images/blahblah' and you might want to test for this in your hacks so the graphics work for people who have vBadvanced installed.

tamarian
06-30-2005, 08:08 PM
I emailed your last message to my host and he 'tweaked' and the hack now works!! Yeah!! Thanks for your help. 893 bounced emails right there!

I assume he turned on bounce reports in the MTA, which I think would be the best solution. As this is very specific to each server setup, I can't offer tips on how others can do it, but if you can share what he did, that would be great.

I'm not sure I understand how altering the Bounce Limit and Bounce Limit Period affect how this hack works. For example, if a user has just a few bounced emails - say 5, I want to deactive their emails right away. I don't understand what the bounce period does.

Here's an example, say you set up:

Bounce limit = 50 emails
Bounce limit period = 7 days

Then only those who reach 50 email bounces within 7 days period will be processed.

You can set it to:

Bounce limit = 1 email
Bounce limit period = 1

This will auto process the user for any bounced email received

ImportPassion
07-02-2005, 01:54 PM
so what is the status with Exim? I moved servers, but it still doesn't work. I have an 853kb inbox file if you want to look at it. But i don't think that is the issue. permissions is the problem.

Derek

tamarian
07-02-2005, 02:01 PM
so what is the status with Exim? I moved servers, but it still doesn't work. I have an 853kb inbox file if you want to look at it. But i don't think that is the issue. permissions is the problem.

If the inbox file is full of bounced emails, yes, I'd like to see it :)

I'll post a new release later today, that should work fro those with Exim and control panels. It allows using POP/IMAP access instead of files, and custom filters.

ImportPassion
07-02-2005, 02:53 PM
here u go. have fun :)

tamarian
07-02-2005, 06:05 PM
Version 0.9 is out. New features added:

o Collect logs via IMAP/POP or mail spool file
o Custom filters to match patterns in bounced emails

To upgrade, uninstall, then reinstall through the installation script.

tamarian
07-02-2005, 08:51 PM
The 0.9 zip file has been updated. There was a typo, caught by Paul M, that will cause an error if you enable usergroup changes. Download the file again to fix it.

psico
07-02-2005, 10:03 PM
This is one of the most useful hacks ever!!!!

tnx dude!

ImportPassion
07-03-2005, 02:29 AM
I am trying to use POP, when I go to diagnostics, I get this error

Fatal error: Call to undefined function: imap_open() in /home/xxxxx/public_html/forums/admincp/vbouncer.php on line 141

ImportPassion
07-03-2005, 02:34 AM
also, it keeps failing on the POP test. are we supposed to type it in exactly like u have it?

{localhost:110/pop3}INBOX

D

tamarian
07-03-2005, 02:34 AM
I am trying to use POP, when I go to diagnostics, I get this error

Fatal error: Call to undefined function: imap_open() in /home/xxxxx/public_html/forums/admincp/vbouncer.php on line 141

This means your PHP was built/compiled without IMAP support.

tamarian
07-03-2005, 02:36 AM
also, it keeps failing on the POP test. are we supposed to type it in exactly like u have it?

{localhost:110/pop3}INBOX

Yes, if it's local, that should do it. Just make sure your PHP has IMAP support built/compiled in.

ImportPassion
07-03-2005, 03:04 AM
recompiling now. see how it goes soon.

ImportPassion
07-03-2005, 03:31 AM
ok, got it work. i ran the cron and it said this

Processed 292 emails No bounced emails found.

They are all bounced emails in there.

tamarian
07-03-2005, 03:39 AM
ok, got it work. i ran the cron and it said this

Processed 292 emails No bounced emails found.

They are all bounced emails in there.

This would mean either:

1. Those emails don't belong to any of your forum members, or
2. They do not match any of the patterns defined in vbouncer.inc

Check the emails to confirm they are forum notification bounces. If they are, then you will need to define a pattern in vbouncer.inc to capture them. If you're not familiar with ReEx patterns, post samples of those emails here or send me a copy.

ImportPassion
07-03-2005, 03:46 AM
they are the exact same ones in the zip i posted above earlier.

tamarian
07-03-2005, 04:07 AM
they are the exact same ones in the zip i posted above earlier.

And you have uploaded the vbouncer.inc to includes/cron? Is the stats page empty?

If you want, send me the subscriber_notify POP access info by PM, and I'll test them to see why the patterns don't work on them, or if a new pattern is needed.

ImportPassion
07-03-2005, 11:52 AM
yes, it is there and yes the stats is empty.

Sending the info now.

tamarian
07-03-2005, 12:20 PM
yes, it is there and yes the stats is empty.

Sending the info now.

Got the info, and found a bug :)

Open vbouncer-collect.php and find:

CombThrough($Header, $Body);

Replace with:
CombThrough($eMailHdr, $eMailBody);

ImportPassion
07-03-2005, 12:37 PM
working now!

I had to change this

$imgpath = '../' . $stylevars['imgdir_poll'];

to this

$imgpath = $stylevars['imgdir_poll'];

for the images to show up. that cause I have the full path in my images

tamarian
07-04-2005, 08:59 PM
- July 4, 2005 v1.0 Added encrypted header for authentication (suggested by Paul M).

To upgrade, uninstall, then re-install, and re-upload all files.

jb605
07-05-2005, 02:56 AM
Does this hack support secure pop? Is yes, how should I configure it?

Thanks a lot

tamarian
07-05-2005, 03:00 AM
Does this hack support secure pop? Is yes, how should I configure it?

Yes. Just configure the connection string in the settings menu.

Here's a link with differnt setups:

http://ca.php.net/manual/en/function.imap-open.php

It from the PHP manual, so ignore the code, just look at the example strings like:

{localhost:993/imap/ssl}INBOX
{localhost:995/pop3/ssl/novalidate-cert}

jb605
07-05-2005, 03:43 PM
Yes, if it's local, that should do it. Just make sure your PHP has IMAP support built/compiled in.

Maybe this is not so relative, but I seem not able to find an instruction on how to compile php with imap, a simple --with-imap (--with-imap=shared) and --with-imap-ssl won't work.

Can anybody share some experience?

Thanks.

tamarian
07-05-2005, 04:00 PM
Maybe this is not so relative, but I seem not able to find an instruction on how to compile php with imap, a simple --with-imap (--with-imap=shared) and --with-imap-ssl won't work.

Can anybody share some experience?

Thanks.

There maybe some dependencies missing. Check the error log from the compilation to what it complains about..

jb605
07-05-2005, 06:51 PM
I read the php document, looks like it says it needs something called c-client library. I thought php would have imap and pop support built-in, but seems it is more complicate than that. Also, after I tried the c-client library, looks like it is more of a pop/imap daemon than a client. I have my email service on another cpanel server, so I really just need php to be able to read imap mailbox. I am a little bit confused here.

BTW, if I choose to use email forward and now I can read the file locally, how would I update the stats manually?

Thanks.

tamarian
07-05-2005, 08:32 PM
I read the php document, looks like it says it needs something called c-client library. I thought php would have imap and pop support built-in, but seems it is more complicate than that. Also, after I tried the c-client library, looks like it is more of a pop/imap daemon than a client. I have my email service on another cpanel server, so I really just need php to be able to read imap mailbox. I am a little bit confused here.

I'm not familiar with cPanels, but I thought they can be easily configured to encorporate additional modules easily. Let's see if one of the cPanel users here has any tips for you.

BTW, if I choose to use email forward and now I can read the file locally, how would I update the stats manually?.

If the file is on your server, just enter the path in the vBouncer settings.

jb605
07-05-2005, 09:57 PM
I'm not familiar with cPanels, but I thought they can be easily configured to encorporate additional modules easily. Let's see if one of the cPanel users here has any tips for you.

My cpanel server has imap service running fine. But for my forum to be able to retrieve email via pop, I need to compile php with imap support myself (my web server customized php installation). I have some problems following the instructions on php.net about enabling imap support in php (I assume it means php as imap client to access imap service), because following the instructions, it tells me how to run imap/pop daemon service. I am confused. It is required to run imap/pop daemon service on the same server for php to be able to compile with imap support?

If the file is on your server, just enter the path in the vBouncer settings.
I have this setting in place. I set it to not do it automatically, but don't know how to actually start the bounce email collection process manually?

Thanks.

tamarian
07-05-2005, 10:05 PM
My cpanel server has imap service running fine. But for my forum to be able to retrieve email via pop, I need to compile php with imap support myself (my web server customized php installation). I have some problems following the instructions on php.net about enabling imap support in php (I assume it means php as imap client to access imap service), because following the instructions, it tells me how to run imap/pop daemon service. I am confused. It is required to run imap/pop daemon service on the same server for php to be able to compile with imap support?

No, you don't need to run a client. You just need to build PHP with IMAP support. Once you have that, you can POP emails from the other server, if that other server has a POP server.

I have this setting in place. I set it to not do it automatically, but don't know how to actually start the bounce email collection process manually?

That's fine. Set it to not do it automatically, but install the vbouncer-collect.php as a cron job to run daily or whatever you prefer. It will collect the stats for you on the intervals you provide. You can test it by using the scheduled task manager, clicking "run now". You can run the collection task manually or automatically, and it will still not touch bouncing members, if the vBouncer is not in auto-mode.

jb605
07-05-2005, 10:49 PM
No, you don't need to run a client. You just need to build PHP with IMAP support. Once you have that, you can POP emails from the other server, if that other server has a POP server.

My problem is with building php with imap support. The documentation says I need to compile PHP with --with-imap=DIR. What do I specify for the DIR here? And what do I need to install for that DIR option?

That's fine. Set it to not do it automatically, but install the vbouncer-collect.php as a cron job to run daily or whatever you prefer. It will collect the stats for you on the intervals you provide. You can test it by using the scheduled task manager, clicking "run now". You can run the collection task manually or automatically, and it will still not touch bouncing members, if the vBouncer is not in auto-mode.

Thanks.

tamarian
07-05-2005, 10:59 PM
My problem is with building php with imap support. The documentation says I need to compile PHP with --with-imap=DIR. What do I specify for the DIR here? And what do I need to install for that DIR option?

You may not need the dir, if the liberary is in the lib path.

I'd just install the c-client first as the docs say, then configure --with-imap and --with-imap-ssl and read the error report, if any. If that doesn't work, check with the host or sys admin.

Paul M
07-05-2005, 11:22 PM
I'm not familiar with cPanels, but I thought they can be easily configured to encorporate additional modules easily. Let's see if one of the cPanel users here has any tips for you.On Cpanel it's just a tick box when you build/update apache/php.

jb605
07-05-2005, 11:48 PM
You may not need the dir, if the liberary is in the lib path.

I'd just install the c-client first as the docs say, then configure --with-imap and --with-imap-ssl and read the error report, if any. If that doesn't work, check with the host or sys admin.

Since my server has imap and pop binary and can be started via xinet.d, I figured that imap and pop is actually installed on my server, but might only as binary, no library?

The documentation on php.net sugguested installing c-client, which might install both the binary and the library, while they should actually suggest the user install it only to get the library, not to install it as a daemon service.

I tried to compile PHP directly with compilation option --with-imap and --with-imap-ssl, but got this error:

configure: error: Cannot find rfc822.h. Please check your IMAP installation.

Looks like it is missing the header file. Not sure if I install c-client will resolve it. I am a little hesitate to install c-client because the installation file tells me it is a daemon service, but my server already has imap and pop daemon service.

tamarian
07-06-2005, 12:22 AM
I tried to compile PHP directly with compilation option --with-imap and --with-imap-ssl, but got this error:

configure: error: Cannot find rfc822.h. Please check your IMAP installation.

Looks like it is missing the header file. Not sure if I install c-client will resolve it. I am a little hesitate to install c-client because the installation file tells me it is a daemon service, but my server already has imap and pop daemon service.

You can install c-client, but you don't have to run it.

jb605
07-06-2005, 12:44 AM
You can install c-client, but you don't have to run it.

I am trying to install c-client. I have ran the make command (I am on linux)

make slx

But after that, I cannot find a make install command. And the rest part of the README file really deals with installing the binaries as a daemon service, nothing really about library installation.

If I went ahead to compile php with --with-imap=/usr/local/imap-2004e (which is the folder i created following instructions from php.net), then I got the above error:

configure: error: Cannot find rfc822.h. Please check your IMAP installation.

jb605
07-06-2005, 12:51 AM
I am trying to install c-client. I have ran the make command (I am on linux)

make slx

But after that, I cannot find a make install command. And the rest part of the README file really deals with installing the binaries as a daemon service, nothing really about library installation.

If I went ahead to compile php with --with-imap=/usr/local/imap-2004e (which is the folder i created following instructions from php.net), then I got the above error:

configure: error: Cannot find rfc822.h. Please check your IMAP installation.

Just found that the following tips helped me to get rid of this compilation error:

cp c-client/c-client.a /usr/local/lib/libc-client.a
chmod 644 /usr/local/lib/libc-client.a
cp c-client/c-client.h c-client/rfc822.hc-client/mail.h \
c-client/linkage.h /usr/local/include/
chmod 644 /usr/local/include/c-client.h /usr/local/include/rfc822.h \
/usr/local/include/linkage.h /usr/local/include/mail.h

Found at http://dovecot.org/pipermail/dovecot/2004-July/004281.html

tamarian
07-06-2005, 01:03 AM
Good to hear jb605 :up:

jb605
07-08-2005, 04:40 PM
I did a mass email, and there are a large amount of bounced emails. I didn't notice that 50 count limit, so vbouncer went ahead and processed 50 unique emails, and deleted all the others. This is really bad because I do need all those bounced emails and need to process them all. Now they are gone, even if I raise the limit, I don't have those bounced emails anymore.

Also, vbouncer seems to delete emails that it cannot identify as returned error etc. It probably should leave those emails there, because I need to modify the vouncer.inc based on the patterns on those bounced emails. I guess it might be better if vbouncer only deletes emails it has read (in imap mode). I am not sure if it is possible with system file based method or pop mode.

tamarian
07-08-2005, 05:11 PM
vBouncer must delete the emails after processing, otherwise it will count them as duplicates on the next run. If you get too many bounced emails on every run, just increase the frequency of the collection task, as explained in the first post. If you really need to save copies of your bounced emails, just create a cron job to copy the file for you.

jb605
07-08-2005, 11:24 PM
vBouncer must delete the emails after processing, otherwise it will count them as duplicates on the next run. If you get too many bounced emails on every run, just increase the frequency of the collection task, as explained in the first post. If you really need to save copies of your bounced emails, just create a cron job to copy the file for you.

Thanks. That's what I am doing. I just created another account, which gets a copy of all the emails coming, so that when I see some patterns that my configuration cannot catch, I can just go back and modify the pattern according to it, then copy the emails from the backup account to re-process it.

Currently, I have a large amount of emails being processed but vbouncer claims no bouncing emails found. I checked the code, and find the following code kind of confusing:

if (preg_match('/^Final-Recipient:/m', $Body, $matches)){

This is checked in function CombThrough($Header, $Body) and again in function Process_Std_Report($Header, $Body). I looked at my emails, none of them has this pattern in it, which explains why I get more than a thousand bounced email in a batch mass email, but vbouncer claims no bouncing emails found. So, I guess I will have to modify this code, right? However, in most of my bounced email, I do see this:

X-Failed-Recipients: adfasdfl@yhaoo.com

Is it safe for me to remove the above search for ^Final-Recipient?

Thanks.

tamarian
07-08-2005, 11:52 PM
I looked at my emails, none of them has this pattern in it, which explains why I get more than a thousand bounced email in a batch mass email, but vbouncer claims no bouncing emails found. So, I guess I will have to modify this code, right?

No, you don't have to modify the code (but it's GPL, so you may, if you want to)

vbouncer.inc allows you to add the proper patterns that match your usual bounced emails without modifying the code.

vbouncer.inc currently holds 4 patterns that match the samples people here sent me so far, but you can add your own patterns to it as new cases.

Not sure if you are using an old version without vbouncer.inc (it was added recently), you might want to click install to get the latest updates.

jb605
07-09-2005, 12:54 AM
My fault. I should add that pattern into vbouncer.inc instead of modifying the code. Adding it to vbouncer.inc does the same thing.

Thanks.

Also, maybe you didn't expect, but I have a few thousands of bounced email addresses, and my stats page takes a long time to load. A pagination will probably solve that problem.

Fallback
07-14-2005, 05:25 PM
I have this installed but it will not display any bounced emails in the stats screen and the

"Last run with results" portion of the same screen shows "19:00, 31st Dec 1969" as the last run date even though I ran the cron script myself manually in the admincp to test it. Im using the IMAP mode. What could be set wrong?

tamarian
07-14-2005, 06:02 PM
I have this installed but it will not display any bounced emails in the stats screen and the

"Last run with results" portion of the same screen shows "19:00, 31st Dec 1969" as the last run date even though I ran the cron script myself manually in the admincp to test it. Im using the IMAP mode. What could be set wrong?

The 1969 date implies it was not run, or failed the run.

1. What does the vBouncer diagnostic page show?
2. What does the scheduled task log show?

Fallback
07-14-2005, 06:17 PM
The diagnostic page has everything Passed. (the vBouncer Spool File Diagnostics are all failed which im not using because im using IMAP)

The scheduled task log shows....

Bouncer Collect 14:30, 14th Jul 2005 Status:
Processed 0 emails No bounced emails found.

-----------------------

vBounce Clean 11:54, 14th Jul 2005 Status:

tamarian
07-14-2005, 07:02 PM
The diagnostic page has everything Passed. (the vBouncer Spool File Diagnostics are all failed which im not using because im using IMAP)

The scheduled task log shows....

Bouncer Collect 14:30, 14th Jul 2005 Status:
Processed 0 emails No bounced emails found.

-----------------------

vBounce Clean 11:54, 14th Jul 2005 Status:

O.k. so it looks like it found no bounced emails.

Are you sure there were bounced emails in there? It will ignore any other type of emails, like spam or regular email.

Fallback
07-14-2005, 11:19 PM
I found the issue. When I installed the hack began to use the exim spool file method but decided to use the IMAP service because its easier to get going. based on your tip I realized that no emails were being delivered to the account and that was odd because we were getting tons of bounces up until the minute I added the hack. I then remembered that I changed the setting in my exim.conf file as indicated below and when I just changed it back to its normal state the bounce emails resumed delivery to the email account set up to collect bounces.



Exim+cPanel: (thanks to Paul M for this tip)
In the exim config file ( /etc/exim.conf ), near the bottom is a section that begins with virtual_userdelivery: - in that section is a line which says mode = 0660 - change this to mode = 0666

I changed it back to '0660' and it works.

Thanks!

Is there any advantage in using the spool method over IMAP or POP?

Paul M
07-14-2005, 11:25 PM
I found the issue. When I installed the hack began to use the exim spool file method but decided to use the IMAP service because its easier to get going. based on your tip I realized that no emails were being delivered to the account and that was odd because we were getting tons of bounces up until the minute I added the hack. I then remembered that I changed the setting in my exim.conf file as indicated below and when I just changed it back to its normal state the bounce emails resumed delivery to the email account set up to collect bounces.

I changed it back to '0660' and it works.

Thanks!

Is there any advantage in using the spool method over IMAP or POP?If you change the exim config to 0666 you must CHMOD the file to match, if one mismatches the other then it will fail.

The spool method would be faster I would think, but I can't think of any other real major advantage.

tamarian
07-14-2005, 11:46 PM
Is there any advantage in using the spool method over IMAP or POP?

Not really, use whichever you like.

Using the file is faster, but speed doesn't really matter, since you only run it once or twice a day. Because IMAP is slighter slower, it may offer a slight advantage by buffering the queries to match email addresses to members. But the differences are slight. IMAP is particularly useful to those who run multiple servers, where the mail server is remote, and the file spool would be inaccessable.

Fallback
07-15-2005, 02:13 AM
If you change the exim config to 0666 you must CHMOD the file to match, if one mismatches the other then it will fail.
.


When I initially changed the exim config 0666 I did not CHMOD anything. Should anything be changed now that I have changed it back to 0660?

Paul M
07-15-2005, 04:40 AM
When I initially changed the exim config 0666 I did not CHMOD anything. Should anything be changed now that I have changed it back to 0660?No, you should be fine now.

Before you changed anything, the file was 660 and the config was 660 - because you only changed the config to 666, there was a mismatch and it stopped. Had you then changed the file to 666 it would have been okay as they would have matched again (both 666). You have fixed the mismatch by putting the config back, so they are now both 660 again. :)

Eagle Creek
07-20-2005, 04:06 PM
P-E-R-F-E-C-T!!!

Exactly what I'm looking for!!

(http://www.vbulletin.com/forum/showthread.php?p=920939)

Is there also a vB 3.5 version? My boards are still running 3.0.6 and 3.0.4 but when we want to upgrade?

tamarian
07-20-2005, 05:35 PM
Is there also a vB 3.5 version? My boards are still running 3.0.6 and 3.0.4 but when we want to upgrade?

Yes, there is. Clcik on my profile and it should be listed there.

Eagle Creek
07-20-2005, 05:46 PM
Yes, there is. Clcik on my profile and it should be listed there.


Very cool Very cool Very cool, I love you!

I'm searching for a thing like this for ages.

Eagle Creek
07-24-2005, 10:03 AM
Another request for Cpanel+Exim users. I'm writing a POP maodule as an option instead of reading files. I'll need to test my code (from my home server) with your bouncer email box. If you'd like to volunteer :) please PM me the new account's (subscriber_notify) POP username and password.

Untouchable usergroups

Do I need to add spaces, comma's between??

And:

My mails are still sent from the webmasters address?

tamarian
07-24-2005, 12:37 PM
Do I need to add spaces, comma's between??

Use commas. I can't beleive the description doesn't say that..

My mails are still sent from the webmasters address?

Check the header of email notifications you get, if there's a "Return-Path" header with the new email account you created, then you're ready to go.

Eagle Creek
07-24-2005, 12:43 PM
Owh.. I didn't saw it; honestly.

X-Authentication-Warning: srv1.soccerquest.nl: soccerquest set sender to notify soccerquest using -f
X-MailScanner-From: notify soccerquest nl

I guess that's is it?

tamarian
07-24-2005, 01:34 PM
X-Authentication-Warning: srv1.soccerquest.nl: soccerquest set sender to notify soccerquest using -f
X-MailScanner-From: notify soccerquest nl

I guess that's is it?

No, it doesn't show a "Return-Path" header. Generate a reply notification email, and view the full headers of that email.

Eagle Creek
07-24-2005, 01:53 PM
Return-Path: <notify@soccerquest.nl>
Received: from mwinf6008.wanadoo.nl (mwinf6008.wanadoo.nl)
by mwinb6006 (SMTP Server) with LMTP; Sun, 24 Jul 2005 16:50:56 +0200
X-Sieve: Server Sieve 2.2
Received: from me-wanadoo.net (localhost [127.0.0.1])
by mwinf6008.wanadoo.nl (SMTP Server) with ESMTP id 3CA612400089
for <wnl000000000000000108688945@back60-mail02-03.me-wanadoo.net>; Sun, 24 Jul 2005 16:50:56 +0200 (CEST)
Received: from srv1.soccerquest.nl (unknown [195.85.134.27])
by mwinf6008.wanadoo.nl (SMTP Server) with ESMTP id 2845C2400088
for <*my e-mail address*>; Sun, 24 Jul 2005 16:50:56 +0200 (CEST)
X-ME-UUID: 20050724145056165.2845C2400088@mwinf6008.wanadoo.n l
X-ClientAddr: 127.0.0.1
Received: from soccerquest.nl (localhost.localdomain [127.0.0.1])
by srv1.soccerquest.nl (8.12.11/8.12.11) with ESMTP id j6OEowYQ032206
for <*my e-mail address*>; Sun, 24 Jul 2005 16:50:58 +0200
Received: (from soccerquest@localhost)
by soccerquest.nl (8.12.11/8.12.11/Submit) id j6OEow4e019057;
Sun, 24 Jul 2005 16:50:58 +0200
Date: Sun, 24 Jul 2005 16:50:58 +0200
X-Authentication-Warning: srv1.soccerquest.nl: soccerquest set sender to notify AT soccerquest.nl using -f
To: *my e-mail address*
Subject: Reactie op post 'Reply test'
From: "SoccerQuest Mailer" <soccerquest AT soccerquest.nl>
Message-ID: <200507241458.ebeec4288039@www.soccerquest.nl>
X-Priority: 3
X-Mailer: vBulletin Mail via PHP
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-soccerquest-MailScanner-Information: Please contact the ISP for more information
X-soccerquest-MailScanner: Found to be clean
X-MailScanner-From: notify AT soccerquest.nl



This?

tamarian
07-24-2005, 01:58 PM
This?

Yes, this line:

Return-Path: <notify@soccerquest.nl>

Shows that it is sending the proper header to trap the bounced emails.

mcyates
08-02-2005, 09:56 PM
This isn't sending out pms to warn people.

Auto processing mode: Yes
Bounce limit: 10
Bounce limit period: 7
Send Notification PM: Yes
PM Sender ID: 1
PM Sender Username: boro_boy
Send PM warning: Yes
Warning Limit: 5
Punish Any Unknown Emails: No

Those are my settings, why isn't it sending pms out?

My stats for bounced emails are as follows:

User 1: 25 bounced emails
User 2: 22 bounced emails
User 3: 9 bounced emails
User 4: 6 bounced emails
User 5: 4 bounced emails

So the first 4 users should have got a warning via pm but they didn't. Weird!!!

tamarian
08-02-2005, 10:09 PM
This isn't sending out pms to warn people.

Auto processing mode: Yes
Bounce limit: 10
Bounce limit period: 7
Send Notification PM: Yes
PM Sender ID: 1
PM Sender Username: boro_boy
Send PM warning: Yes
Warning Limit: 5
Punish Any Unknown Emails: No

Those are my settings, why isn't it sending pms out?

My stats for bounced emails are as follows:

User 1: 25 bounced emails
User 2: 22 bounced emails
User 3: 9 bounced emails
User 4: 6 bounced emails
User 5: 4 bounced emails

So the first 4 users should have got a warning via pm but they didn't. Weird!!!


The PM's will be sent the next time the vbouncer-clean.php task is run. When the vbouncer-collect.php task is run, it just collects the info and generates the stats. If the stats show that some members are due for a warning or auto-processing, those actions will be taken when on the next clean run.

You can make sure of this by just running the -clean task from the task manager, and it will take the required actions now. Check the -clean task logs to make sure the actions were taken.

Eagle Creek
08-02-2005, 10:56 PM
It worked perfect!

From more then 300 bounces EVERT DAY I now get not more then 2 :D

G-man
08-10-2005, 04:52 AM
In the exim config file ( /etc/exim.conf ), near the bottom is a section that begins with virtual_userdelivery: - in that section is a line which says mode = 0660 - change this to mode = 0666

I changed this setting and vbounce worked great then I noticed today it brought down my entire email delevery system by switching the the email permissions on all the domain accounts on my server causing denial of emailsfor the entire day until it click I was the one that screwed up the system with that setting. I ahve switched it back.

Help! Please!

tamarian
08-10-2005, 07:07 AM
I changed this setting and vbounce worked great then I noticed today it brought down my entire email delevery system by switching the the email permissions on all the domain accounts on my server causing denial of emailsfor the entire day until it click I was the one that screwed up the system with that setting. I ahve switched it back.

Help! Please!

Not sure about the exim stuff since I've never used it. But you're saying that you switched it back and now the email works fine, but not vBouncer? Why not try the IMAP/POP method, since it will require no changes to Exim.

G-man
08-10-2005, 01:30 PM
Not sure about the exim stuff since I've never used it. But you're saying that you switched it back and now the email works fine, but not vBouncer? Why not try the IMAP/POP method, since it will require no changes to Exim.
Correct. Evidentily that setting made all local email boxes on the server where they were chmod to block incoming emails.

tamarian
08-10-2005, 08:12 PM
Correct. Evidentily that setting made all local email boxes on the server where they were chmod to block incoming emails.

I've updated the instruction to warn about this problem, and simply recommended IMAP/POP :)

G-man
08-10-2005, 09:02 PM
Tamarian,
Thank you. I have yet to get the IMAP/POP to work. Can anyone point out how they are doing it with Exim>?

tamarian
08-10-2005, 10:00 PM
Can anyone point out how they are doing it with Exim>?

I have never used Exim, but it should be no different than any other POP mail account. If you already have created an account for vBouncer, then use the vBouncer setting in the vBulletin Options to enter the POP username and password for that account.

PING1434a
08-13-2005, 01:09 AM
Ok, isntalled this hack, seems to working fine. Just one question though, when i run the vbounce collect and vbounce clean up , is it supposed to clear/purge the stats page? Because my stats just stay there...

tamarian
08-13-2005, 01:51 AM
Ok, isntalled this hack, seems to working fine. Just one question though, when i run the vbounce collect and vbounce clean up , is it supposed to clear/purge the stats page? Because my stats just stay there...

The stats are cleared when the defined period is over. So if you minitir bounces within the last 7 days, it will clear stats that are older than 7 days on the next run of the clean script. It will also clear each member's stats if they exced the defined period, and are "processed", to avoid penalizing them for the same bounces.

Don't forget to click install :)

G-man
08-13-2005, 02:50 AM
I am now getting:

Vbounce

Fatal error: Call to undefined function: imap_open() in boards/includes/cron/vbouncer-collect.php on line 163

tamarian
08-13-2005, 03:06 AM
I am now getting:

Vbounce


Fatal error: Call to undefined function: imap_open() in boards/includes/cron/vbouncer-collect.php on line 163

This means that your server's PHP installation was not compiled with IMAP support.

Eagle Creek
08-23-2005, 02:47 PM
Is there a 3.5?

tamarian
08-23-2005, 02:57 PM
Is there a 3.5?

Yes, click on my profile and it should be linked there.

Eagle Creek
08-23-2005, 03:04 PM
Thx dude!!

https://vborg.vbsupport.ru/showthread.php?s=&threadid=83486

gbechtel
08-29-2005, 03:11 AM
When trying to run vbouncer-clean.php via the Scheduled Task Manager I get the following....

Database error in vBulletin 3.0.8:

Invalid SQL: DELETE FROM vb3_vbouncer WHERE vbouncer.dateline < 1124683668
mysql error: Unknown table 'vbouncer' in where clause

mysql error number: 1109

Can someone point me in the right direction on what to edit to cure this?

Thanks,
Gil

tamarian
08-29-2005, 03:28 AM
When trying to run vbouncer-clean.php via the Scheduled Task Manager I get the following....


Database error in vBulletin 3.0.8:

Invalid SQL: DELETE FROM vb3_vbouncer WHERE vbouncer.dateline < 1124683668
mysql error: Unknown table 'vbouncer' in where clause

mysql error number: 1109


Can someone point me in the right direction on what to edit to cure this?

Thanks,
Gil

In vbouncer-clean.php find:

$DB_site->query("DELETE FROM " . TABLE_PREFIX . "vbouncer WHERE vbouncer.dateline < $TestPeriod");

Replace with:

$DB_site->query("DELETE FROM " . TABLE_PREFIX . "vbouncer WHERE dateline < $TestPeriod");

gbechtel
08-29-2005, 04:06 AM
Thank you that did the trick...

Gil

Devices
09-15-2005, 08:38 PM
Hi

This is a great hack. Thanks for your good work :)

It all seemed to install ok and it does catch a few but most bounces are not caught. I expect i just need the definitons to go in the .inc file. So if some kind soul could help me out here is one that is not picked up.


X-Kaspersky: Checked
Date: Thu, 15 Sep 2005 07:47:39 +0100
Message-Id: <10509150747.AA78381076@domain.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
From: "Postmaster" <postmaster@domain.com>
Sender: <postmaster@domain.com>
To: <admin@domain.com>
Subject: Undeliverable Mail
X-Mailer: <SMTP32 v8.00>
Status: U
X-PMFLAGS: 34078848 0 1 P32Z4HA0.CNM

undeliverable to username@myforums.com


Original message follows.

Received: from server [IP ADDRESS] by domain.com
(SMTPD32-8.00) id AB25620110; Thu, 15 Sep 2005 03:23:33 +0100
Date: Thu, 15 Sep 2005 03:23:30 +0000
Subject: Reply to post
To: username@myforums.com
From: "My Forums" <support@myforums.com>
Return-Path: support@myforums.com
Message-ID: <200509150228.fd8e26864301@myforums.com>
X-Priority: 3
X-Mailer: vBulletin Mail via PHP
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Return-ID: [deleted ;o)]
X-Declude-Sender: admin@myforums.com [IP ADDRESS]
X-Note: This E-mail was scanned for spam.


If that what is needed i can post the others too.

Thank you.

tamarian
09-15-2005, 09:04 PM
First, delete this line from your post "X-Return-ID:" No big deal, but you never know. :)

It all seemed to install ok and it does catch a few but most bounces are not caught. I expect i just need the definitons to go in the .inc file. So if some kind soul could help me out here is one that is not picked up.


Add this to the end of vbouncer.inc

[case_5]
email_regex = "undeliverable to /<(\S+@\S+)>/mis";
apply_email_regex_on_body = yes;
email_append_host = no;
email_append_host_regex = "";
apply_append_regex_on_body = yes;
consider_as_5_0_0_regex = "/This is a permanent error/mis";
consider_as_550_regex = "/(user unknown|said: 550|unknown recipient|domain not found|mailbox not found|Mailbox unavailable|invalid recipient)/mis";
forged_if_no_return_id = yes;

Devices
09-15-2005, 09:21 PM
First, delete this line from your post "X-Return-ID:" No big deal, but you never know. :)



Add this to the end of vbouncer.inc

[case_5]
email_regex = "^undeliverable to /<(\S+@\S+)>/mis";
apply_email_regex_on_body = yes;
email_append_host = no;
email_append_host_regex = "";
apply_append_regex_on_body = yes;
consider_as_5_0_0_regex = "/This is a permanent error/mis";
consider_as_550_regex = "/(user unknown|said: 550|unknown recipient|domain not found|mailbox not found|Mailbox unavailable|invalid recipient)/mis";
forged_if_no_return_id = yes;


Thank you for the fast reply.

I just added that and i got this error
Warning: preg_match(): No ending delimiter '^' found in \includes\cron\vbouncer-collect.php on line 103

tamarian
09-15-2005, 10:03 PM
Try it again, I edited out the ^

Devices
09-15-2005, 10:15 PM
This time i get this error

Warning: preg_match(): Delimiter must not be alphanumeric or backslash in \includes\cron\vbouncer-collect.php on line 103

Devices
09-15-2005, 10:34 PM
This seems to work

email_regex = "/^undeliverable to (\S+@\S+)/mi";

I based it on the first block in the INC file. Does it look okay to continue using ?

Freezerator
09-21-2005, 12:45 PM
Great hack, installed and works! thanks!

tamarian
09-21-2005, 03:06 PM
This seems to work

email_regex = "/^undeliverable to (\S+@\S+)/mi";

I based it on the first block in the INC file. Does it look okay to continue using ?

Sure, the inc filter is harmless. If anything goes wrong, it will just abort :)

firas
09-23-2005, 08:23 PM
hi...does it work with 3.0.9?

tamarian
09-24-2005, 01:52 AM
hi...does it work with 3.0.9?

It should work fine. I haven't upgraded, but the 3.0.9 changes should not affect it.

firas
09-26-2005, 09:41 AM
hi..

i've just installed it on my 3.0.9 but after doing so, my VB is not sending emails any more. even the activation emails...i tried sending an email to mysefl from it but it never came.

When i re-edit the mail.php, everything returned to normal

any clue?

Freezerator
09-26-2005, 10:45 AM
hi..

i've just installed it on my 3.0.9 but after doing so, my VB is not sending emails any more. even the activation emails...i tried sending an email to mysefl from it but it never came.

When i re-edit the mail.php, everything returned to normal

any clue?

Well, check if you are really editting mail.php the right way. It should work without problems.

firas
09-26-2005, 12:40 PM
i did so. i just copied and pasted....:(

tamarian
09-26-2005, 12:45 PM
i did so. i just copied and pasted....:(

Restore the mail file from original 3.0.9, and test from the admin cp mail debug. Then apply the changes, and test, see what the vB mail debug message tells you.

Dave-ahfb
10-12-2005, 03:09 PM
Is there a way to make this work with the community bulletin hack? Currently bounced emails bounce to the root email address. I changed the settings(temp) to collect from the root mailbox and it only forund 16 out of over 2000 bounced emails.

1- need to make comm-bull bounce to the specified bounce addy
2- need to make it recognize comm-bull bounces

Dave

tamarian
10-12-2005, 03:37 PM
Is there a way to make this work with the community bulletin hack? Currently bounced emails bounce to the root email address. I changed the settings(temp) to collect from the root mailbox and it only forund 16 out of over 2000 bounced emails.

1- need to make comm-bull bounce to the specified bounce addy
2- need to make it recognize comm-bull bounces

Dave

Just took a look, and I think it can be done this way (you need to test it to make sure, just send to a new group with bogus emails)

Find these two lines:
mail($user[email],$subject,$HTML_mailbody,$htmlEmailHeader);

mail($user[email],$subject,$mailbody,"From: \"$bbtitle Mailer\"<$webmasteremail>");

Replace each respective line with:

mail($user[email],$subject,$HTML_mailbody,$htmlEmailHeader, '-f' . $vboptions['vbouncer_spool_account']);

mail($user[email],$subject,$mailbody,"From: \"$bbtitle Mailer\"<$webmasteremail>", '-f' . $vboptions['vbouncer_spool_account']);

buro9
10-12-2005, 05:05 PM
Don't you need a space between -f and the email address? Just a minor point.

tamarian
10-12-2005, 05:24 PM
Don't you need a space between -f and the email address? Just a minor point.

I don't think so. I've been doing it this way since 2.x with no problems :)

buro9
10-12-2005, 07:31 PM
I don't think so. I've been doing it this way since 2.x with no problems :)

That's good :) I'm never sure but thought as the devil is always in the detail I should ask.

Ho hum...

* wanders off *

Eagle Creek
10-16-2005, 09:10 AM
That's good :) I'm never sure but thought as the devil is always in the detail I should ask.

Ho hum...

* wanders off *

Is there a 3.5 version :$?


Screenshots from 3.5 beta, but it looks the same on 3.0.7...

tamarian
10-16-2005, 04:17 PM
Is there a 3.5 version :$?

Yes: https://vborg.vbsupport.ru/showthread.php?s=&threadid=83486

Spinball
12-03-2005, 11:53 AM
Installed as per the instructions and got
Parse error: parse error, unexpected T_CLASS, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/sites/avforums/public_html/forums/includes/mail.php on line 79
Noticed that my existing (working) version of the hack didn't have the
if ($vboptions['vbouncer_header_return_key'])
$headers .= 'X-Return-ID: ' . md5($vboptions['vbouncer_header_return_key'] . $toemail) . "\n";

bit in it, so I took it out.
Are you aware that your code is broken? And what do the extra 2 lines do? Are they important?

tamarian
12-03-2005, 12:41 PM
Noticed that my existing (working) version of the hack didn't have the

bit in it, so I took it out.
Are you aware that your code is broken? And what do the extra 2 lines do? Are they important?

Not broken, but you may have ran the old installation script with the new code, so you have a mismatch and you're missing a couple of settings in the admincp. Download the zip, run uninstall from the new installation script, then re-install.

Spinball
12-03-2005, 06:13 PM
Uninstalled and reinstalled and still got the same problem.
The error is indicative of a missing '}'.
E.g. global $vboptions;
if (is_valid_email($vboptions['vbouncer_spool_account'])) {
if ($vboptions['vbouncer_header_return_key'])
$headers .= 'X-Return-ID: ' . md5($vboptions['vbouncer_header_return_key'] . $toemail) . "\n";
$this->success = @mail($toemail, $subject, $message, trim($headers), '-f' . $vboptions['vbouncer_spool_account']);
}
else
$this->success = @mail($toemail, $subject, $message, trim($headers), "-f $fromemail"); should be
global $vboptions;
if (is_valid_email($vboptions['vbouncer_spool_account'])) {
if ($vboptions['vbouncer_header_return_key']) {
$headers .= 'X-Return-ID: ' . md5($vboptions['vbouncer_header_return_key'] . $toemail) . "\n";
}
$this->success = @mail($toemail, $subject, $message, trim($headers), '-f' . $vboptions['vbouncer_spool_account']);
} else {
$this->success = @mail($toemail, $subject, $message, trim($headers), "-f $fromemail");
}
don't see how the code could work otherwise. Very confused.

tamarian
12-03-2005, 06:31 PM
Uninstalled and reinstalled and still got the same problem.
The error is indicative of a missing '}'.
E.g. should be

don't see how the code could work otherwise. Very confused.

The code you posted is identical. The only difference is adding an opening and closing {}. So if one caused an error, they other one should as well.

If unsure, use a freash copy of mail.php, then apply the changes to it, as it may have errors from previous edits.

Codeman05
12-10-2005, 01:45 PM
Hi,

I am having a problem getting VBouncer to connect to my IMAP/POP server.
I'm using Cyrus with Virtual Domains...meaning that my username for the account is a full email address (xxxx@domain.com). Could that be causing the problem? Otherwise, I have no idea...I am able to log into the "subscription_notify" address I created with squirrelmail, so the account itself is working fine

Codeman05
12-10-2005, 01:56 PM
Hi,

I am having a problem getting VBouncer to connect to my IMAP/POP server.
I'm using Cyrus with Virtual Domains...meaning that my username for the account is a full email address (xxxx@domain.com). Could that be causing the problem? Otherwise, I have no idea...I am able to log into the "subscription_notify" address I created with squirrelmail, so the account itself is working fine

ok, found the solution, adding the /imap/notls flag got it to work.
example: {localhost:143/imap/notls}

David Bott
12-14-2005, 10:16 PM
Great Hack...Installed on AVSForum and will be on TiVo Community.

Question...

The bar graph does not show for me for I call my images from another server.

In the page source I see...

img src="../http://URLremoved/images/polls/bar3.gif"

Note the ../ in front of the image call.

Where can I correct this in the code for it seems to assume local graphic files.

Thank you kindly.

tamarian
12-15-2005, 10:47 AM
Great Hack...Installed on AVSForum and will be on TiVo Community.

Question...

The bar graph does not show for me for I call my images from another server.

In the page source I see...

img src="../http://URLremoved/images/polls/bar3.gif"

Note the ../ in front of the image call.

Where can I correct this in the code for it seems to assume local graphic files.

Thank you kindly.

Do you use vb advanced or another hack that re-writes url's. Or does your style use absolute paths for image directory variables?

David Bott
12-15-2005, 11:54 AM
Hello...

"Or does your style use absolute paths for image directory variables?"

Yes, we set the path for the images to be the URL of the server, not a directory.

David Bott
12-15-2005, 01:11 PM
Also...I notice that the system sends a warning PM each time it runs to the users over the warning limit. Thus if I have the cleaner program set to run each hour, they get the notice every hour.

Please advise.

Thank you.

David Bott
12-15-2005, 01:45 PM
Ah!!! I have a great idea. (I think)

Ok, you have the option to act fully on a 5.0.0/550, or what have you, on the first bounce of a mail, Why this can make for an issue as you know, it gave me an idea. (Look at the log, a lot of them are 5.0.0/550.

In any case....here is the thought. Have the option to look at the Last Activity date where you can set..."If have not visited in X days, assume dead e-mail" and then act on it.

So they get a 5.0.0/550 bounce. When the cleaner runs the system looks up the address in the user database, and also pulls the last activity date for that user and says..."is the last activity date that older than X days" If yes, run the full clean options.

You see, looking at some of the users that have bounced, they have not been back to the site in some time, thus it would be great to act on them why it may not be good to act on some others with a 5.0.0/550.

Thoughts?

tamarian
12-16-2005, 12:58 PM
Hello...

"Or does your style use absolute paths for image directory variables?"

Yes, we set the path for the images to be the URL of the server, not a directory.

You can edit the images in the vbouncer.php file in admincp, this line:

echo '<td width="80%" align="left" nowrap="nowrap"><img src="' . $imgpath . '/bar3-l.gif" height="10" /><img src="' . $imgpath . '/bar3.gif" width="' . $width . '%" height="10" /><img src="' . $imgpath . "/bar3-r.gif\" height=\"10\" /></td>\n";

tamarian
12-16-2005, 01:00 PM
Also...I notice that the system sends a warning PM each time it runs to the users over the warning limit. Thus if I have the cleaner program set to run each hour, they get the notice every hour.

Please advise.

Thank you.

Not a good idea to run it hourly, as there are no actions to perform until the end of the period. As stated in step #5 "vbouncer-clean.php (weekly, equal to Bounce limit period)"

tamarian
12-16-2005, 01:04 PM
Ah!!! I have a great idea. (I think)

Ok, you have the option to act fully on a 5.0.0/550, or what have you, on the first bounce of a mail, Why this can make for an issue as you know, it gave me an idea. (Look at the log, a lot of them are 5.0.0/550.

In any case....here is the thought. Have the option to look at the Last Activity date where you can set..."If have not visited in X days, assume dead e-mail" and then act on it.

So they get a 5.0.0/550 bounce. When the cleaner runs the system looks up the address in the user database, and also pulls the last activity date for that user and says..."is the last activity date that older than X days" If yes, run the full clean options.

You see, looking at some of the users that have bounced, they have not been back to the site in some time, thus it would be great to act on them why it may not be good to act on some others with a 5.0.0/550.

Thoughts?

95+% of the mail performance issues are due to instant notifications. Those are only sent once per thread, until the member's next visit. If they don't visit often, they will not generate instant notifications, so adding more code for those who have not visited lately will have little impact.

David Bott
12-16-2005, 02:24 PM
Thanks for th note.

Maybe you do not know my site and thus do not see the same concerns. (Not that you would know the site.)

We see over 65,000 unique people a day with over 3000 showing as on-line most of the day. Over 190,000 register with about 250-300 new registrations a day based on what is going on. Over 6.5 millions posts and under 4000 in Alexa. :)

Running the clean once a week does not work. In 3 days we could have someone already over the other limit and thus to late for any warning notice for it would have already taken action. The site is very, very active and a lot of mail goes out.

I mentioned the idea to check the last visit date because looking at some of the users that have bounced mail, they have not been to the site in over 6 months. You see, we have threads that are active still for years.

Oh, the image path. Ys, I had seen that line but would not know what edit out to stop the ../ part.

Thanks

tamarian
12-16-2005, 07:48 PM
Maybe you do not know my site and thus do not see the same concerns. (Not that you would know the site.)

We see over 65,000 unique people a day with over 3000 showing as on-line most of the day. Over 190,000 register with about 250-300 new registrations a day based on what is going on. Over 6.5 millions posts and under 4000 in Alexa. :)

Running the clean once a week does not work. In 3 days we could have someone already over the other limit and thus to late for any warning notice for it would have already taken action. The site is very, very active and a lot of mail goes out.

vBouncer was written for large sites. Smaller sites have no use for it, so I'm aware of the load issues, that's why I wrote it :)

You don't need to run the "clean" cron once a week, but hourly is an overkill, and provides no benefits, unless your warning period is defined as hourly. The interval should be no less than your warning interval, can be 2 days, 3 days.

Users who have not visited for a month or more, will never get instant notification emails. It's either the daily digest, or the weekly digest. If you set your digests to run in the off hours, then 99% of the mail load damage is caused by instant notifications, which is done by active members only.

rstan
02-09-2006, 09:40 PM
have i had to much crack today or does my vb have no email.php?

tamarian
02-10-2006, 01:17 AM
have i had to much crack today or does my vb have no email.php?

mail.php, not email.php :)

David Bott
04-03-2006, 10:59 PM
Hello...

I have been using this for some time now and it works great.

However I just moved my mail to a new mail server and I have run into an issue. Here is the error that is reported...

Failed to access email, please check vBouncer mail settings.
Last error: Certificate failure for mail.tivocommunity.com: self signed certificate: /C=US/ST=Unknown/L=Unknown/O=Unknown/OU=Unknown/CN=cambridge.micfo.com/emailAddress=ssl.net
Unable to clear bounced emails, exiting.

The question is, is their any way to ingnor this error and contiune on? The POP3 account does work just fine but it seems SSL is getting in the way for PHP is using IMAP.

Please help.

Thank you.

tamarian
05-04-2006, 08:37 PM
Try adding "notls" into the connection string.

Quarterbore
10-10-2006, 06:20 PM
Anybody up to trying to get this updated for 3.6.x?

sv1cec
11-25-2006, 03:11 PM
Can you please fix code suggested for mail.php? Because as it is in the notes, there are some curly brackets missing, and since the time I did that suggested change, all email from my sites were stopped.

Also, if one of the guys/gals who posted in this, have installed this hack and it is working, can you please tell me how you modified your mail.php file?

One more thing. I am trying to use the file method for this hack. The file /var/spool/mail/rejects (or whatever you call the account name), is owned by rejects and the group is mail. The permissions are set to 666, but as soon as procmail delivers mail to it, it is reset to 600. Also, I do not see anything in my php configuration, regarding pop. All I see is :

mod_php4, mod_setenvif, mod_so, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

Is mod_imap the required procedure to access the email account via POP3? If so, why do I get a Failed in diagnostics?

"Your PHP installation supports IMAP/POP Failed"

Thanks

sv1cec
02-14-2007, 08:53 AM
Anyone can answer the above please??

ingdz.com
11-15-2008, 08:54 PM
Anybody up to trying to get this updated for 3.7.x?