Author Topic: Time out on sending  (Read 10320 times)

Offline shieldfire

  • Jr. Member
  • **
  • Posts: 10
Time out on sending
« on: June 17, 2015, 01:47:43 PM »
Newbie here:
I finally managed to get passed the infamous authentication error on sending (solution was too obvious ...) but have now come up against a timeout on sending emails.

Syslog says (related to this):
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: master_notify: status 0
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: name_mask: resource
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: name_mask: software
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: connect from unknown[46.254.11.197]
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: match_list_match: unknown: no match
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: match_list_match: 46.254.11.197: no match
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: match_list_match: unknown: no match
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: match_list_match: 46.254.11.197: no match
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: smtp_stream_setup: maxtime=300 enable_deadline=0
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: send attr request = seed
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: send attr size = 32
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: private/tlsmgr: wanted attribute: status
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: input attribute name: status
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: input attribute value: 0
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: private/tlsmgr: wanted attribute: seed
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: input attribute name: seed
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: input attribute value: 1k9PHVlUWKXQLuV2kzyHph2Y7KdTO4uRcKvmbe/f72k=
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: private/tlsmgr: wanted attribute: (list terminator)
Jun 17 17:30:24 mailserver postfix/smtpd[2574]: input attribute name: (end)
Jun 17 17:35:24 mailserver postfix/smtpd[2574]: SSL_accept error from unknown[46.254.11.197]: Connection timed out

Roundcube server is pointing to tls://mailservername:993

The problem seems related to Roundcube config as accessing and sending mail through IMAP from standalone apps like Thunderbird works as intended. The Mail2Web service (accessing the server) also sends mails as intended.

Anyone with any ideas?

/M

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,878
    • SKaero - Custom Roundcube development
Re: Time out on sending
« Reply #1 on: June 17, 2015, 01:57:21 PM »
It seems to be some sort of SSL error, have you tried ssl://mailservername:993?

Offline shieldfire

  • Jr. Member
  • **
  • Posts: 10
Re: Time out on sending
« Reply #2 on: June 17, 2015, 02:06:31 PM »
Yes, I get the same time out effect.
There is a small box in lower right hand corner saying "Sending message" with a spinning wheel.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,878
    • SKaero - Custom Roundcube development
Re: Time out on sending
« Reply #3 on: June 17, 2015, 09:53:56 PM »
Is there anything in the Roundcube error log?

Offline shieldfire

  • Jr. Member
  • **
  • Posts: 10
Re: Time out on sending
« Reply #4 on: June 18, 2015, 12:43:06 AM »
 Not much tail -f /usr/share/rcube/logs/error gives
[18-Jun-2015 04:34:40 UTC] PHP Deprecated:  Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/rcube/vendor/pear/net_smtp/Net/SMTP.php on line 448
[18-Jun-2015 04:34:40 UTC] PHP Deprecated:  Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/rcube/vendor/pear/net_smtp/Net/SMTP.php on line 465

and that's all

Hunted down /var/log/mail.log and found

Jun 18 04:39:40 mailserver postfix/smtpd[3559]: SSL_accept error from unknown[46.254.11.197]: Connection timed out

So it seems you are correct in assuming some kind of SSL mishap. However
Code: [Select]
openssl s_client -connect mailserveraddress:465Connects properly
« Last Edit: June 18, 2015, 12:46:38 AM by shieldfire »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,878
    • SKaero - Custom Roundcube development
Re: Time out on sending
« Reply #5 on: June 18, 2015, 03:00:47 AM »
Roundcube server is pointing to tls://mailservername:993
Shouldn't that be ssl://mailserveraddress:465 then?

Offline shieldfire

  • Jr. Member
  • **
  • Posts: 10
Re: Time out on sending
« Reply #6 on: June 18, 2015, 04:08:05 AM »
Unfortunately it doesn't seem to matter much.  :-[

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,878
    • SKaero - Custom Roundcube development
Re: Time out on sending
« Reply #7 on: June 18, 2015, 10:44:59 AM »
Are you changing the SMTP settings or the IMAP settings?

Offline shieldfire

  • Jr. Member
  • **
  • Posts: 10
