kontron / redmine_oauth

Redmine authentication through OAuth.
GNU General Public License v2.0
57 stars 27 forks source link

Issue with setting up imap reading #6

Closed Godfatherbobo closed 1 year ago

Godfatherbobo commented 1 year ago

Hello!

I'm sorry if this is a stupid issue this isn't my area of expertise. I have setup the plugin and i just want to read and import emails using imap with oauth.

I'm getting a print out in the logs of : "Both uri are relative" and I'm not sure where to go from here to fix it. I followed the guides in the setup documentation but I'm not sure where I went wrong.

Im using rufus scheduler method here is what i have in the initializer for it.


require 'rubygems'
require 'rake'
require 'rufus-scheduler'

load File.join(Rails.root, 'Rakefile')

ENV['host']='outlook.office365.com'
ENV['port']='993'
ENV['scope']='https://outlook.office365.com/.default'
ENV['ssl']='Yes'
ENV['username']='myuseremail'
ENV['folder']='inbox'
ENV['move_on_success']='Success'

scheduler = Rufus::Scheduler.new
# Check emails every 15 seconds
scheduler.every('15') do
  task = Rake.application['redmine_oauth:email:receive_imap']
  task.reenable
  task.invoke
end

Any help you can offer would be amazing!

picman commented 1 year ago

Hard to say.

  1. Omit the default environmental variables. You need just two.
  2. Post the output and production.log
    ENV['username']='myuseremail'
    ENV['move_on_success']='Success'
Godfatherbobo commented 1 year ago

Output when running

$ sudo rake redmine_oauth:email:receive_imap RAILS_ENV="production" username=bluemine@domain.net                                                                 /usr/lib/x86_64-linux-gnu/ruby/2.7.0/strscan.so: warning: already initialized constant StringScanner::Version
/usr/lib/x86_64-linux-gnu/ruby/2.7.0/strscan.so: warning: already initialized constant StringScanner::Id
both URI are relative
both URI are relative

I cleared production.log and ran the rake as above and this was what was generated in the log

[2023-01-13T12:48:23.061689 #2717401] WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.

Thanks in advance.

picman commented 1 year ago

Do you have set the Host name an path and Protocol in Administration -> Settings -> General? Is the entered URL valid?

Godfatherbobo commented 1 year ago

It is yes, its the primary domain for our instance.

picman commented 1 year ago

I have no idea what could be wrong. What is your OS, Redmine, Rails and Ruby versions?

picman commented 1 year ago

No feedback. Probably something wrong with installed libraries. Can't be fixed in the plugin.