Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send IMAP ID only after authentication #7517

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions program/lib/Roundcube/rcube_imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,7 @@ public function connect($host, $user, $pass, $port=143, $use_ssl=null)

if ($this->options['debug']) {
$this->set_debug(true);

$this->options['ident'] = array(
'name' => 'Roundcube',
'version' => RCUBE_VERSION,
'php' => PHP_VERSION,
'os' => PHP_OS,
'command' => $_SERVER['REQUEST_URI'],
);
$this->conn->imap_id['command'] = $_SERVER['REQUEST_URI'];
}

$attempt = 0;
Expand Down Expand Up @@ -180,6 +173,11 @@ public function connect($host, $user, $pass, $port=143, $use_ssl=null)
$session = $m[1];
}

// Send ID info
if (!empty($this->conn->imap_id) && $this->conn->getCapability('ID')) {
$this->data['ID'] = $this->conn->id($this->conn->imap_id);
}

// get namespace and delimiter
$this->set_env();

Expand Down Expand Up @@ -632,12 +630,7 @@ public function get_vendor()
}

if (($ident = $this->conn->data['ID']) === null && $this->get_capability('ID')) {
$ident = $this->conn->id(array(
'name' => 'Roundcube',
'version' => RCUBE_VERSION,
'php' => PHP_VERSION,
'os' => PHP_OS,
));
$ident = $this->conn->id($this->conn->imap_id);
}

$vendor = (string) (!empty($ident) ? $ident['name'] : '');
Expand Down
12 changes: 7 additions & 5 deletions program/lib/Roundcube/rcube_imap_generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ class rcube_imap_generic
'*' => '\\*',
);

public $imap_id = array(
'name' => 'Roundcube',
'version' => RCUBE_VERSION,
'php' => PHP_VERSION,
'os' => PHP_OS,
);

protected $fp;
protected $host;
protected $cmd_tag;
Expand Down Expand Up @@ -913,11 +920,6 @@ public function connect($host, $user, $password, $options = array())
return false;
}

// Send ID info
if (!empty($this->prefs['ident']) && $this->getCapability('ID')) {
$this->data['ID'] = $this->id($this->prefs['ident']);
}

$auth_method = $this->prefs['auth_type'];
$auth_methods = array();
$result = null;
Expand Down