Defect #4228
closed
no notification on issue creation by mail with redmine:email:receive_imap
Added by Jérôme Bousquié over 15 years ago.
Updated about 14 years ago.
Category:
Email notifications
Description
Hello,
I have Redmine 0.8.7 running on ubuntu 8.40 with Rails 2.3.4 , ruby 1.8.6, mysql and apache/phusion.
Redmine sends and receives mails without any problem. It is set up to create issues via email and this functionality runs well too. It's configured as an imap client.
My problem is :
given an user (authorized to submit issues to my project), email notifications are sent to the project members (they are set up to be notified) if this user creates an issue in the web interface. If the same user sends a mail to create an issue, the issue is created well but no notification are sent to the project members (even if there is an automatic assignation by category on this issue).
On issue creation, the notification seems not to be working with the rake redmine:email:receive_imap (set up with async_imap).
Nothing is visible in the log about some email sending after having commented the paramater config.action_mailer.logger = nil in the configuration.
I remember I used to use rdm-mailhandler in my previous organisation and it used to notify the project members on email issue creation. I just tested it on https://projets-lim.univ-reunion.fr/
Any idea ? does rake redmine:email:receive_imap and rdm-mailhandler behave differently about the issue management ?
thank you
Files
- Category set to Email notifications
Hello,
On the same deployment (https://projets.iut-rodez.fr/), I set up redmine to receive emails via postfix and the project members are now notified, even on mail issue submission. So the notification behavior really differs on email issue creation between imap et postfix processes.
regards
Any idea ? does rake redmine:email:receive_imap and rdm-mailhandler behave differently about the issue management ?
Emails submitted by the rake task and rdm-mailhandler are both processed by MailHandler class.
So behaviour should be the same.
How can I reproduce this problem?
Hello,
There are no any calls to notification mechanism when creating issues from email. Issues are created using the following code (see app/models/mail_handler.rb:
issue = Issue.new(:author => user, :project => project, :tracker => tracker, :category => category, :priority => priority, :due_date => due_date, :start_date => start_date, :assigned_to => assigned_to)
...
issue.save!
add_attachments(issue)
So, the possible solution is to add something like the following after saving the issue:
Mailer.deliver_issue_add(issue) if Setting.notified_events.include?('issue_added')
+1. We have the same problem :( Jean, do you need any help with this? Steps to reproduce or any?..
How can I add any log-file which can show you the problem and steps to reproduce?
Same problem, issues received by email doesn't generate notifications.
Redmine 1.1.1 from svn revision 4802, running on Debian 6.0, ruby 1.8.7, rails 2.3.5, mysql and apache/passanger.
I don't know how reproduce this problem, but I want help as I can.
You could change logging level to get some debug trace from Redmine::IMAP
and MailHandler
?
In config/environments/production.rb
:
...
# Disable delivery errors if you bad email addresses should just be ignored
config.action_mailer.raise_delivery_errors = true
# No email in production log
# config.action_mailer.logger = nil
config.log_level = :debug
Turning on debug log level showed NOTHING about this problem.
The unit test mail_handler_test.rb showing only one failure:
# ruby test/unit/mail_handler_test.rb -v
...
Finished in 3.345716 seconds.
1) Failure:
test_add_issue_should_send_email_notification(MailHandlerTest) [test/unit/mail_handler_test.rb:295]:
<1> expected but was
<2>.
35 tests, 182 assertions, 1 failures, 0 errors
What this mean?
Could you please add the followinng lines before assert_equal
to source:trunk/test/unit/mail_handler_test.rb#L295 and run the test again ?
logger.info ActionMailer::Base.deliveries[0].inspect
logger.info ActionMailer::Base.deliveries[1].inspect
Then you should have the description of both objects in log file.
I added these lines:
RAILS_DEFAULT_LOGGER.info ActionMailer::Base.deliveries[0].inspect
RAILS_DEFAULT_LOGGER.info ActionMailer::Base.deliveries[1].inspect
But in the log file does't appear any new information.
Yes, sorry, it's a test so it should not log anything. Could you try by replacing RAILS_DEFAULT_LOGGER.info
with puts
, please ?
Something has issued, but I don't understand what.
Loaded suite mail_handler_test
Started
.................#<TMail::Mail port=#<TMail::StringPort:id=0x..fdab13bcc> bodyport=#<TMail::StringPort:id=0x..fdab0f2ac>>
#<TMail::Mail port=#<TMail::StringPort:id=0x..fdaaeb406> bodyport=#<TMail::StringPort:id=0x..fdaae8a76>>
F.................
Finished in 3.55149 seconds.
1) Failure:
test_add_issue_should_send_email_notification(MailHandlerTest) [mail_handler_test.rb:297]:
<1> expected but was
<2>.
Next try :
p ActionMailer::Base.deliveries[0].header.inspect
p ActionMailer::Base.deliveries[0].body
p ActionMailer::Base.deliveries[1].header.inspect
p ActionMailer::Base.deliveries[1].body
Done, I attached the output in file output.txt
That is twice the same mail.
What is you mail configuration, please ?
# Outgoing email settings
production:
delivery_method: :async_smtp
smtp_settings:
tls: true
address: "smtp.gmail.com"
port: '587'
domain: "smtp.gmail.com"
authentication: :plain
user_name: "redmine@******.com"
password: "********"
Could you try the fix of Go MAEDA for async_smtp issue in #5058, please ?
Thanks a lot for the tip, I just change async_smtp to smtp, and notification began to come.
- delivery_method: :async_smtp
+ delivery_method: :smtp
P.S. Method of Go MAEDA for async_smtp issue dosen't help me.
AFAIK, :async_imap has no effect ?!
I think that this issue is actually the same as #5058.
If you have some time left, could you make a new attempt for :async_smtp
with the 2 following lines added to lib/tasks/email.rake
:
task :receive_imap => :environment do
Thread.abort_on_exception = true
...
(existing code)
...
threads.each {|t| t.join }
end
- Status changed from New to Closed
- Resolution set to Invalid
Resolved by switching smtp delivery_method
setting from async_smtp
to smtp
, which is kind of a feature loss.
Would be great if someone could post a feedback about the change proposed in note-21.
Also available in: Atom
PDF