Merge pull request #21627 from FHenry/dev_add_IMAPport_email_collector

NEW: Add IMAP port setting on email collector module
This commit is contained in:
Laurent Destailleur 2022-08-02 19:13:28 +02:00 committed by GitHub
commit 346ed5c69d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -115,7 +115,8 @@ class EmailCollector extends CommonObject
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'),
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'csslist'=>'small'),
'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflow125'),
'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)'),
'port' => array('type'=>'varchar(10)', 'label'=>'EMailHostPort', 'visible'=>1, 'enabled'=>1, 'position'=>91, 'notnull'=>1, 'searchall'=>0, 'comment'=>"IMAP server port", 'help'=>'Example: 993', 'csslist'=>'tdoverflow125', 'default'=>'993'),
'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default'=>'UTF-8'),
'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'),
'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'),
'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>103, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX'),
@ -746,7 +747,7 @@ class EmailCollector extends CommonObject
$flags .= '/authuser='.$partofauth[0].'/user='.$partofauth[1];
}
$connectstringserver = '{'.$this->host.':993'.$flags.'}';
$connectstringserver = '{'.$this->host.':'.$this->port.$flags.'}';
return $connectstringserver;
}

View File

@ -64,6 +64,9 @@ ALTER TABLE llx_ticket ADD COLUMN ip varchar(250);
ALTER TABLE llx_societe ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf;
ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN port varchar(10) DEFAULT '993';
ALTER TABLE llx_bank ADD COLUMN position integer DEFAULT 0;
ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_product (fk_product);

View File

@ -22,6 +22,7 @@ CREATE TABLE llx_emailcollector_emailcollector(
label varchar(255),
description text,
host varchar(255),
port varchar(10) DEFAULT '993',
hostcharset varchar(16) DEFAULT 'UTF-8',
login varchar(128),
password varchar(128),

View File

@ -2064,6 +2064,7 @@ EmailCollectors=Email collectors
EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some records automatically (like leads).
NewEmailCollector=New Email Collector
EMailHost=Host of email IMAP server
EMailHostPort=Port of email IMAP server
MailboxSourceDirectory=Mailbox source directory
MailboxTargetDirectory=Mailbox target directory
EmailcollectorOperations=Operations to do by collector