6 * $week);
			if ($is_old AND (sizeof($old_bounces) < 10000))
				$old_bounces[$u['list_subscriber']][] = "'".addslashes($u['user_subscriber'])."'";

			/* Remark: we need this 10000 users limit in order to limit the size of the request we pass on to MySQL - otherwise
			 * we risk having a "MySQL has gone away" error ; just run several times if you have big big lists full of bouncers
			 */

			// This is where we do our logic :
			// if bounces have been registered for more than 4 weeks
			// AND we have more than 8 hard bounces OR 20 soft bounces
			// AND the last bounce is not "old" (6 weeks)
			if (($period > 4 * $week)
			AND (($nb > 8 AND $code_stmp==5) OR ($nb > 20 AND $code_stmp==4))
			AND !$is_old
			AND (sizeof($remove) < 10000))
				$remove[] = "'".addslashes($u['user_subscriber'])."'";

			// For all others SMTP error codes (unknown or 2.x.x)
			// just ask sympa to forget them
			// if ($code_stmp!=4 AND $code_stmp!=5)
			//	$old_bounces[$u['list_subscriber']][] = "'".addslashes($u['user_subscriber'])."'";

		}
	}

	// Remove bouncers
	$nb_remove = sizeof($remove);
	if ($nb_remove>0) {

		echo "\n\nUsers to remove : $nb_remove\n";

		$seq = join(",\n",$remove);

		if ($clean_up_method == 'probe') {
			// the bouncers will be subscribed to the '$list-probe' list 
			$req = "UPDATE subscriber_table SET list_subscriber = CONCAT(list_subscriber,'-probe') WHERE user_subscriber IN ($seq)";
			echo $req."\n";
			if (! $read_only)
				if (mysql_query($req) == 0) echo mysql_error();
		}
		else if ($clean_up_method == 'remove') {
			// we remove all references to this user in both user_table and subscriber_table
			$req = "DELETE FROM subscriber_table WHERE user_subscriber IN ($seq)";
			echo $req."\n";
			if (! $read_only)
				if (mysql_query($req) == 0) echo mysql_error();
			$req = "DELETE FROM user_table WHERE email_user IN ($seq)";
			echo $req."\n";
			if (! $read_only)
				if (mysql_query($req) == 0) echo mysql_error();
		}
		else
			echo "Bouncers : ".$seq;
	}

	// Clean up old bounces (and other SMTP error codes)
	if (sizeof($old_bounces) > 0) {
		reset ($old_bounces);
		while (list($listname,$old_users) = each ($old_bounces)) {

			$nb_old = sizeof($old_users);
			echo "\n\nUsers with useless bounces in $listname: $nb_old\n";

			if ($nb_old >0) {
				$seq = join(",\n",$old_users);
				$req = "UPDATE subscriber_table SET bounce_subscriber = NULL WHERE list_subscriber = '$listname' AND user_subscriber IN ($seq)";
				echo $req."\n";
				if (! $read_only)
					if (mysql_query($req) == 0) echo mysql_error();
			}
		}
	}

?>