Re: Time out on sending
« Reply #8 on: June 18, 2015, 11:49:07 AM »
This is what I have in defaults.inc.php on imap and smtp

Code: [Select]

// ----------------------------------
// IMAP
// ----------------------------------

// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
// WARNING: After hostname change update of mail_host column in users table is
//          required to match old user data records with the new host.
$config['default_host'] = 'ssl://mail.skjoldebrand.eu';
// TCP port used for IMAP connections
$config['default_port'] = 143;

// IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or null to use
// best server supported one)
$config['imap_auth_type'] = LOGIN;

// IMAP socket context options
// See http://php.net/manual/en/context.ssl.php
// The example below enables server certificate validation
//$config['imap_conn_options'] = array(
//  'ssl'         => array(
//     'verify_peer'  => true,
//     'verify_depth' => 3,
//     'cafile'       => '/etc/postfix/smtpd.cert',
//   ),
// );
$config['imap_conn_options'] = null;

// IMAP connection timeout, in seconds. Default: 0 (use default_socket_timeout)
$config['imap_timeout'] = 0;

// Optional IMAP authentication identifier to be used as authorization proxy
$config['imap_auth_cid'] = null;

// Optional IMAP authentication password to be used for imap_auth_cid
$config['imap_auth_pw'] = null;

// If you know your imap's folder delimiter, you can specify it here.
// Otherwise it will be determined automatically
$config['imap_delimiter'] = null;

// If IMAP server doesn't support NAMESPACE extension, but you're
// using shared folders or personal root folder is non-empty, you'll need to
// set these options. All can be strings or arrays of strings.
// Folders need to be ended with directory separator, e.g. "INBOX."
// (special directory "~" is an exception to this rule)
// These can be used also to overwrite server's namespaces
$config['imap_ns_personal'] = null;
$config['imap_ns_other']    = null;
$config['imap_ns_shared']   = null;

// By default IMAP capabilities are readed after connection to IMAP server
// In some cases, e.g. when using IMAP proxy, there's a need to refresh the list
// after login. Set to True if you've got this case.
$config['imap_force_caps'] = false;

// By default list of subscribed folders is determined using LIST-EXTENDED
// extension if available. Some servers (dovecot 1.x) returns wrong results
// for shared namespaces in this case. http://trac.roundcube.net/ticket/1486225
// Enable this option to force LSUB command usage instead.
// Deprecated: Use imap_disabled_caps = array('LIST-EXTENDED')
$config['imap_force_lsub'] = false;

// Some server configurations (e.g. Courier) doesn't list folders in all namespaces
// Enable this option to force listing of folders in all namespaces
$config['imap_force_ns'] = false;

// List of disabled imap extensions.
// Use if your IMAP server has broken implementation of some feature
// and you can't remove it from CAPABILITY string on server-side.
// For example UW-IMAP server has broken ESEARCH.
// Note: Because the list is cached, re-login is required after change.
$config['imap_disabled_caps'] = array();

// Log IMAP session identifers after each IMAP login.
// This is used to relate IMAP session with Roundcube user sessions
$config['imap_log_session'] = false;

// Type of IMAP indexes cache. Supported values: 'db', 'apc' and 'memcache'.
$config['imap_cache'] = null;

// Enables messages cache. Only 'db' cache is supported.
// This requires an IMAP server that supports QRESYNC and CONDSTORE
// extensions (RFC7162). See synchronize() in program/lib/Roundcube/rcube_imap_cache.php
// for further info, or if you experience syncing problems.
$config['messages_cache'] = false;

// Lifetime of IMAP indexes cache. Possible units: s, m, h, d, w
$config['imap_cache_ttl'] = '10d';

// Lifetime of messages cache. Possible units: s, m, h, d, w
$config['messages_cache_ttl'] = '10d';

// Maximum cached message size in kilobytes.
// Note: On MySQL this should be less than (max_allowed_packet - 30%)
$config['messages_cache_threshold'] = 50;


// ----------------------------------
// SMTP
// ----------------------------------

// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['smtp_server'] = 'ssl://mail.skjoldebrand.eu';

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 465;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';

// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$config['smtp_auth_type'] = 'LOGIN';

// Optional SMTP authentication identifier to be used as authorization proxy
$config['smtp_auth_cid'] = null;

// Optional SMTP authentication password to be used for smtp_auth_cid
$config['smtp_auth_pw'] = null;

// SMTP HELO host
// Hostname to give to the remote server for SMTP 'HELO' or 'EHLO' messages
// Leave this blank and you will get the server variable 'server_name' or
// localhost if that isn't defined.
$config['smtp_helo_host'] = 'mail.skjoldebrand.eu';

// SMTP connection timeout, in seconds. Default: 0 (use default_socket_timeout)
// Note: There's a known issue where using ssl connection with
// timeout > 0 causes connection errors (https://bugs.php.net/bug.php?id=54511)
$config['smtp_timeout'] = 0;

// SMTP socket context options
// See http://php.net/manual/en/context.ssl.php
// The example below enables server certificate validation, and
// requires 'smtp_timeout' to be non zero.
// $config['smtp_conn_options'] = array(
//   'ssl'         => array(
//     'verify_peer'  => true,
//     'verify_depth' => 3,
//     'cafile'       => '/etc/postfix/smtpd.cert',
//   ),
// );
$config['smtp_conn_options'] = null;



Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,878
    • SKaero - Custom Roundcube development
Re: Time out on sending
« Reply #9 on: June 18, 2015, 11:54:56 AM »
You shouldn't edit the defaults.inc.php only edit the config.inc.php since the defaults.inc.php is overwritten during upgrades. I don't see any problems with the config options so try enable smtp_debug and post the log.

Offline shieldfire

  • Jr. Member
  • **
  • Posts: 10
Re: Time out on sending
« Reply #10 on: June 18, 2015, 12:32:03 PM »
Everything looks as it did before

[18-Jun-2015 16:20:18 UTC] PHP Deprecated:  Non-static method PEAR::isError() should not be called statically, assuming $this from i$
[18-Jun-2015 16:20:18 UTC] PHP Deprecated:  Non-static method PEAR::isError() should not be called statically, assuming $this from i$
Code: [Select]
[18-Jun-2015 16:24:17 UTC] PHP Deprecated:  Non-static method PEAR::isError() should not be called statically, assuming $this from i$
[18-Jun-2015 16:24:17 UTC] PHP Deprecated:  Non-static method PEAR::isError() should not be called statically, assuming $this from i$
[18-Jun-2015 16:25:18 UTC] PHP Deprecated:  Non-static method PEAR::raiseError() should not be called statically, assuming $this fro$
[18-Jun-2015 16:25:18 +0000]: <vka1qmja> SMTP Error: Connection failed: Invalid response code received from server in /usr/share/rcube/program/lib/Roundcube/rcube.php on line 1713

In session I see
Session auth check failed for vka1qmja5k88ee0jl followed by
Send new auth cookie for vka1qmja5k88ee0jl

from time to time
« Last Edit: June 18, 2015, 12:35:57 PM by shieldfire »

Offline shieldfire

  • Jr. Member
  • **
  • Posts: 10
Re: Time out on sending
« Reply #11 on: June 20, 2015, 12:37:07 AM »
So, tried other webmail solutions to see where the problems lay.
Squirrelmail is as fugly as I remember it. The UI was borked "out of the box" but said it sent mail, and apparently never did.
Horde on the other hand, while having it's own quirks actually sends mail on default installation.
So it definately seems to be Roundcube configuration related on this setup.

Offline murphybillings

  • Newbie
  • *
  • Posts: 1
Re: Time out on sending
« Reply #12 on: June 20, 2015, 09:06:10 AM »
which meant Roundcube had to have something other than a web error as everything else worked perfectly fine.

Offline shieldfire

  • Jr. Member
  • **
  • Posts: 10
Re: Time out on sending
« Reply #13 on: June 21, 2015, 04:02:37 AM »
Indeed, but I haven't found out what it might be. For a minute I thought it was something to do with the Postfix config not working properly (but obviously it does - at least in regards to this).