I receive the following error when trying to manually retrieve: warning: imap_open() [function.imap-open]: Couldn't open stream {pop.gmail.com:995/pop3}INBOX in /home/u7/XXXX/html/d/modules/mailhandler/mailhandler.module on line 16.

Drupal 5

Thank you.

Comments

moshe weitzman’s picture

Status: Active » Closed (fixed)

you can't connect to own POP mailbox. only you know why.

kdrewnj’s picture

I can connect to my mailbox, just not using mailhandler....

kdrewnj’s picture

Ok, tried another account, and now I receive this error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

"Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error."

Thanks for your help.

albertc’s picture

I have the same problem:

warning: imap_open() [function.imap-open]: Couldn't open stream {mail.MYDOMAIN.com:110/pop3/novalidate-cert}INBOX in /home/MYPATH/sites/all/modules/mailhandler/mailhandler.module on line 16.

Mailhandler POP3 connection failed: prova02@MYDOMAIN.com

The setup and mailbox retrieval have been working while the site was on an external, development server. Mailhandler has stopped working when I moved the site to the production server, which also contains the mail server.

Any ideas?

Thanks in advance for any assistance
--
Albert

adam_b’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

I'm having the same problem as the initial report, using v5.x-1.1. The POP3 mailbox works fine when I'm connecting to it from Outlook but it won't work from Mailhandler:
warning: imap_open() [function.imap-open]: Couldn't open stream {pop.googlemail.com:995/pop3} in W:\www\drupal\sites\all\modules\mailhandler\mailhandler.module on line 16.

Note that I'm also using Googlemail/Gmail, which requires port 995. Is there some specific setting which that mailsystem requires which Mailhandler doesn't like or know about?

aspags’s picture

I too am stuck with this tonight!

I tried with '/ssl'under 'extra commands' to force it to use ssl which google requires.

but i still get an error:

warning: imap_open() [function.imap-open]: Couldn't open stream {pop.googlemail.com:995/pop3/ssl}

does this work for anyone or is there another command i must add?

aspags’s picture

Just a follow-up to my last post, in case anyone else has the same problem. I have discovered that my host (hostmonster) blocks port 995. I verified this by trying telnet pop.googlemail.com 995 from the host. In my case this explains why I could connect from my pc with a mail reader, but not from the Drupal on my host.

adam_b’s picture

That's not my problem - I'm testing the mailhandler on my workstation, which can connect to Googlemail via both Outlook and telnet. Aspags, could I ask you to e-mail me the details of your Mailhandler mailbox configuration (without username/password, natch) at adam@knowledgeview.co.uk so I can see if I've left out something obvious? Many thanks.

jacauc’s picture

same problem as #6.
subscribing

paxton’s picture

doesn't work for me either

pitartist’s picture

Any progress on this? I'm having the same problem in Drupal 4.7. It is driving me batty!

warning: imap_open() [function.imap-open]: Couldn't open stream {mail.XXX.org/pop3/ssl/user=XXX@gmail.com:26}INBOX in /home/XXX/public_html/XXX/modules/mailhandler/mailhandler.module on line 13.

PRFB’s picture

I'm having a similar issue, and I wonder if the issue arises when the email's domain is different from the site's domain.

It seems most of you guys are using Mailhandler with gmail. I'm not using gmail, but I am trying to pull from an account I have on a different server on a different host.

Once I finish testing the new host I'll transition my email over there too and see if it works.

-Patricia

eggthing’s picture

Same problem. Yup. Using googlemail.

ihardenburgh’s picture

Using gmail account too...Don't get above error (after user /ssl command), but can't retrieve messages...Just showing Mailhandler retrieve susscesful: 0 messages for user@gmail.com...However, I get this for all of my add external host accounts...

PRFB’s picture

Per my above message, I've completed host transition so the domain for my email and my site are now the same. I don't get the error anymore, and successfully retrieved email.

But it sounds like at least one person didn't get the OP's problem using gmail, so maybe that's not the only problem. Some other things to double-check...
-Username for the email account. It may need to be USERNAME@DOMAIN.COM, not just USERNAME
-Be sure the posting email has an account with sufficient privileges to post
-IMAP vs. POP. Make sure your port settings, etc. are consistent with what your mail provider allows

