Troubleshooting retrieving emails via IMAP from GMAIL account
Added by Michael Wehrle about 16 years ago
Hi,
apologies in advance should I have missed a previous discussion of this - but I couldn'd find any.
I am trying to test the creation of tickets via email.
I am following the documentation at http://www.redmine.org/wiki/redmine/RedmineReceivingEmails with the "Fetching emails from an IMAP server" option.
When I run the rake task:
rake redmine:email:receive_imap RAILS_ENV="production" host:imap.gmail.com port=993 ssl=1 username=xxx@gmail.com password=xxx --trace
(in /home/www/support/web)
- Invoke redmine:email:receive_imap (first_time)
- Invoke environment (first_time)
- Execute environment
- Execute redmine:email:receive_imap
rake aborted!
Connection refused - connect(2)
/usr/lib/ruby/1.8/net/imap.rb:886:in `initialize'
/usr/lib/ruby/1.8/net/imap.rb:886:in `open'
/usr/lib/ruby/1.8/net/imap.rb:886:in `initialize'
/home/www/support/web/lib/redmine/imap.rb:29:in `new'
/home/www/support/web/lib/redmine/imap.rb:29:in `check'
/home/www/support/web/lib/tasks/email.rake:102
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:16:in `load'
/usr/bin/rake:16
- redmine latest trunk (as of 2008-10-14)
- rails 2.1.1
- ruby 1.8.6
Could you help me out better troubleshoot what the problem might be?
and I am sure I have the password and user name right.....
Thank you!!
Replies (16)
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Thomas Lecavelier about 16 years ago
The error message is explicit: you can't connect to remote host. I see in your line that you wrote "host:" instead of "host=". You should check this.
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Michael Wehrle about 16 years ago
I'll be damned.....
appreciate your eagle's eyes.
I am glad to report that the following now works wonderfully:
rake redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com port=993 ssl=1 username=joe@example.net password=secret folder=Support
with the above configuration.
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by karthikeyan rangaswamy over 15 years ago
I Think The above rake command Reads the email from My gmail account But Its not creating issues in my redmine account.
I assume that it reads the email because once i execute the rake command and refreshes my gmail the particular mail goes from Unread state to read state.So what may be the issue why its not creating issue in my redmine.Whether any files need to be modified in My redmine application
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by karthikeyan rangaswamy over 15 years ago
I Executed this rake command
rake redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com port=993 ssl=1 username=joe@example.net password=secret folder=Support
I am Creating New issue in my redmine account By Sending an Issue to My Gmail ID.
My email is of following format
project: charityportal1
tracker: Tasks
category:function
priority: Low
status: Open
subject: Redmine Document
description:Analyse the redmine documents from redmine website
Where charityportal1 is the identifier of the project.
I Tried printing the values of each fields in Receive_issue method in mail_handler.rb file.I am able to receive Project,user,tracker,status,subject description values.But i am not able to get the values of Priority and category values eventhough i pass those values.I Tried changing the format of the email by placing the priority in first,last and middle But still i am not able to receive that parameters
In the model issue.rb there is a code
validates_presence_of :subject, :description, :priority, :project, :tracker, :author, :status
which says that priority is mandatory field.So i cannot create issue without receiving the value for priority parameter.
Could U please specify the format of the email(THAT IS In which order i need to pass all the parameters so that
i can retrieve all the values in receive_issue method of mail_handler.rb) so that i can create issue successfully
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by karthikeyan rangaswamy over 15 years ago
I Have Tried to Print all the values i am Passing from my email account.I am able to receive all the values that i pass from my email .But the issue.save code in receive_issue method always returns false.The issue is not getting added in the database.I also tried commenting the model validations but still i am not able to create the issue as
issue.save code always returns false
I also Tried checking issue.errors but its not printing any errors so think there is no model validations restricting the issue from saving it.So i dont know why the issue is not getting saved
Please guide me in this issue
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Sergi de Pablos over 15 years ago
Same problem here, karthikeyan. I've even tried to close an open ticket via email, and the email is processed, but only added as a comment to the ticket. There's no way to close the ticket sending the Status value. Maybe is something related to the language, cause my installation is in Spanish and the Status values are in Spanish even if I change the interface to English.
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by karthikeyan rangaswamy over 15 years ago
rake redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com port=993 ssl=1 username=joe@example.net password=secret project=projectname tracker=trackername status=statusavailable priority=priorityname allow_override=project,status,tracker,priority
This is the rake task u need to run to create issues by email
host=imap.gmail.com=host address
port=993 imap port of your mail server(by default it will be 993.Otherwise check ur system administrator)
ssl=1
username=give ur username for your mail account
password=password for ur mail account
project=pass the project identifier(This is the project where u want to create issue)
(Remember pass only the project identifier.Dont pass the project name as the code is written only to retrieve the project identifier)
status=give the status value alloocated to the project(Open,assigned)
tracker=Give the tracker set of the project
priority=give the priority for the project
Now You can test by sending an email to the email address mentioned in the rake task in this case joe@example.net(If you have configured your personal mail address then you can send mail to your personal mail address) and execute the rake task
The issue will be created on the corresponding project
With Tracker,status,priority values are taken from the parameters passed from the rake task .Your email subject will be stored as issue subject.Your email body will be stored as issue description)
The persmission will also be checked.There is no need for code modifications(Whether the user is eligible for creating issues on this project)
Remember one thing,In this case there should not be any project custom fields as mandatory fields.otherwise issue creation will email
Incase of any issues with this code just mail me
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Maik Derstappen over 15 years ago
helo,
i have also the problem, that no tickets are created on ingoing emails.
My redmine is in german so the names of Status and so on are different but i try some variants and nothing works. Is there a log where i can see what happen?
this is what im doing:
rake -f /opt/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=mail.example.de username=support@example.de password=secret project=support tracker=Unterstützung status=Neu priority=Normal allow_override=project,status,tracker,priority --trace
thx for any tip
regards maik
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Eric Davis over 15 years ago
Maik Derstappen wrote:
i have also the problem, that no tickets are created on ingoing emails.
My redmine is in german so the names of Status and so on are different but i try some variants and nothing works. Is there a log where i can see what happen?
Check log/production.log
and your IMAP server's logfile. Redmine will only read email that is marked NEW. UNREAD email is skipped.
Eric Davis
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Michael J about 14 years ago
I'm getting the same timeout message as the original poster, but I'm sure I've provided the right host and login information. Does anyone know what else could cause this error? I really want to be able to add issues in Redmine via email. Here's my command and the --trace output:
-bash-3.2$ rake -f /home/pmparal/public_html/redmine-1.0.2/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=mail.host.net port=993 ssl=1 username=username password=password folder=cjdg project=cjdg tracker=Support priority=Normal status=New allow_override=project,status,tracker,priority --trace (in /home/pmparal) ** Invoke redmine:email:receive_imap (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute redmine:email:receive_imap rake aborted! Connection timed out - connect(2) /usr/lib/ruby/1.8/net/imap.rb:888:in `initialize' /usr/lib/ruby/1.8/net/imap.rb:888:in `open' /usr/lib/ruby/1.8/net/imap.rb:888:in `initialize' /home/pmparal/public_html/redmine-1.0.2/lib/redmine/imap.rb:29:in `new' /home/pmparal/public_html/redmine-1.0.2/lib/redmine/imap.rb:29:in `check' /home/pmparal/public_html/redmine-1.0.2/lib/tasks/email.rake:133 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load' /usr/bin/rake:19
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Felix Schäfer about 14 years ago
Michael Johngren wrote:
Connection timed out - connect(2)
That tells you that the other end isn't responding, so you have either networking problems (firewall, routing, whatever) or a configuration problem (wrong port or host).
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Michael J about 14 years ago
Is there a certain firewall port that needs to be open on the sending side (where Redmine sits, trying to connect to the IMAP server)? I'm sure the IMAP side is fine, I've been using it for a long time.
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Felix Schäfer about 14 years ago
Michael J wrote:
Is there a certain firewall port that needs to be open on the sending side (where Redmine sits, trying to connect to the IMAP server)? I'm sure the IMAP side is fine, I've been using it for a long time.
Well, redmine obviously need to be able to connect the mailhost, in that case the connection from the redmine host to the imap host on port 993 needs to be possible, you could test that by trying telnet your.mail.host 993
, if that fails with a connection error, you probably have a firewall somewhere.
Another thing that came to mind: does your mailhost use SSL or TLS? TLS needs some extra configuration IIRC.
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Michael J about 14 years ago
I fixed the issue. I opened port 993 for outgoing traffic on the Redmine server. The outgoing ports were very restricted on my hosted VPS. Very cool!
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Michael J about 14 years ago
Thanks for you help Felix.
RE: Troubleshooting retrieving emails via IMAP from GMAIL account - Added by Julio Lima about 12 years ago
What about if you have SSL and TLS authentications in the IMAP?
Thanks,