Project

General

Profile

Rake email:receive_imap urgently needs your help guys

Added by Niklas Larsson over 8 years ago

My Redmine installation has been up and running flawlessly for a couple of years now until a couple of weeks ago when we had to change our public IP, and after that the fetching of emails from our mailserver have stopped.

We have the Bitnami Redmine and have a Cronjob executing the following:

CALL "C:\PROGRA~1\BITNAM~1\scripts\setenv.bat"
cd "C:\PROGRA~1\BITNAM~1/apps/redmine/htdocs"

CALL rake redmine:email:receive_imap RAILS_ENV="production" host=mail.domainname.com port=143 username= password=xxxxxx project=Osorterat tracker=Support unknown_user=create allow_override=project,tracker,priority

With the --trace parameter it looks like this:
  • Invoke redmine:email:receive_imap <first_time>
  • Invoke environment <first_time>
  • Execute environment
    Here comes a pause for 5-6 seconds
  • Execute redmine:email:receive_imap

Here it ends without any more info, but no mail is fetched. The server has a Telnet connection with the mailserver

Can you help me please?


Replies (9)

RE: Rake email:receive_imap urgently needs your help guys - Added by Pavel Potcheptsov over 8 years ago

You might need to test IMAP connectivity to mailserver closer.
Not just executing "telnet mailserver port" but login, list, fetch, etc.

RE: Rake email:receive_imap urgently needs your help guys - Added by Niklas Larsson over 8 years ago

Just installed Thunderbird on server and connected with IMAP, it worked fine. So the server definatly have connection with the applicationserver. Also the mailserver log the Redmine attempt but state : Socket connection closed by the other side (how rude!)

The complete log looks like this:
Wed 2015-08-26 00:03:25.624: Session 015550; child 0030
Wed 2015-08-26 00:03:25.624: Accepting IMAP connection from xx.xx.xx.xx:51186 to xxx.xx.xx.xx:143
Wed 2015-08-26 00:03:25.625: --> * OK mail.domainxxx.se IMAP4rev1 MDaemon 15.0.3 ready
Wed 2015-08-26 00:03:25.942: <-- RUBY0001 LOGIN **
Wed 2015-08-26 00:03:25.948: --> RUBY0001 OK LOGIN completed
Wed 2015-08-26 00:03:26.172: <-- RUBY0002 SELECT INBOX
Wed 2015-08-26 00:03:26.176: --> * FLAGS (\Seen \Answered \Flagged \Deleted \Draft \Recent $Forwarded $MDNSent)
Wed 2015-08-26 00:03:26.176: --> * 12 EXISTS
Wed 2015-08-26 00:03:26.176: --> * 0 RECENT
Wed 2015-08-26 00:03:26.176: --> * OK [UIDVALIDITY 1350913558] UIDs valid
Wed 2015-08-26 00:03:26.176: --> * OK [UIDNEXT 1577] Predicted next UID
Wed 2015-08-26 00:03:26.176: --> * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $Forwarded $MDNSent)] .
Wed 2015-08-26 00:03:26.176: --> RUBY0002 OK [READ-WRITE] SELECT completed
Wed 2015-08-26 00:03:26.403: <-- RUBY0003 SEARCH NOT SEEN
Wed 2015-08-26 00:03:26.403: --> * SEARCH
Wed 2015-08-26 00:03:26.403: --> RUBY0003 OK SEARCH completed
Wed 2015-08-26 00:03:26.624: <-- RUBY0004 EXPUNGE
Wed 2015-08-26 00:03:26.624: --> RUBY0004 OK EXPUNGE completed
Wed 2015-08-26 00:03:26.664: Socket connection closed by the other side (how rude!)
Wed 2015-08-26 00:03:26.664: IMAP session terminated, (Bytes in/out: 120/481)

RE: Rake email:receive_imap urgently needs your help guys - Added by Pavel Potcheptsov over 8 years ago

You don't have new mails, don't you?
Send mail to this account and then execute receive_imap task.
What would MDaemon's log report in this case?

RE: Rake email:receive_imap urgently needs your help guys - Added by Niklas Larsson over 8 years ago

Well, I tried again now with 6 confirmed unread mails, it really looks like the mail gets fetched. But nothing happens in Redmine so it seems like have looked in the wrong place. So how can i troubleshoot Redmine? Why isnt any tickets create?

BTW thanks for taking ypur time helpig me! Much appreciated

