diff --git a/bin/AST_inbound_email_parser.pl b/bin/AST_inbound_email_parser.pl index 2b37aa76..6024cf9c 100644 --- a/bin/AST_inbound_email_parser.pl +++ b/bin/AST_inbound_email_parser.pl @@ -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: $!"; diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 04187e18..3db7693a 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -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(); diff --git a/extras/upgrade_2.12.sql b/extras/upgrade_2.12.sql index c3528540..5d96b5d1 100644 --- a/extras/upgrade_2.12.sql +++ b/extras/upgrade_2.12.sql @@ -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; diff --git a/www/vicidial/admin_email_accounts.php b/www/vicidial/admin_email_accounts.php index e156589d..6495723f 100644 --- a/www/vicidial/admin_email_accounts.php +++ b/www/vicidial/admin_email_accounts.php @@ -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 "\n"; echo "$NWB#email_accounts-admin_user_group$NWE\n"; echo ""._QXZ("Email Account Protocol").": $NWB#email_accounts-protocol$NWE\n"; + echo ""._QXZ("Auth Mode for POP3 protocol only").": $NWB#email_accounts-pop3_auth_mode$NWE\n"; echo ""._QXZ("Email Reply-to Address").": $NWB#email_accounts-email_replyto_address$NWE\n"; echo ""._QXZ("Email Account Server").": $NWB#email_accounts-email_account_server$NWE\n"; echo ""._QXZ("Email Account User").": $NWB#email_accounts-email_account_user$NWE\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 "\n"; echo "$NWB#email_accounts-admin_user_group$NWE\n"; echo ""._QXZ("Email Account Protocol").": $NWB#email_accounts-protocol$NWE\n"; + echo ""._QXZ("Auth Mode for POP3 protocol only").": $NWB#email_accounts-pop3_auth_mode$NWE\n"; echo ""._QXZ("Email Reply-to Address").": $NWB#email_accounts-email_replyto_address$NWE\n"; echo ""._QXZ("Email Account Server").": $NWB#email_accounts-email_account_server$NWE\n"; echo ""._QXZ("Email Account User").": $NWB#email_accounts-email_account_user$NWE\n"; diff --git a/www/vicidial/help.php b/www/vicidial/help.php index 567eed5c..dcd08c2e 100644 --- a/www/vicidial/help.php +++ b/www/vicidial/help.php @@ -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)
- +
+ +
+ - +