支持Gmail IMAP的Webmail客户端?

时间:2012-05-05 20:32:59

标签: php email gmail imap gmail-imap

客户正在请求网络界面,他可以接受或拒绝通过电子邮件提交给hime的表单。我通常只使用Gmail,但我不需要一半的功能。

我找到了Roundcube并进行了设置,但我无法从Gmail的服务器上获取IMAP设置。我也建立了自己的,通过在我的服务上使用CPanel,由Hostgator托管,但没有去。

SMTP设置正常工作:

Server: ssl://smtp.gmail.com
Port: 465
User: ****
Password: ****

尝试发送电子邮件... SMTP发送:确定

但是当我尝试使用Gmail的IMAP设置时,出现以下错误:

Connecting to ssl://imap.gmail.com...
IMAP connect:  NOT OK(Login failed for **** from 74.110.63.15. Could not connect to ssl://imap.gmail.com:993: Connection timed out)

我尝试了多种方法,包括联系我的服务器以查看端口是否被阻止(它不是),但没有任何工作。

我认为这可能只发生在Gmail的IMAP服务器上,但是当我使用这些设置时它也会发生错误。

我是否应该以不同的方式做这件事?

编辑1: 从笔记本电脑输出终端中的telnet imap.gmail.com 993

telnet imap.gmail.com 993
Trying 173.194.76.108...
Connected to gmail-imap.l.google.com.
Escape character is '^]'.
'^]'.
Connection closed by foreign host.
new-host-10:~ charlescarver$ 

编辑2: 确认服务器没有阻塞端口:

openssh
s_client -connect imap.gmail.com:993 
CONNECTED(00000003) 
...

编辑3:配置文件:

<?php

$rcmail_config = array();

$rcmail_config['debug_level'] = 1;

$rcmail_config['log_driver'] = 'file';

$rcmail_config['log_date_format'] = 'd-M-Y H:i:s O';

$rcmail_config['syslog_id'] = 'roundcube';

$rcmail_config['syslog_facility'] = LOG_USER;

$rcmail_config['smtp_log'] = true;

$rcmail_config['log_logins'] = true;

$rcmail_config['log_session'] = true;

$rcmail_config['sql_debug'] = true;

$rcmail_config['imap_debug'] = true;

$rcmail_config['ldap_debug'] = true;

$rcmail_config['smtp_debug'] = true;

$rcmail_config['default_host'] = 'ssl://imap.gmail.com';

$rcmail_config['default_port'] = 993;

$rcmail_config['imap_auth_type'] = 'PLAIN';

$rcmail_config['imap_delimiter'] = null;

$rcmail_config['imap_ns_personal'] = null;

$rcmail_config['imap_ns_other']    = null;

$rcmail_config['imap_ns_shared']   = null;

$rcmail_config['imap_force_caps'] = false;

$rcmail_config['imap_force_lsub'] = false;

$rcmail_config['imap_timeout'] = 0;

$rcmail_config['imap_auth_cid'] = null;

$rcmail_config['imap_auth_pw'] = null;

$rcmail_config['imap_cache'] = null;

$rcmail_config['messages_cache'] = false;

$rcmail_config['smtp_server'] = 'ssl://smtp.gmail.com';

$rcmail_config['smtp_port'] = 465;

$rcmail_config['smtp_user'] = 'email';

$rcmail_config['smtp_pass'] = 'pass';

$rcmail_config['smtp_auth_type'] = '';

$rcmail_config['smtp_auth_cid'] = null;

$rcmail_config['smtp_auth_pw'] = null;

$rcmail_config['smtp_helo_host'] = '';

$rcmail_config['smtp_timeout'] = 0;

$rcmail_config['enable_installer'] = true;

$rcmail_config['log_dir'] = 'logs/';

$rcmail_config['temp_dir'] = 'temp/';

$rcmail_config['message_cache_lifetime'] = '10d';

$rcmail_config['force_https'] = false;

$rcmail_config['use_https'] = false;

$rcmail_config['login_autocomplete'] = 0;

$rcmail_config['login_lc'] = false;

$rcmail_config['auto_create_user'] = true;

$rcmail_config['skin_logo'] = null;

$rcmail_config['skin_include_php'] = false;

$rcmail_config['session_lifetime'] = 10;

$rcmail_config['session_domain'] = '';

$rcmail_config['session_name'] = null;

$rcmail_config['session_storage'] = 'db';

$rcmail_config['memcache_hosts'] = null; 

$rcmail_config['ip_check'] = false;

$rcmail_config['referer_check'] = false;

$rcmail_config['x_frame_options'] = 'sameorigin';

$rcmail_config['des_key'] = '*fq85DV6dJy4ZDf0y_oj$Mw7';

$rcmail_config['username_domain'] = 'email';

$rcmail_config['mail_domain'] = '';

$rcmail_config['password_charset'] = 'ISO-8859-1';

$rcmail_config['sendmail_delay'] = 0;

$rcmail_config['max_recipients'] = 0; 

$rcmail_config['max_group_members'] = 0; 

$rcmail_config['useragent'] = 'Roundcube Webmail/'.RCMAIL_VERSION;

$rcmail_config['product_name'] = 'Requests';

$rcmail_config['include_host_config'] = false;

$rcmail_config['generic_message_footer'] = '';

$rcmail_config['generic_message_footer_html'] = '';

$rcmail_config['http_received_header'] = false;

$rcmail_config['http_received_header_encrypt'] = false;

$rcmail_config['mail_header_delimiter'] = NULL;

$rcmail_config['line_length'] = 72;

$rcmail_config['send_format_flowed'] = true;

$rcmail_config['dont_override'] = array();

$rcmail_config['identities_level'] = 0;

$rcmail_config['client_mimetypes'] = null;  

$rcmail_config['mime_magic'] = '/usr/share/misc/magic';

$rcmail_config['im_identify_path'] = null;

$rcmail_config['im_convert_path'] = null;

$rcmail_config['contact_photo_size'] = 160;

$rcmail_config['email_dns_check'] = false;

$rcmail_config['plugins'] = array();

$rcmail_config['message_sort_col'] = '';

$rcmail_config['message_sort_order'] = 'DESC';

$rcmail_config['list_cols'] = array('subject', 'status', 'from', 'date', 'size', 'flag', 'attachment');

$rcmail_config['language'] = null;

$rcmail_config['date_format'] = 'Y-m-d';

$rcmail_config['date_formats'] = array('Y-m-d', 'd-m-Y', 'Y/m/d', 'm/d/Y', 'd/m/Y', 'd.m.Y', 'j.n.Y');

$rcmail_config['time_format'] = 'H:i';

$rcmail_config['time_formats'] = array('G:i', 'H:i', 'g:i a', 'h:i A');

$rcmail_config['date_short'] = 'D H:i';

$rcmail_config['date_long'] = 'Y-m-d H:i';

$rcmail_config['drafts_mbox'] = 'Drafts';

$rcmail_config['junk_mbox'] = 'Junk';

$rcmail_config['sent_mbox'] = 'Sent';

$rcmail_config['trash_mbox'] = 'Trash';

$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');

$rcmail_config['create_default_folders'] = false;

$rcmail_config['protect_default_folders'] = true;

$rcmail_config['quota_zero_as_unlimited'] = false;

$rcmail_config['enable_spellcheck'] = true;

$rcmail_config['spellcheck_dictionary'] = false;

$rcmail_config['spellcheck_engine'] = 'pspell';

$rcmail_config['spellcheck_uri'] = '';

$rcmail_config['spellcheck_languages'] = NULL;

$rcmail_config['spellcheck_ignore_caps'] = false;

$rcmail_config['spellcheck_ignore_nums'] = false;

$rcmail_config['spellcheck_ignore_syms'] = false;

$rcmail_config['recipients_separator'] = ',';

$rcmail_config['max_pagesize'] = 200;

$rcmail_config['min_keep_alive'] = 60;

$rcmail_config['upload_progress'] = false;

$rcmail_config['undo_timeout'] = 0;

$rcmail_config['address_book_type'] = 'sql';

$rcmail_config['ldap_public'] = array();

$rcmail_config['autocomplete_addressbooks'] = array('sql');

$rcmail_config['autocomplete_min_length'] = 1;

$rcmail_config['autocomplete_threads'] = 0;

$rcmail_config['autocomplete_max'] = 15;

$rcmail_config['address_template'] = '{street}<br/>{locality} {zipcode}<br/>{country} {region}';

$rcmail_config['addressbook_search_mode'] = 0;

$rcmail_config['default_charset'] = 'ISO-8859-1';

$rcmail_config['skin'] = 'default';

$rcmail_config['pagesize'] = 40;

$rcmail_config['addressbook_sort_col'] = 'surname';

$rcmail_config['addressbook_name_listing'] = 0;

$rcmail_config['timezone'] = 'auto';

$rcmail_config['dst_active'] = null;

$rcmail_config['prefer_html'] = true;

$rcmail_config['show_images'] = 0;

$rcmail_config['htmleditor'] = 0;

$rcmail_config['prettydate'] = true;

$rcmail_config['draft_autosave'] = 300;

$rcmail_config['preview_pane'] = false;

$rcmail_config['preview_pane_mark_read'] = 0;

$rcmail_config['logout_purge'] = false;

$rcmail_config['logout_expunge'] = false;

$rcmail_config['inline_images'] = true;

$rcmail_config['mime_param_folding'] = 0;

$rcmail_config['skip_deleted'] = false;

$rcmail_config['read_when_deleted'] = true;

$rcmail_config['flag_for_deletion'] = false;

$rcmail_config['keep_alive'] = 60;

$rcmail_config['check_all_folders'] = false;

$rcmail_config['display_next'] = false;

$rcmail_config['autoexpand_threads'] = 0;

$rcmail_config['top_posting'] = false;

$rcmail_config['strip_existing_sig'] = true;

$rcmail_config['show_sig'] = 1;

$rcmail_config['sig_above'] = false;

$rcmail_config['force_7bit'] = false;

$rcmail_config['search_mods'] = null;  

$rcmail_config['addressbook_search_mods'] = null; 

$rcmail_config['delete_always'] = false;

$rcmail_config['mdn_requests'] = 0;

$rcmail_config['mdn_default'] = 0;

$rcmail_config['dsn_default'] = 0;

$rcmail_config['reply_same_folder'] = false;

$rcmail_config['forward_attachment'] = false;

$rcmail_config['default_addressbook'] = null;

$rcmail_config['spellcheck_before_send'] = false;

$rcmail_config['autocomplete_single'] = false;

2 个答案:

答案 0 :(得分:1)

您使用的是imap_auth_type?

在配置文件中尝试将imap_auth_type设置为'plain'。

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

我可以使用以下配置使用最新版本的Roundcube(v0.7.2):

$rcmail_config['default_host'] = 'ssl://imap.gmail.com';
$rcmail_config['default_port'] = 993;
$rcmail_config['imap_auth_type'] = null;
$rcmail_config['username_domain'] = 'gmail.com';

然后我可以使用我的gmail用户名(不带@ gmail.com)和gmail密码登录。

配置的其余部分保留在默认设置中。

答案 1 :(得分:1)

我也有同样的问题,尝试了PLAIN和NULL,都没有工作。还有其他建议吗?

感谢。

编辑:由于我没有SSH而进行检查的联系主机 - 我认为他们修改了防火墙,所有现在都在使用NULL