Wed 2015-08-26 16:15:23.979: Session 022246; child 0071
Wed 2015-08-26 16:15:23.979: Accepting IMAP connection from xx.xx.xxx.xx:65062 to xx.xx.xx.xx:143
Wed 2015-08-26 16:15:23.982: --> * OK mail.xxx.xx IMAP4rev1 MDaemon 15.0.3 ready
Wed 2015-08-26 16:15:24.296: <-- RUBY0001 LOGIN **
Wed 2015-08-26 16:15:24.398: --> RUBY0001 OK LOGIN completed
Wed 2015-08-26 16:15:24.616: <-- RUBY0002 SELECT INBOX
Wed 2015-08-26 16:15:24.617: --> * FLAGS (\Seen \Answered \Flagged \Deleted \Draft \Recent $Forwarded $MDNSent)
Wed 2015-08-26 16:15:24.617: --> * 8 EXISTS
Wed 2015-08-26 16:15:24.617: --> * 0 RECENT
Wed 2015-08-26 16:15:24.617: --> * OK [UNSEEN 6] first unseen
Wed 2015-08-26 16:15:24.617: --> * OK [UIDVALIDITY 1350913558] UIDs valid
Wed 2015-08-26 16:15:24.617: --> * OK [UIDNEXT 1586] Predicted next UID
Wed 2015-08-26 16:15:24.617: --> * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $Forwarded $MDNSent)] .
Wed 2015-08-26 16:15:24.617: --> RUBY0002 OK [READ-WRITE] SELECT completed
Wed 2015-08-26 16:15:24.836: <-- RUBY0003 SEARCH NOT SEEN
Wed 2015-08-26 16:15:24.836: --> * SEARCH 6
Wed 2015-08-26 16:15:24.836: --> RUBY0003 OK SEARCH completed
Wed 2015-08-26 16:15:25.056: <-- RUBY0004 FETCH 6 RFC822
Wed 2015-08-26 16:15:25.056: Sending FETCH response (not logged)...
Wed 2015-08-26 16:15:25.058: --> RUBY0004 OK FETCH completed
Wed 2015-08-26 16:15:27.721: <-- RUBY0005 STORE 6 +FLAGS (\Seen)
Wed 2015-08-26 16:15:27.721: --> RUBY0005 OK STORE completed
Wed 2015-08-26 16:15:27.942: <-- RUBY0006 EXPUNGE
Wed 2015-08-26 16:15:27.942: --> RUBY0006 OK EXPUNGE completed
Wed 2015-08-26 16:15:27.986: Socket connection closed by the other side (how rude!)
Wed 2015-08-26 16:15:27.986: IMAP session terminated, (Bytes in/out: 178/19883)
Wed 2015-08-26 16:15:27.987: ----------

RE: Rake email:receive_imap urgently needs your help guys - Added by Pavel Potcheptsov over 8 years ago

What is redmine version?
Any hints in production.log?
Did you change permission for roles?

RE: Rake email:receive_imap urgently needs your help guys - Added by Niklas Larsson over 8 years ago

Pavel: Where do i find the production log?

I have not change any permissions

Environment:
Redmine version 2.1.2.stable
Ruby version 1.8.7 (i386-mingw32)
Rails version 3.2.8
Environment production
Database adapter Mysql2
Redmine plugins:
no plugin installed

RE: Rake email:receive_imap urgently needs your help guys - Added by Pavel Potcheptsov over 8 years ago

Maybe here:
C:\PROGRA~1\BITNAM~1/apps/redmine/htdocs/logs/

RE: Rake email:receive_imap urgently needs your help guys - Added by Niklas Larsson over 8 years ago

This is what the log displays when i run my rake script:

Connecting to database specified by database.yml
OpenIdAuthentication.store is nil. Using in-memory store.
Connecting to database specified by database.yml
Connecting to database specified by database.yml
OpenIdAuthentication.store is nil. Using in-memory store.
OpenIdAuthentication.store is nil. Using in-memory store.

RE: Rake email:receive_imap urgently needs your help guys - Added by Pavel Potcheptsov over 8 years ago

Set log level to debug in ./config/additional_environment.rb
Check the next:

Permissions have to be consistent with the chosen option. E.g. if you choose 'create', the 'Non member' role must have the 'Add issues' permission so that an issue can be created by an unknown user via email. If you choose 'accept', the 'Anonymous' role must have this permission.

Try to add no_permission_check=1 and -f /path/to/redmine/appdir/Rakefile and change unknown_user to accept to rake command so it looks like:

rake -f C:\PROGRA~1\BITNAM~1\apps\redmine\htdocs\Rakefile redmine:email:receive_imap RAILS_ENV="production" host=mail.domainname.com port=143 username=xxx@domainname.com password=xxxxxx project=Osorterat tracker=Support unknown_user=accept no-permission-check=1 allow_override=project,tracker,priority

    (1-9/9)