-Patricia

emilyf’s picture

I too am having this issue and have read every possible thread on the issue. Nothing has fixed the problem. I always get IMAP connection failed or POP3 connection failed errors. I can connect to my mailbox, just not with mailhandler. I am using a mail account on the same server as my drupal install. I have tried adding the /notls command. I am connecting with username@domain. No luck.

emilyf’s picture

Hmmm. Not sure what's going on, but I made another email account on the same domain, and that is working. Not sure exactly why that changed it, but nevertheless it worked. So before I tested that second account, or even set it up in mailhandler I did the following:
telnet into it from my DRUPAL machine (via ssh) -- for info on telnet to email account see here http://members.tripod.com/~smanage/tel.html
after that was successful I made sure to set up a user account in drupal with the same email address I would use for mailhandler. i gave this user authenticated status only.
set up mailhandler accordingly, with the /notls as an extra command

excellent!

bazmati’s picture

It does appear to be an issue with Gmail; or at least with port 995. I also get this problem with Gmail, but using another domain (via the standard non-SSL port 110) it works fine. A shame, as I'd much rather use Gmail.

mike stewart’s picture

Title: Mailhandler: Can't Open Stream...modules/mailhandler/mailhandler.module on line 29. » Mailhandler: Can't Open Stream
Version: 5.x-1.2 » 5.x-1.x-dev
Component: Code » Miscellaneous
Status: Active » Postponed (maintainer needs more info)

Quick checklist for gmail/google apps:

* POP is enabled in Gmail (login to your gmail account, go to settings > Forwarding & POP - then enable)
* If google apps (NOT gmail), make sure email account is working and that MX records have propagated and can be accessed by drupal server.
* Ensure port 995 is NOT blocked (some hosts block this by default. ask your host or try telnet, etc.)
* Mailhandler set for using POP (not IMAP)
* INBOX
* Extra commands: /ssl/novalidate-cert

after all this, and you receive the error "Invalid remote specification" check this out: http://drupal.org/node/64362

note: this was written (& tested) before gmail offered IMAP.

GNUMatrix’s picture

Title: Mailhandler: Can't Open Stream » Mailhandler: Can't Open Stream...modules/mailhandler/mailhandler.module on line 29.
Version: 5.x-1.x-dev » 5.x-1.2
Component: Miscellaneous » Code
Status: Postponed (maintainer needs more info) » Active

I'm a bit new around here, so forgive me if I've overlooked anything. Overall a great, if not critically important, module, but a few steps shy of perfect...

I finally got mailhandler installed (latest regular release, not the dev version) and after wrestling with the "can't open stream" error for awhile came up with what has worked for my situation, and some suggestions for others in future.

- I've got my setup running on Ubuntu (7.04) and had to install postfix and dovecot to get past just enabling the module. I can't speak for other distributions, but this needs to be highlighted a bit more someplace as I managed to completely overlook it if it was mentioned, and sending us to _anything_ in the php docs is a bit, well, less pleasant than a simple explanation of what was needed.

- As I was connecting via IMAP to the local IMAP server, none of this google stuff mattered, but I did need to put /notls as one of the flags as I didn't install the TLS stuff along with the postfix install.

- NO SPACES in the flags... Can spaces be stripped out automatically?? IE, I had entered "/notls" and the space was one of the problems.

- It would've saved some time if the imap_last_error() could've been displayed in addition to the "can't open stream" message as the last_error is very helpful information, not sure why it isn't provided? I added it to my install to test and it worked just fine, but I don't know how to add it in _properly_ much less contribute a patch or anything like that (yet...).

