vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Administrative and Maintenance Tools - EZ Bounced Email Management for Admins (https://vborg.vbsupport.ru/showthread.php?t=138884)

djbaxter 08-18-2010 08:00 PM

Thanks! :up:

Alfa1 08-19-2010 01:55 AM

Quote:

Originally Posted by Antivirus (Post 2085945)
this permission check is done in the ezbounce.php file in the following code:

PHP Code:

// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminsettings'))
{
    
print_cp_no_permission();


If you want to change how this condition is evaluated, simply change the conditional within the if() clause.

Do you know what the parameter is for can administer users? canadminusers ?

HansiB 09-21-2010 08:50 PM

I am testing this plugin on my 4.x board and it looks like it works as it should.

However, my board is 10 years old and have some 40.000 members, and bounces thousands of them.

Clicking the ezbounce link manually is not my cup of tea.

So I started looking at ways to automate this somewhat.

First, i use my email client (thunderbird) and access the bounced emails and choose the bounces that indicate unused email adresses more than just out of office replies and such. I do a "save as" and get a directory full of .EML files.

I remember using a unix tool called AWK many many years ago, so i downloaded gnu awk for windows and did a quick read of the documentation.

calling gawk -f bounce.awk *.eml from a command window give me an output like

X-EZbouncer: http://myforumurl.something/admincp/...ce.php?u=77777
X-EZbouncer: http://myforumurl.something/admincp/...ce.php?u=88888
X-EZbouncer: http://myforumurl.something/admincp/...ce.php?u=99999

...etc...etc...etc hundreds of lines like that...



bounce.awk contain

#!/bin/awk -f
{
# Loook for the bounce link
if ($0 ~ /X-EZbouncer/) {
printf("%s\n",$0)
}
}

and it is easy to add to the awk "program" so it will only output the URL behind EZbouncer.

EDIT: Actually, changing printf("%s\n",$0) to printf("%s\n",$2) made awk output just the url, not the X-EZBOUNCER text.

Next, to automatically "click" the links, I could easily make a call to make windows open the link in any browser, but with more than a few dozen links that would probably crash the browser and/or windows.

So i looked for alternatives and found cURL and wget.

Decided to start to learn cURL, googled and found PHP code calling the library version of cURL that is doing some of the stuff that needs to be done...logging in to vBulletin...need to be converted to command line arguments and changed a bit i think to login to the admincp instead of to the main forum page, but when that is done the easy part is to open the ezbounce.php

<?php
/********************
* cURL Tutorial By Affix
* Login to a vB forum
*********************/

function vBulletinLogin($user, $pass)
{
$md5Pass = md5($pass);
$data = "do=login&url=%2Findex.php&vb_login_md5password=$m d5Pass&vb_login_username=$user&cookieuser=1";

$ch = curl_init();

curl_setopt ($ch, CURLOPT_URL, "h**p://forum.codecall.net/login.php?do=login"); // replace ** with tt
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt ($ch, CURLOPT_TIMEOUT, '10');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/codecall_$user.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/codecall_$user.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);

curl_close($ch);

$pos = strpos($store, "Thank you for Logging in");
if($pos === FALSE)
{
RETURN 0;
}
else
{
RETURN 1;
}
}

if(vBulletinLogin("username","password"))
{
echo "Logged In";
}
else
{
echo "Failed to Login check User / Pass";
}
?>

However, now I am getting too tired to learn yet another command line tool. Hopefully, when I get back here in 12 hours someone of the script gurus on this board have already posted some elegant scripts that I can use right away. Otherwise I hope to solve this myself and post some ugly scripts you all can use.

It seems you need to use MD5 encoding for the password, and maybe also for the login name. Just google on MD5 and you will find pages that will calculate MD5 from any string you enter, then just use the result with the parameters.

This is how far I have come with the curl command line:

curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" --cookie-jar c:\cjar.txt --data

Well, it is a start :-)

Need to sleep now...

oh, maybe one simpler solution might be to remove the need to login to run the ezbounce.php script? And of course renaming it to something like 987jhjkh3jkhm?djjkhkj3h.php and removing it from the server when not using it.

