Project

General

Profile

Retrieving email fails into Redmine: Rake Aborted- A connection attempt failed [...]

Added by Systems Group about 12 years ago

Hi Everyone,
Looking for a little assistance or at least a point in the right direction. We have been successfully using a scheduled task batch file to pull in emails from an Exchange mailbox into Redmine. After recently restarting and patching the server this is no longer working properly. I've verified the Exchange environment internal SMTP open relay is still working and Rx/Tx of messages can still occur from the Redmine server. The credentials for the account is still working and emails exist waiting to be brought into Redmine. Unfortunately, we are a little unfamiliar with what could be going wrong within Redmine and were hoping for some guidance. Detailed information below

Batch File:

@echo Redmine init
CALL C:\PROGRA~1\BITNAM~1\scripts\setenv.bat" 
if not exist "%USERPROFILE%\BitNami Redmine Stack projects" mkdir "%USERPROFILE%\BitNami Redmine Stack projects" 
cd "C:\Program Files\BitNami Redmine Stack\apps\redmine\" 

echo Fetch general Redmine mails
rem call "C:\Program Files\BitNami Redmine Stack\ruby\bin\rake" %1 redmine:email:receive_imap RAILS_ENV="production" host=email.[REMOVED].com username=[REMOVED] password=[REMOVED]project=appdataservices tracker=Task allow_override=project,tracker,status,priority,assignto,category,'it project',start,'due date',estimatedhours,'rt number',watchers unknown_user=accept --trace
rem call "C:\Program Files\BitNami Redmine Stack\ruby\bin\rake" %1 redmine:email:receive_imap RAILS_ENV="production" host=email.[REMOVED].com username=[REMOVED] password=[REMOVED]project=appdataservices tracker=Task unknown_user=accept --trace

call "C:\Program Files\BitNami Redmine Stack\ruby\bin\rake" %1 redmine:email:receive_imap RAILS_ENV="production" host=email.[REMOVED].com username=[REMOVED] password=[REMOVED] project=appdataservices tracker=Task allow_override=project,tracker,status,priority,assignto,category,start,estimatedhours,watchers unknown_user=accept --trace

Results:


Redmine init
Fetch general Redmine mails
(in C:/Program Files/BitNami Redmine Stack/apps/redmine)
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
A connection attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because connected host
has failed to respond. - connect(2)

C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/1.8/net/imap.rb:888:in `initialize'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/1.8/net/imap.rb:888:in `open'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/1.8/net/imap.rb:888:in `initialize'
C:/Program Files/BitNami Redmine Stack/apps/redmine/lib/redmine/imap.rb:29:in `new'
C:/Program Files/BitNami Redmine Stack/apps/redmine/lib/redmine/imap.rb:29:in `check'
C:/Program Files/BitNami Redmine Stack/apps/redmine/lib/tasks/email.rake:133
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Program Files/BitNami Redmine Stack/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/Program Files/BitNami Redmine Stack/ruby/bin/rake:19:in `load'
C:/Program Files/BitNami Redmine Stack/ruby/bin/rake:19

Config/email.yml:


# Outgoing email settings

production:
  delivery_method: :smtp
  smtp_settings:
    address: [REMOVED]
    port: 25
    domain: coaccess.com  
    authentication: :none
    user_name: 
    password: 

development:
  delivery_method: :smtp
  smtp_settings:
    address: [REMOVED]
    port: 25
    domain: coaccess.com 
    authentication: :none
    user_name: 
    password:

Thanks Everyone!


Replies (2)

RE: Retrieving email fails into Redmine: Rake Aborted- A connection attempt failed [...] - Added by William Roush about 12 years ago

Outgoing mail works right? Config at the bottom is for outgoing mail (SMTP), stuff at the top is incoming (IMAP), these are completely separate from each other...

The Redmine task "redmine:email:receive_imap" is for incoming mail, confirm that you have IMAP enabled on the Exchange box (usually locked down to IMAPS [I had this issue]! So you may need to use "SSL=1 PORT=993" (may want to confirm with the docs if that doesn't work)), depending on company policy if you're having issues with IMAPS (I forget what Redmine will do with self-signed certs and the like) you can disable the requirement for SSL traffic and let it go unencrypted, but I'd try to avoid that just because it's poor practice. That will however have to be done on Exchange.

Best bet when working on this is to also hook up Outlook/Thunderbird/Any IMAP client to the box while you're testing, to make sure it's not a configuration issue and is a problem with Redmine communicating with the IMAP server (for whatever reason).

I believe when you're done testing, you'll have to mark mail as "unread" again for Redmine to pick it up.

RE: Retrieving email fails into Redmine: Rake Aborted- A connection attempt failed [...] - Added by Systems Group about 12 years ago

Hi Will,
Thank you very much for your reply it was certainly helpful. After troubleshooting a bit this morning I was able to get the process working again. In case anyone else in the future runs into a similar problem these were the basic steps I went through to pinpoint the issue:


 -Verify Mailbox is still IMAP enabled in Exchange 
   - Result: Still IMAP4 enabled on the needed mailbox
 -Verify the Exchange Client Access Server 
   - Result: Exchange CAS Hubs are still IMAP enabled (EMC- Server Configuration-> Client Access->POP/IMAP) 
 -Test IMAP Port from Redmine Server (Command Prompt: Telnet [Exchange Server Hostname] 143]
   - Result: Failed to Connect
 -Test IMAP Port from separate system
   - Result: Command Prompt Shows: "* OK The Microsoft Exchange IMAP4 service is ready." 
 -Same test after Adding a TCP Inbound/Outbound Allow Firewall rule for ports 993/143 on Redmine Server
   - Result: Still failed (Not a Firewall Issue)
 -Tested General Network Connectivity to LAN, WAN and Internet
   - Result: Successful tests to all attempted areas
 -Verify NIC settings (IP, Driver Settings, etc.)
   - Result: Settings are correct, but when Validating on Exiting, total network connection loss *Interesting!
 -Powered down VMWare ESX System and investigated the presented Virtual NIC
   - Result: Found issue with Network Label Group in use.
 -Unchecked 'Connect at Power On', let boot normally, restarted with setting changed back
   - Result: Everything is working normally again! 


For us it turned out to be an issue with the VMWare ESX presented NIC, but hopefully my steps will aid someone else in there troubleshooting efforts as well. No change needed to our scripts or Redmine environment. Thanks again

    (1-2/2)