Overall, the /notls, without spaces, I think would've solved my initial problems but it took a long time to get around to figuring out where the problem was. I don't mind going through the PHP docs (that's where the "imap_last_error" info was from, after all) but its, well, a bit of a shock to land in there if you don't live and breath PHP. Going from the regular Drupal admin tasks to the PHP docs is like going from a nice glass of champagne to chewing on sand...

Thanks!

Street-1’s picture

I was having this issue while setting up using a Google Apps email account. Following mdrmike advise, specifically adding "/ssl/novalidate-cert" to extra commands, got me up and running.

mike stewart’s picture

so glad to hear #19 comment helped you out... i spent close to a week (on & off) troubleshooting.

fwiw, i changed my login from mdrmike to my real name

le_petit_basil’s picture

Title: Mailhandler: Can't Open Stream » Mailhandler: Can't Open Stream...modules/mailhandler/mailhandler.module on line 29.
Version: 5.x-1.x-dev » 5.x-1.2
Component: Miscellaneous » Code
Status: Postponed (maintainer needs more info) » Active

I've been tearing my hair out with this problem for the past 12 hours or so ... eventually I found a nice little note in the Dreamhost (clients web host) Support Wiki - [http://wiki.dreamhost.com/Drupal_Troubleshooting]

it says that I'm getting the

"warning: imap_open() [function.imap-open]: Couldn't open stream /home/mixislogistics/Maildir/ in /home/.mara/themixis/store.mixis.com/sites/all/modules/mailhandler/mailhandler.module on line 34"

error

"... because the imap_open extension is not included in the default PHP compiles offered by Dreamhost"

I imagine that the same sort of error would appear in any situation where the server wasn't compiled with the imap_open extension.
Its also unfortunate that Mailhandler relies on this extension to make connections to POP3 email as well as IMAP. There's no way around it shy of hacking the module, or changing the server situation, as far as I can see.

If I'm missing something, or if anyone knows a way already of hacking the mailhandler module to not rely on the imap_open extension for connections to POP3 email, please post it.

Danke.

moshe weitzman’s picture

Status: Active » Closed (works as designed)

the imap extension handles pop3 as well. it is poorly named. we don't just rely on it for fun.

jfranklin@citystatelabs.com’s picture

FYI, if you're on site5, try adding:

"/novalidate-cert"

to the extra commands. Fixed it fer me.

--Jake

jarea’s picture

The simple mistake that was causing it for me and might be holding some others up was that I had /notis with an 'i' instead of /notls with an 'l'.

Good luck.

jarea

SamRose’s picture

I was able to get working on Dreamhost as of today, with "/notls" using IMAP on port 143. Just in case anyone else is struggling. Apparently DH compiled imap_open into PHP...

wickwood’s picture

I'm also getting this error, and the posts here have been very helpful.

I have contacted my host (IXHosting) to get the ports open to interact with Gmail servers, and this was their response:

We could open 993, 995, 465, 587 ports for whole server for you. Please provide exact destination IP address for which ports should be open. Also please let us know which type on connection will be used (TCP or UDP).

This was my reply:

I'm not sure if I know the answers to these questions for you. At least not yet. Perhaps if you could tell me why you need this information, that will give me some direction in getting the answers for you.

I can tell you the drupal script uses PHP IMAP (which I've been told by chat tech support is available to me), and the
port 993 is to reach imap.gmail.com
port 995 is to reach pop.gmail.com
ports 465 or 587 are to reach smtp.gmail.com

Does anyone out there know really how to answer their question and why they are asking it? It doesn't make any sense to me, but then again I'm novice when it comes to some of this stuff.
I hope that answers your question enough to open these ports. If not, I will continue to look for more detailed answers.

Thanks in advance for you help!
Steve

hutch’s picture

Your provider is using a firewall and wants to restrict each port to one (or more) specific IP addresses.

I have looked up the IP addresses for you:

# dnsip imap.gmail.com
64.233.183.111 64.233.183.109

# dnsip pop.gmail.com
64.233.183.111 64.233.183.109

# dnsip smtp.gmail.com
64.233.183.111 64.233.183.109

So those are the ones in use by google at present, bear in mind that this might change ;-(
connection type is TCP

HTH

wickwood’s picture

Thanks Hutch.

Unfortunately, now they are telling me they (IXHosting) are telling me that will not open these ports for me. So I guess, I'm just SOL for using this module. I'm crying fowl, but I don't know if I'll get anywhere with them.

Steve

wickwood’s picture

Today, more than 72 hours after first requesting the required ports be opened to me for this, my host, IXHosting, has told me that they definitely will not open up these ports because

it is difficult to use mentioned above ports, cause it will be overloaded our server as result other customers will have difficults with using their accounts. Thus unfortunately mentioned above ports can not be opened.

So I guess now, I will start searching the forums for hosts people recommend for hosting their Drupal Sites.

Very Frustrating!

But thanks for help once again.

Viybel’s picture

Just wanted to share my findings, for those having root access on Linux.

If phpinfo() doesn't mention IMAP, you don't need to recompile PHP! Just do as follow:

1. Install IMAP : # sudo apt-get install php5-imap

2. Add IMAP on php.ini : # sudo dpkg-reconfigure php5-imap

3. Reload Apache (with no interruption, better than restart) : # sudo /etc/init.d/apache2 reload

If you're using php4, correct accordingly.

Cheers,

Vianney

jarea’s picture

I run several Drupal sites on eroute.net. They are very accomodating and have a good Linux environment for Drupal.

peterw’s picture

With imap, make sure that the extra command is /ssl and that the username includes @gmail.com.

sri261982’s picture

Priority: Normal » Critical

i am trying to retrieve mails from php code using gmail pop but it is showing error

Warning: imap_open() [function.imap-open]: Couldn't open stream {pop.gmail.com:995/pop3/ssl/novalidate-cert}INBOX in /var/www/subdomains/raja/httpdocs/raja_new/email/bounceback_class.emailtodb_raja_email.php on line 67

Notice: Unknown: Can't open mailbox {pop.gmail.com:995/pop3/ssl/novalidate-cert}INBOX: invalid remote specification (errflg=2) in Unknown on line 0

i tried all the above cases but no use please can any one help out

ratnesh aarohi’s picture

I too seem to get the same error though the line number referred is different - that is line 29
i ma trying to connect to my own site

warning: imap_open() [function.imap-open]: Couldn't open stream {http://www.mysite.com:110/pop3/notls/novalidate-cert}INBOX in /home/genie/public_html/modules/mailhandler/mailhandler.module on line 29.

tried diff commands also - no luck
any suggestions

rob0’s picture

Had problem with Mailhandler not being able to access my mailbox however **problem solved** by
1) reading through this thread (as it seems all our problems differ)
2) following the 'imap_open' link( http://php.net/imap_open ) in the Mailhandler/Add Mailbox configuration page itself under Extra Commands

The imap_open link gave insight to additional commands.
In my case, I am using a shared-hosting package where the name of the server is different to my mail server name so it presents a issue with validating the certificate (don't know the technical terms). So I added the command:

/novalidate-cert

in the extra commands field in Mailhandler configuration. This seems to solved the problem , at least at the 'Test Connection' phase of the set-up.

Now to see if it actually works when sending email...

rob0’s picture

Version: 5.x-1.2 » 6.x-1.0

Re: my post #37, ok so it does work, with a few further tweaks to the configuration. The post uploads with manual retrieve. Though even though it's set to HTML, the test picture did not show, but bold italics and underline did. This seems to be an issue with my drupal setup though (I think).

Not sure how to get the Cron going though. Is that another plugin or a server side set-up?

Now to work out how to be able to include images in drupal/mailhandler....

Gee, will I ever get time to actually USE this thing, or is it just about configuring and building (rhetorical question, no need for answers on this last point!)

peterh’s picture

in reply to #38: "

Not sure how to get the Cron going though. Is that another plugin or a server side set-up?"

use poormanscron:

http://drupal.org/project/poormanscron

peterh’s picture

this switch worked for me, at least in testing the connection.

/novalidate-cert/notls

note that there is no space between the commands as mentioned in previous posts.

in my setup I connect to an external IMAP mailserver.

Mailhandler configuration:

Folder: leave empty
Extra commands: /novalidate-cert/notls
Mime preference: HTML
Security:disabled
Cron processing: enabled

dadofgage’s picture

The settings listed in post #40 here worked for me as well - my site is hosted at Dreamhost.

smokinggoat’s picture

To re-iterate for POP testers - answer #37 fixed my problem.
To wit:
- I had a POP mail acct
- I was getting the imap_open error message
- I added /novalidate-cert
And it worked! (After I discovered that I forgot the leading slash...)

Now, like rob0 - to test the image functionality!

j0rd’s picture

I was able to get it working with Imap and Google Apps using

Host: imap.gmail.com
Port: 993
Options: /novalidate-cert/notls/ssl

No spaces!

Jean-Philippe Fleury’s picture

I marked the bug #406348: Couldn't open stream as a duplicate of this current report.

I had "Couldn't open stream" problems, and put /novalidate-cert/tls in Extra commands resolved the bug.

Frank Ralf’s picture

Just for the record.

You might use the test script in http://drupal.org/node/315779#comment-1069604 to test the e-mail function of your server/provider.

hth
Frank

SocialNicheGuru’s picture

warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/novalidate-cert/notls/ssl} in /drupal/sites/all/modules/mailhandler/mailhandler.module on line 193.

i had IMAP
/novalidate-cert/notls/ssl
port: 993

I am also testing this on a localhost

hiweed’s picture

Thanks to j0rd (comment #43)! This fixed my problem:

Host: imap.gmail.com
Port: 993
Options: /novalidate-cert/notls/ssl

finlaycm’s picture

Version: 6.x-1.0 » 6.x-1.7

I just installed mailhandler version 6.17 and I've been trying to set it up. All my efforts have been unsuccessful.

What I've been trying to acomplish is connect to my regular gmail account.
My settings are :

E-mail address: daniela@gmail.com
Second E-mail address:
Folder: INBOX
POP3 or IMAP Mailbox: IMAP
Mailbox domain: imap.gmail.com
Mailbox port: 993
Mailbox username: daniela@gmail.com
Mailbox password: yyyy
Extra commands: /notls (I've tried many different such us /novalidate-cert/notls/ssl, /ssl, none, /novalidate-cert/tls,/ssl/novalidate-cert,/novalidate-cert. Some of them fail immediately. Some other such as /notls or no command, take some time to fail)
Mime preference: HTML
Security: Disabled
Send error replies: Disabled
Cron processing: Disabled

The interesting thing is that when I try to connect to my email at work using imap, it works beautifully.
Any insight will be greatly appreciated.

Thank you.
Cristina

lunen33’s picture

#40 worked for me... added the /novalidate-cert/notls to the extra commands. Thanks!

SocialNicheGuru’s picture

has anyone gotten this to work on MAMP?

chrishaslam’s picture

I've been using mailhandler as part of open atrium (6.x-1.7) and it was failing to connect to an internal exchange 2007 server (using pop3 or IMAP)

I could manually telnet to host 110 / 143 and set it up to poll gmail remotely succesfully.

The only way I could get exchange 2007 to work was to add /notls as an extra command and it then worked fine

parrottvision’s picture

Same as chrisred #51 - I am using a VPS with Plesk, standard set up and all I needed to do was add /notls to extra commands and it worked great. I am also using Open Atrium with it. Thanks chrisred.

mwoodwar’s picture

I was hopeful using the gmail config in msg#40, but I got the following error message...any suggestions?

* warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/novalidate-cert/notls}INBOX in /home/mysite/public_html/intra.cfbusiness.com/sites/all/modules/contrib/mailhandler/mailhandler.module on line 193.
* IMAP connection to myname@gmail.com failed.

zapscribbles’s picture

I am having a similar problem using POP. When I click "Retrieve" in the mailbox setup screen mail is retrieved correctly and nodes are created (though the emails aren't deleted even though I have ticked the relevant setting)

However when cron runs it gives these errors (in the log)

imap_open() [<a href='function.imap-open'>function.imap-open</a>]: Couldn't open stream {NOTESSERVER:110/pop3}INBOX in D:\wamp\www\sites\all\modules\mailhandler\mailhandler.module on line 193.

imap_close(): supplied argument is not a valid imap resource in D:\wamp\www\sites\all\modules\mailhandler\mailhandler.retrieve.inc on line 621.

Why does it work when I do it manually but not when cron does it?

I am connecting to an internal Lotus Notes Domino server so issues surrounding Gmail shouldn't be affecting me here

toddgeist’s picture

I was having difficulty getting this to work on my google apps accounts. I kept getting the "can't open stream" error. After trying to connect using just imap_open, I discovered the real problem was this error:

Notice: Unknown: [ALERT] Web login required (Failure) (errflg=1) in Unknown on line 0

After some googling I found the answer. Google locks accounts if they are accessed to often or I think when they are new. You have to login to the web and to unlock it:

you may need to clear and unlock the CAPTCHA. To unlock CAPTCHA for Gmail account, go to the following URL:
https://www.google.com/accounts/DisplayUnlockCaptcha
Note: For Google Apps user, visit https://www.google.com/a/yourdomain.com/UnlockCaptcha instead, with yourdomain.com as the valid domain name.

I got this info here:
http://www.mydigitallife.info/2008/11/05/fix-gmail-imap-invalid-credenti...

I blogged about it here
http://bit.ly/UJVJj

Hope this helps!

crabcakes’s picture

Just wanted to comment:

If you're using AD/Exchange, make sure the username is DOMAIN\username

qaz1024’s picture

This bug could be the source of the problem:
http://bugs.php.net/bug.php?id=36496&edit=1

kiwibytes’s picture

This also fixed it for me. Thanks:)

arski’s picture

Version: 6.x-1.7 » 6.x-2.x-dev

Hey, did you all guys get this to work? I'm using a PHP 5.3.2 and can't seem to get this to work with gmail for the life of me.. I've probably tried every POP/IMAP configuration with every /novalidate-cert/notls/ssl etc command that was suggested here and am getting this same error all the time...

Trying this out on localhost, so there shouldn't be any port blockage issues here, besides my Thunderbird works great.. so...

Help?! :) THanks!

mike stewart’s picture

@arski - you say PHP 5.3.2 ... how is it compiled? be sure to read these posts/threads

http://drupal.org/node/125408#comment-522882

http://drupal.org/node/64362#comment-408199

arski’s picture

I've no idea :) through apt-get on Ubuntu ;) I'll take a look at those, thanks.

snovak’s picture

Using IMAP
port: 993
/ssl/novalidate-cert

I'm getting an unusual error. The first is progress.. the second.. well not so much.

Mailhandler was able to connect to the mailbox.
The settings have not been saved because of the errors.

webankit’s picture

My Settings on drupal 7
Folder:INBOX
Host:imap.gmail.com
Port:993
Extra-Commands:/ssl/novalidate-cert {tried other options also}

Could not make it work .. plz help

remedios’s picture

Hi,

I had this problem on Greengeeks. I had mailhandler checking an e-mail account hosted by the same server as the Web host.

For me, the error was fixed by listing "localhost" as the Mailbox Domain.

The settings that worked were:

E-mail address: USER@MYDOMAIN.org
Folder: INBOX
POP3
Mailbox Domain: localhost
Mailbox port: 110
Mailbox Username: USER@MYDOMAIN.org
Mailbox Password: PASSWORD
Extra commands: /novalidate-cert/tls
MIME Preference: HTML
Security: Require password
[etc]

My old settings were:

E-mail address: USER@MYDOMAIN.org
Folder: INBOX
POP3
Mailbox Domain: mail.MYDOMAIN.org
Mailbox port: 110
Mailbox Username: USER@MYDOMAIN.org
Mailbox Password: PASSWORD
Extra commands: /novalidate-cert/tls
MIME Preference: HTML
Security: Require password
[etc]

Danzki’s picture

How do I check if the right ports are open?

I have a web serve, and mysql server and a mail server, which i don't use (I use gmail).

Now in my world it should be the mySQL server who has the open port, right? Cause that is where the mailhandler is located. Or should it be the webserver? As far as I can see, only the mail server has 993 and 995 open, which i needed for gmail to work. Not the web or the mysql server.

Is that what could be stopping me?

CMangrum’s picture

This was working for me with the recommended settings using a Google Apps account up until the first week of April 2011. I am wondering if this has anything to do with Apps accounts being transitioned into the gmail fold? Anyhow, I just today realized that messages have not been picked up by mailhandler since April 9. Settings that used to work fine (email/user intentionally changed):

E-mail address: user@domain.com
Folder: INBOX
POP3 or IMAP Mailbox: POP3
Mailbox domain: pop.gmail.com
Mailbox port: 995
Mailbox username: user@domain.com
Mailbox password: *****
Extra commands: /ssl/novalidate-cert
MIME preference: Plain text
Security: Disabled
Send error replies: Disabled
From header:
Default commands: taxonomy: [Category]
Signature separator: --
Delete messages after they are processed? TRUE
Cron processing: Enabled
Select disable to temporarily stop cron processing for this mailbox.
Input format: Filtered HTML
Message authentication method: Mailhandler Default

Now results in (domain info intentionally changed):

imap_open() [function.imap-open]: Couldn't open stream {pop.gmail.com:995/pop3/ssl}INBOX in /home/username/public_html/sites/domain.com/modules/mailhandler/mailhandler.retrieve.inc on line 19.

I have tried changing the options to /ssl, /ssl/notls, /ssl/noverify-cert/notls, /noverify-cert/notls, etc. and still cannot get it to work. I am using JustHost as my ISP and only connect for incoming mail (no smtp). Any more ideas?

wastrilith2k’s picture

@CMangrum

Your settings seem to work for me except I'm using imap so I have imap.gmail.com and use port 993.

James

ghmercado’s picture

#64 worked for me, am on hostgator shared.

tobedeleted’s picture

I'm seeing the same issue as #66 CMagngrum on one of my sites. Mailhandler has been working flawlessly for over a year, and in early July it started to fail with the exact same error message. As none of my settings have altered I can only assume it is either down to my host or Gmail.

Yuri’s picture

Priority: Critical » Major
Status: Closed (works as designed) » Active

Drupal 7.8
Folder:INBOX
Host:imap.gmail.com
Port:993
Extra-Commands:/ssl/novalidate-cert (also tried /ssl)

Error log:

Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.google.com:993/ssl/novalidate-cert}Inbox in mailhandler_open_mailbox() (line 17 of /home/seosite/public_html/sites/all/modules/mailhandler/mailhandler.retrieve.inc).

Can one of the maintainers please check out the Gmail IMAP connection through a Drupal 7 Mailhandler installation, and report here if the instructions as mentioned on the Mailhandler documentation page http://drupal.org/node/207366 are valid and working.
Anyone else also with a working Drupal 7 Mailhandler Gmail IMAP connection, please post here that it works for you or not.

Just checking if i'm not misguided by the current documentation.

Yuri’s picture

Status: Closed (works as designed) » Active

Ok, I hereby confirm that I successfully established an IMAP connection with Gmail. WOOHOOO!
It was indeed port 993 that was still closed.
Two people had tested the server port 993 with telnet with the following result:

Both of these are open on your server. Here are the listings from a netstat command.
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 13855/dovecot 
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 13855/dovecot 

But verifying the ports on another way revealed that they actually were closed.
So the conlcusion is: TEST YOUR PORTS IN MULTIPLE WAYS to be sure that they are open.

And yes, the connection data as mentioned in the Mailhandler documentation is still right, so:
Folder: Inbox
Pop3 or IMAP Mailbox: IMAP
Mailbox domain: imap.gmail.com
Mailbox port: 993
Mailbox username: your gmail address
Mailbox password: your gmail password
Extra commands: /ssl
Mime preference: HTML

Have a nice weekend!

Yuri’s picture

Status: Active » Closed (works as designed)
snlnz’s picture

Status: Active » Closed (works as designed)

Just thought I'd share my experience after failing to get this working for a couple of hours.
I wasn't able to connect from Atrium to gmail using google apps, no matter what combination of settings in the module.

By default The latest Atrium-1.0 release has mailhanlder 6.x-1 branch pre loaded so I simply downloaded the 6.x-2 branch and it all worked. Was pulling my hear out. This post by moshe http://drupal.org/node/77984 gave me the idea.

Then everything just worked!

flatfeat’s picture

Component: Code » Mailhandler

I found that changing the "Domain" to localhost, as per #64, worked for me to connect to a Hostgator VPS. It was also necessary to put "/notls" in the "Extra commands" section. The username is the email address of the box you want to connect to (example@yourdomain.com) and the port was set to 143 using IMAP. Hope that helps someone in the future.

s33’s picture

Issue summary: View changes

This is the error I got, no matter I use POP3 or IMAP:
"Unable to connect to mail. Please check the connection settings for this mailbox."
Thanks!

s33’s picture

My seeting:

Folder: Inbox
Pop3 or IMAP Mailbox: IMAP
Mailbox domain: imap.gmail.com
Mailbox port: 993 (or 143 both tried)
Mailbox username: your gmail address
Mailbox password: your gmail password
Extra commands: /ssl (and /notls tried too)
Mime preference: HTML

Thank you!