Alfa1 09-21-2010 09:44 PM

I'm working with a dev on a complete automation.

Clicking all the links will cause errors 'inbox full' and other trivial reports to deactivate the related account, which will cause a mass of support requests. A script needs to scan each email for every possible error phrase, evaluate it according to settings and then handle it appropriately. Spam doesnt make it any easier, as some virus spam disguises as bounced mail. And then there is BS like bluebottle.

Forget logging into adminCP. Running a cron seems much better.

IB will also add bounce management to vb4, though its likely to take some time as its complex matter.

djbaxter 09-22-2010 12:19 AM

Quote:

Originally Posted by Alfa1 (Post 2101613)
Clicking all the links will cause errors 'inbox full' and other trivial reports to deactivate the related account, which will cause a mass of support requests.

Not to mention the frequent "Mailbox not available" bounces from Hotmail, AOL, and Rogers.com, 90% of the time which means only that their mail servers are having issues and there's nothing wrong with the email address.

I get that sometimes from sending an email to myself at rogers.com or hotmail.

HansiB 09-22-2010 05:02 AM

Quote:

Originally Posted by Alfa1 (Post 2101613)
I'm working with a dev on a complete automation.

Clicking all the links will cause errors 'inbox full' and other trivial reports to deactivate the related account, which will cause a mass of support requests.

IB will also add bounce management to vb4, though its likely to take some time as its complex matter.

Quote:

Originally Posted by djbaxter (Post 2101655)
Not to mention the frequent "Mailbox not available" bounces from Hotmail, AOL, and Rogers.com, 90% of the time which means only that their mail servers are having issues and there's nothing wrong with the email address.

While waiting for those wonderful automated solutions by devs / vbulletin 4.1 I will be much happier doing it this way, by deleting obviously "temporary" bounces and spam emails from my bounce folder and then extracting the ezbounce lines like described in my first post. All the alternatives is more manual labor. And I really need to get this done.


Quote:

Originally Posted by Alfa1 (Post 2101613)
Forget logging into adminCP. Running a cron seems much better.

Seems like a better idea, and probably much simpler! Need to look into how the vbulletin cron function does its thing. Any hints on how to take the list of ezbounce.php urls and make the calls with cron? Dont mind doing some manual editing steps or adjusting the awk script so i just get a list of user ids.

Edit:

Found this tutorial

http://www.vbskinstudio.com/forum/th...basic-cron-job.

Seems easy enough, probably just need to hack the ezbounce.php to do what i want to do and put it in the cron list.

Alfa1 09-22-2010 08:51 AM

We are letting a script find either the userID or the email and use that find the account. Then apply the same changes to the account as EZbounce does. I did find the need for protected groups, as I do not want staff accounts to be deactivated. They receive a PM listing the exact problem(error, number of bounces) instead. (maximum once a week)
Dont know if this is of any help to you.

HansiB 09-24-2010 02:46 PM

Quote:

Originally Posted by Alfa1 (Post 2101744)
We are letting a script find either the userID or the email and use that find the account. Then apply the same changes to the account as EZbounce does. I did find the need for protected groups, as I do not want staff accounts to be deactivated. They receive a PM listing the exact problem(error, number of bounces) instead. (maximum once a week)
Dont know if this is of any help to you.

Well if you have a script to share, the beer is on me :-)

Alfa1 09-25-2010 09:41 AM

Yeah, its complex and we keep hitting new road blocks, so will take some time. Sorry for taking this thread off topic.

Alfa1 10-08-2010 12:10 AM

EZ bounce has this function:
  • Updates bouncing member's "Receive Email from Administrators" setting to NO
At first glance this looks very logical, because we do not want to send admin email to accounts that do not have working email. But as we are already moving those members to a separate usergroup (like awaiting email activation), I see no chance of this anyway.

AntiVirus: could you please explain your line of reason behind this function?

Am I overseeing something important or is this setting superfluous?


All times are GMT. The time now is 06:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02737 seconds
  • Memory Usage 1,766KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete