Author Topic: Gmail SMTP problem  (Read 7463 times)

Offline RaVage

  • Newbie
  • *
  • Posts: 4
Gmail SMTP problem
« on: February 25, 2010, 12:04:28 PM »
Hi,

I am new to roundcube. I just installed it on my website to access my gmail account.
I followed all the instructions, as far as I can tell.
I managed to access mail through the IMAP protocol, I can see my Inbox, and all my mail.

What I cannot do is send mail.... And I cannot understand why. I always have "SMTP Error (-1)" it fails to connect to the server...

Here is part of my main.inc.php :
// automatically create a new RoundCube user when log-in the first time.
// a new user will be created once the IMAP login succeeds.
// set to false if only registered users can use this service
$rcmail_config['auto_create_user'] = TRUE;

// 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://
$rcmail_config['default_host'] = 'ssl://imap.gmail.com';

// TCP port used for IMAP connections
$rcmail_config['default_port'] = 993;

// IMAP auth type. Can be "auth" (CRAM-MD5), "plain" (PLAIN) or "check" to auto detect.
// Optional, defaults to "check"
$rcmail_config['imap_auth_type'] = null;

// If you know your imap's root directory and its folder delimiter,
// you can specify them here. Otherwise they will be determined automatically.
$rcmail_config['imap_root'] = null;
$rcmail_config['imap_delimiter'] = null;

// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['username_domain'] = '@gmail.com';

// This domain will be used to form e-mail addresses of new users
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['mail_domain'] = '';

// Path to a virtuser table file to resolve user names and e-mail addresses
$rcmail_config['virtuser_file'] = '';

// Query to resolve user names and e-mail addresses from the database
// %u will be replaced with the current username for login.
// The query should select the user's e-mail address as first column
// and optional identity name as second column
$rcmail_config['virtuser_query'] = '';

// use this host for sending mails.
// to use SSL connection, set ssl://smtp.host.com
// if left blank, the PHP mail() function is used
// Use %h variable as replacement for user's IMAP hostname
$rcmail_config['smtp_server'] = 'ssl://smtp.gmail.com';

// SMTP port (default is 25; 465 for SSL)
$rcmail_config['smtp_port'] = 465;

// SMTP username (if required) if you use %u as the username RoundCube
// will use the current username for login
$rcmail_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
$rcmail_config['smtp_pass'] = '%p';

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

// 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. 
$rcmail_config['smtp_helo_host'] = '';

// Log sent messages
$rcmail_config['smtp_log'] = TRUE;

// Log SQL queries to <log_dir>/sql or to syslog
$rcmail_config['sql_debug'] = false;

// Log IMAP conversation to <log_dir>/imap or to syslog
$rcmail_config['imap_debug'] = false;

// Log LDAP conversation to <log_dir>/ldap or to syslog
$rcmail_config['ldap_debug'] = false;

// Log SMTP conversation to <log_dir>/smtp or to syslog
$rcmail_config['smtp_debug'] = false;

// How many seconds must pass between emails sent by a user
$rcmail_config['sendmail_delay'] = 0;


Can someone tell me what is wrong ?

Thanks a lot...

RV.
« Last Edit: February 25, 2010, 12:05:34 PM by RaVage »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Gmail SMTP problem
« Reply #1 on: February 25, 2010, 08:27:53 PM »
Make sure your host isn't blocking port 465, what is the massage in the error log?

Offline RaVage

  • Newbie
  • *
  • Posts: 4
Gmail SMTP problem
« Reply #2 on: March 01, 2010, 03:14:32 AM »
Thanks for answering,
Actually I am hosting this on the webserver I rent at 1and1. I did not manage to allow the writing in my log folder (I chmoded it to 777 but it seems like I siply can only create files by ftp...) so I don't have logs :(
And I am looking for the port blocking, because I have no idea.
Is there a way to check that ?

Offline RaVage

  • Newbie
  • *
  • Posts: 4
