mirror of
https://github.com/itflow-org/itflow
synced 2026-03-26 07:15:37 +00:00
Mail Ticket Parser Fix: Allow Unencrypted IMAP connections
This commit is contained in:
@@ -348,17 +348,29 @@ function createMailboxFolder($imap, $mailbox, $folderName) {
|
|||||||
// Initialize IMAP connection
|
// Initialize IMAP connection
|
||||||
$validate_cert = true; // or false based on your configuration
|
$validate_cert = true; // or false based on your configuration
|
||||||
|
|
||||||
$imap_encryption = $config_imap_encryption; // e.g., 'ssl' or 'tls'
|
$imap_encryption = $config_imap_encryption; // e.g., 'ssl', 'tls', or '' (empty string) for none
|
||||||
|
|
||||||
$mailbox = '{' . $config_imap_host . ':' . $config_imap_port . '/' . $imap_encryption;
|
// Start building the mailbox string
|
||||||
|
$mailbox = '{' . $config_imap_host . ':' . $config_imap_port;
|
||||||
|
|
||||||
|
// Only add the encryption part if $imap_encryption is not empty
|
||||||
|
if (!empty($imap_encryption)) {
|
||||||
|
$mailbox .= '/' . $imap_encryption;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the certificate validation part
|
||||||
if ($validate_cert) {
|
if ($validate_cert) {
|
||||||
$mailbox .= '/validate-cert';
|
$mailbox .= '/validate-cert';
|
||||||
} else {
|
} else {
|
||||||
$mailbox .= '/novalidate-cert';
|
$mailbox .= '/novalidate-cert';
|
||||||
}
|
}
|
||||||
|
|
||||||
$mailbox .= '}';
|
$mailbox .= '}';
|
||||||
|
|
||||||
|
// Append 'INBOX' to specify the mailbox folder
|
||||||
$inbox_mailbox = $mailbox . 'INBOX';
|
$inbox_mailbox = $mailbox . 'INBOX';
|
||||||
|
|
||||||
|
// Open the IMAP connection
|
||||||
$imap = imap_open($inbox_mailbox, $config_imap_username, $config_imap_password);
|
$imap = imap_open($inbox_mailbox, $config_imap_username, $config_imap_password);
|
||||||
|
|
||||||
if ($imap === false) {
|
if ($imap === false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user