Added POP3 Auth Mode for email, Issue #849

git-svn-id: svn://192.168.202.10@2321 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2015-05-15 12:03:07 +00:00
parent 82668f3519
commit b2e3eae675
5 changed files with 35 additions and 14 deletions
+12 -8
View File
@@ -59,6 +59,7 @@ use MIME::QuotedPrint;
# 140225-1241 - Added option for SSL no-cert-verify (--ssl-no-cert)
# 140313-0905 - Added Debug options when --debugX for both IMAP and POP3
# 140422-1912 - Added 'related' content type
# 150513-2310 - Added pop3_auth_mode
#
# default path to astguiclient configuration file:
@@ -210,7 +211,7 @@ if($min==0) {$min=60;}
$minutes=($hour*60)+$min;
# $minutes=0; # Uncomment if you want to TEST ONLY, so you can test this at any time.
$stmt="SELECT email_account_id,email_account_name,email_account_description,user_group,protocol,email_replyto_address,email_account_server,email_account_user,email_account_pass,active,email_frequency_check_mins,group_id,default_list_id,call_handle_method,agent_search_method,campaign_id,list_id,email_account_type from vicidial_email_accounts where active='Y'";
$stmt="SELECT email_account_id,email_account_name,email_account_description,user_group,protocol,email_replyto_address,email_account_server,email_account_user,email_account_pass,pop3_auth_mode,active,email_frequency_check_mins,group_id,default_list_id,call_handle_method,agent_search_method,campaign_id,list_id,email_account_type from vicidial_email_accounts where active='Y'";
$rslt=$dbhA->prepare($stmt);
$rslt->execute();
@@ -222,13 +223,14 @@ while (@row=$rslt->fetchrow_array) {
$VARemail_server=$row[6];
$VARemail_user=$row[7];
$VARemail_pwd=$row[8];
$VARemail_frequency=$row[10];
$VARemail_groupid=$row[11];
$default_list_id=$row[12];
$call_handle_method=$row[13];
$agent_search_method=$row[14];
$campaign_id=$row[15];
$list_id=$row[16];
$VARpop3_auth_mode=$row[9];
$VARemail_frequency=$row[11];
$VARemail_groupid=$row[12];
$default_list_id=$row[13];
$call_handle_method=$row[14];
$agent_search_method=$row[15];
$campaign_id=$row[16];
$list_id=$row[17];
if ($DBX) {print "$h - $VARemail_ID - $VARemail_groupid\n";}
@@ -621,6 +623,7 @@ while (@row=$rslt->fetchrow_array) {
HOST => "$VARemail_server",
PORT => 995,
USESSL => true,
AUTH_MODE => "$VARpop3_auth_mode",
DEBUG => "$DBX",
)
or die "Cannot connect through POP3Client: $!";
@@ -952,6 +955,7 @@ while (@row=$rslt->fetchrow_array) {
HOST => "$VARemail_server",
PORT => 995,
USESSL => true,
AUTH_MODE => "$VARpop3_auth_mode",
DEBUG => "$DBX",
)
or die "Cannot connect through POP3Client: $!";
+2 -1
View File
@@ -2924,6 +2924,7 @@ email_replyto_address VARCHAR(255) DEFAULT NULL,
email_account_server VARCHAR(255) DEFAULT NULL,
email_account_user VARCHAR(255) DEFAULT NULL,
email_account_pass VARCHAR(100) DEFAULT NULL,
pop3_auth_mode ENUM('BEST','PASS','APOP','CRAM-MD5') default 'BEST',
active ENUM('Y','N') DEFAULT 'N',
email_frequency_check_mins TINYINT(3) UNSIGNED DEFAULT '5',
group_id VARCHAR(20) DEFAULT NULL,
@@ -3381,4 +3382,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1409',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1411',db_schema_update_date=NOW(),reload_timestamp=NOW();
+4
View File
@@ -32,3 +32,7 @@ UPDATE system_settings SET db_schema_version='1409',db_schema_update_date=NOW()
ALTER TABLE vicidial_users ADD api_allowed_functions VARCHAR(1000) default ' ALL_FUNCTIONS ';
UPDATE system_settings SET db_schema_version='1410',db_schema_update_date=NOW() where db_schema_version < 1410;
ALTER TABLE vicidial_email_accounts ADD pop3_auth_mode ENUM('BEST','PASS','APOP','CRAM-MD5') default 'BEST' AFTER email_account_pass;
UPDATE system_settings SET db_schema_version='1411',db_schema_update_date=NOW() where db_schema_version < 1411;
+11 -5
View File
@@ -16,10 +16,11 @@
# 141230-0021 - Added code for on-the-fly language translations display
# 150421-2255 - Fixed links to default list ID and default_list_id issue
# 150422-1229 - Changed Default List ID
# 150513-2310 - Added POP3 Auth Mode
#
$admin_version = '2.12-10';
$build = '150422-1229';
$admin_version = '2.12-11';
$build = '150513-2310';
$sh="emails";
@@ -53,6 +54,8 @@ if (isset($_GET["email_account_user"])) {$email_account_user=$_GET["email_a
elseif (isset($_POST["email_account_user"])) {$email_account_user=$_POST["email_account_user"];}
if (isset($_GET["email_account_pass"])) {$email_account_pass=$_GET["email_account_pass"];}
elseif (isset($_POST["email_account_pass"])) {$email_account_pass=$_POST["email_account_pass"];}
if (isset($_GET["pop3_auth_mode"])) {$pop3_auth_mode=$_GET["pop3_auth_mode"];}
elseif (isset($_POST["pop3_auth_mode"])) {$pop3_auth_mode=$_POST["pop3_auth_mode"];}
if (isset($_GET["active"])) {$active=$_GET["active"];}
elseif (isset($_POST["active"])) {$active=$_POST["active"];}
if (isset($_GET["email_frequency_check_mins"])) {$email_frequency_check_mins=$_GET["email_frequency_check_mins"];}
@@ -351,7 +354,7 @@ if (($SUBMIT=="SUBMIT" || $SUBMIT=="UPDATE") && $email_account_id)
}
else
{
$ins_stmt="INSERT INTO vicidial_email_accounts(email_account_id, email_account_name, email_account_description, user_group, email_replyto_address, protocol, email_account_server, email_account_user, email_account_pass, active, email_frequency_check_mins, group_id, default_list_id, email_account_type, call_handle_method, agent_search_method, list_id, campaign_id) VALUES('$email_account_id', '$email_account_name', '$email_account_description', '$user_group', '$email_replyto_address', '$protocol', '$email_account_server', '$email_account_user', '$email_account_pass', '$active', '$email_frequency_check_mins', '$group_id', '$default_list_id', '$email_account_type', '$call_handle_method', '$agent_search_method', '$list_id', '$campaign_id')";
$ins_stmt="INSERT INTO vicidial_email_accounts(email_account_id, email_account_name, email_account_description, user_group, email_replyto_address, protocol, email_account_server, email_account_user, email_account_pass, pop3_auth_mode, active, email_frequency_check_mins, group_id, default_list_id, email_account_type, call_handle_method, agent_search_method, list_id, campaign_id) VALUES('$email_account_id', '$email_account_name', '$email_account_description', '$user_group', '$email_replyto_address', '$protocol', '$email_account_server', '$email_account_user', '$email_account_pass', '$pop3_auth_mode', '$active', '$email_frequency_check_mins', '$group_id', '$default_list_id', '$email_account_type', '$call_handle_method', '$agent_search_method', '$list_id', '$campaign_id')";
$ins_rslt=mysql_to_mysqli($ins_stmt, $link);
if (mysqli_affected_rows($link)==0)
{
@@ -375,7 +378,7 @@ if (($SUBMIT=="SUBMIT" || $SUBMIT=="UPDATE") && $email_account_id)
}
else
{
$upd_stmt="update vicidial_email_accounts set email_account_name='$email_account_name', email_account_description='$email_account_description', user_group='$user_group', protocol='$protocol', email_replyto_address='$email_replyto_address', email_account_server='$email_account_server', email_account_user='$email_account_user', email_account_pass='$email_account_pass', active='$active', email_frequency_check_mins='$email_frequency_check_mins', group_id='$group_id', default_list_id='$default_list_id', email_account_type='$email_account_type', call_handle_method='$call_handle_method', agent_search_method='$agent_search_method', campaign_id='$campaign_id', list_id='$list_id' WHERE email_account_id='$email_account_id'";
$upd_stmt="update vicidial_email_accounts set email_account_name='$email_account_name', email_account_description='$email_account_description', user_group='$user_group', protocol='$protocol', email_replyto_address='$email_replyto_address', email_account_server='$email_account_server', email_account_user='$email_account_user', email_account_pass='$email_account_pass', pop3_auth_mode='$pop3_auth_mode', active='$active', email_frequency_check_mins='$email_frequency_check_mins', group_id='$group_id', default_list_id='$default_list_id', email_account_type='$email_account_type', call_handle_method='$call_handle_method', agent_search_method='$agent_search_method', campaign_id='$campaign_id', list_id='$list_id' WHERE email_account_id='$email_account_id'";
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
if (mysqli_affected_rows($link)==0)
{
@@ -411,7 +414,7 @@ else if ($SUBMIT=="COPY")
else
{
$row=mysqli_fetch_array($rslt);
$ins_stmt="insert into vicidial_email_accounts(email_account_id, email_account_name, email_account_description, user_group, protocol, email_replyto_address, email_account_server, email_account_user, email_account_pass, active, email_frequency_check_mins, group_id, default_list_id, email_account_type, call_handle_method, agent_search_method, list_id, campaign_id) VALUES('$new_account_id', '$email_account_name', '$row[email_account_description]', '$row[user_group]', '$row[protocol]', '$row[email_replyto_address]', '$row[email_account_server]', '$row[email_account_user]', '$row[email_account_pass]', '$row[active]', '$row[email_frequency_check_mins]', '$row[group_id]','$row[default_list_id]', '$row[email_account_type]', '$row[call_handle_method]','$row[agent_search_method]', '$row[list_id]', '$row[campaign_id]')";
$ins_stmt="insert into vicidial_email_accounts(email_account_id, email_account_name, email_account_description, user_group, protocol, email_replyto_address, email_account_server, email_account_user, email_account_pass, pop3_auth_mode, active, email_frequency_check_mins, group_id, default_list_id, email_account_type, call_handle_method, agent_search_method, list_id, campaign_id) VALUES('$new_account_id', '$email_account_name', '$row[email_account_description]', '$row[user_group]', '$row[protocol]', '$row[email_replyto_address]', '$row[email_account_server]', '$row[email_account_user]', '$row[email_account_pass]', '$row[pop3_auth_mode]', '$row[active]', '$row[email_frequency_check_mins]', '$row[group_id]','$row[default_list_id]', '$row[email_account_type]', '$row[call_handle_method]','$row[agent_search_method]', '$row[list_id]', '$row[campaign_id]')";
$ins_rslt=mysql_to_mysqli($ins_stmt, $link);
if (mysqli_affected_rows($link)==0)
{
@@ -594,6 +597,7 @@ else if ($eact == "ADD")
echo "<option SELECTED value=\"---ALL---\">"._QXZ("All Admin User Groups")."</option>\n";
echo "</select>$NWB#email_accounts-admin_user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Email Account Protocol").": </td><td align=left><select size=1 name=protocol><option SELECTED>IMAP</option><option>POP3</option></select>$NWB#email_accounts-protocol$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Auth Mode for POP3 protocol only").": </td><td align=left><select size=1 name=pop3_auth_mode><option SELECTED>BEST</option><option>PASS</option><option>APOP</option><option>CRAM-MD5</option></select>$NWB#email_accounts-pop3_auth_mode$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Email Reply-to Address").": </td><td align=left><input type=text name=email_replyto_address size=70 maxlength=255 value='$email_replyto_address'>$NWB#email_accounts-email_replyto_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Email Account Server").": </td><td align=left><input type=text name=email_account_server size=70 maxlength=255 value='$email_account_server'>$NWB#email_accounts-email_account_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Email Account User").": </td><td align=left><input type=text name=email_account_user size=30 maxlength=255 value='$email_account_user'>$NWB#email_accounts-email_account_user$NWE</td></tr>\n";
@@ -646,6 +650,7 @@ else if (($eact=="DELETE" || $eact=="UPDATE") && $email_account_id)
$email_account_server=$row["email_account_server"];
$email_account_user=$row["email_account_user"];
$email_account_pass=$row["email_account_pass"];
$pop3_auth_mode=$row["pop3_auth_mode"];
$active=$row["active"];
$email_frequency_check_mins=$row["email_frequency_check_mins"];
$group_id=$row["group_id"];
@@ -777,6 +782,7 @@ else if (($eact=="DELETE" || $eact=="UPDATE") && $email_account_id)
echo "<option SELECTED value=\"---ALL---\">"._QXZ("All Admin User Groups")."</option>\n";
echo "</select>$NWB#email_accounts-admin_user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Email Account Protocol").": </td><td align=left><select size=1 name=protocol><option>IMAP</option><option>POP3</option><option SELECTED>$protocol</option></select>$NWB#email_accounts-protocol$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Auth Mode for POP3 protocol only").": </td><td align=left><select size=1 name=pop3_auth_mode><option>BEST</option><option>PASS</option><option>APOP</option><option>CRAM-MD5</option><option SELECTED>$pop3_auth_mode</option></select>$NWB#email_accounts-pop3_auth_mode$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Email Reply-to Address").": </td><td align=left><input type=text name=email_replyto_address size=70 maxlength=255 value='$email_replyto_address'>$NWB#email_accounts-email_replyto_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Email Account Server").": </td><td align=left><input type=text name=email_account_server size=70 maxlength=255 value='$email_account_server'>$NWB#email_accounts-email_account_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Email Account User").": </td><td align=left><input type=text name=email_account_user size=30 maxlength=255 value='$email_account_user'>$NWB#email_accounts-email_account_user$NWE</td></tr>\n";
+6
View File
@@ -45,6 +45,7 @@
# 150404-0934 - Added enable_did_entry_list_id and related DID options
# 150428-1704 - Added enable_third_webform
# 150429-1232 - Added new user API restrictions
# 150513-2310 - Added POP3 Auth Mode
#
require("dbconnect_mysqli.php");
@@ -5064,6 +5065,11 @@ if ($SSallow_emails>0)
<BR>
<B><?php echo _QXZ("Email Account User"); ?> -</B><?php echo _QXZ("The login used to access this account. Usually its the portion of the reply-to address before the -at- symbol. "); ?>
<BR>
<A NAME="email_accounts-pop3_auth_mode">
<BR>
<B><?php echo _QXZ("Auth Mode for POP3 protocol only"); ?> -</B><?php echo _QXZ("The authorization mode to use when POP3 is the mail protocol on the email account. BEST is the default. It will use APOP if the server appears to support it and it can be used to successfully log on, then try similarly with CRAM-MD5, and finally PASS. APOP and CRAM-MD5 imply that an MD5 checksum will be used instead of sending your password in cleartext. However, if the server does not claim to support APOP or CRAM-MD5, the cleartext method will be used. Be careful. There are a few servers that will send a timestamp in the banner greeting, but APOP will not work with them, for instance if the server does not know your password in cleartext. If you think your authentication information is correct, you may have to use PASS for that server. The same applies to CRAM-MD5."); ?>
<BR>
<A NAME="email_accounts-email_account_pass">
<BR>