Gmail SMTP problem
« Reply #3 on: March 01, 2010, 03:42:28 AM »
Thanks for your reply.
I installed roundcube on my webserver. It is hosted by 1and1. I actually don't control everything. I created folders for the logs and temp files (chmoded at 777) and there is no possibility to create files there (maybe it is only possible by ftp ?), so I don't have any log to show.

For the port, I am investigating.

Thanks

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Gmail SMTP problem
« Reply #4 on: March 01, 2010, 07:50:23 AM »
You would have to contact your host to find out if the port is blocked.

alice005

  • Guest
Gmail SMTP problem
« Reply #5 on: March 02, 2010, 01:49:57 AM »
Quote from: RaVage;25839
Hi,

I am new to roundcube. I just installed it on my website to access my gmail account.
I followed all the instructions, as far as I can tell.
I managed to access mail through the IMAP protocol, I can see my Inbox, and all my mail.

What I cannot do is send mail.... And I cannot understand why. I always have "SMTP Error (-1)" it fails to connect to the server...

Here is part of my main.inc.php :
// automatically create a new RoundCube user when log-in the first time.
// a new user will be created once the IMAP login succeeds.
// set to false if only registered users can use this service
$rcmail_config['auto_create_user'] = TRUE;

// 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://
$rcmail_config['default_host'] = 'ssl://imap.gmail.com';

// TCP port used for IMAP connections
$rcmail_config['default_port'] = 993;

// IMAP auth type. Can be "auth" (CRAM-MD5), "plain" (PLAIN) or "check" to auto detect.
// Optional, defaults to "check"
$rcmail_config['imap_auth_type'] = null;

// If you know your imap's root directory and its folder delimiter,
// you can specify them here. Otherwise they will be determined automatically.
$rcmail_config['imap_root'] = null;
$rcmail_config['imap_delimiter'] = null;

// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['username_domain'] = '@gmail.com';

// This domain will be used to form e-mail addresses of new users
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['mail_domain'] = '';

// Path to a virtuser table file to resolve user names and e-mail addresses
$rcmail_config['virtuser_file'] = '';

// Query to resolve user names and e-mail addresses from the database
// %u will be replaced with the current username for login.
// The query should select the user's e-mail address as first column
// and optional identity name as second column
$rcmail_config['virtuser_query'] = '';

// use this host for sending mails.
// to use SSL connection, set ssl://smtp.host.com
// if left blank, the PHP mail() function is used
// Use %h variable as replacement for user's IMAP hostname
$rcmail_config['smtp_server'] = 'ssl://smtp.gmail.com';

// SMTP port (default is 25; 465 for SSL)
$rcmail_config['smtp_port'] = 465;

// SMTP username (if required) if you use %u as the username RoundCube
// will use the current username for login
$rcmail_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
$rcmail_config['smtp_pass'] = '%p';

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

// 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. 
$rcmail_config['smtp_helo_host'] = '';

// Log sent messages
$rcmail_config['smtp_log'] = TRUE;

// Log SQL queries to <log_dir>/sql or to syslog
$rcmail_config['sql_debug'] = false;

// Log IMAP conversation to <log_dir>/imap or to syslog
$rcmail_config['imap_debug'] = false;

// Log LDAP conversation to <log_dir>/ldap or to syslog
$rcmail_config['ldap_debug'] = false;

// Log SMTP conversation to <log_dir>/smtp or to syslog
$rcmail_config['smtp_debug'] = false;

// How many seconds must pass between emails sent by a user
$rcmail_config['sendmail_delay'] = 0;


Can someone tell me what is wrong ?

Thanks a lot...

RV.


I have the same problem. Help us.
_____________________
Virtual Assistant

Offline RaVage

  • Newbie
  • *
  • Posts: 4
Gmail SMTP problem
« Reply #6 on: March 02, 2010, 04:20:31 AM »
I tried... and the answers are very very vague.... I guess they don't want to tell us what ports are open and what are not !

So, what I did is, I did not put anything inside smtp server.... and it works well using php mail() function....
I won't look further....

Thanks for your help.