Defect #4228
closedno notification on issue creation by mail with redmine:email:receive_imap
0%
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
Related issues
Updated by Jean-Philippe Lang almost 15 years ago
- Category set to Email notifications
Updated by Jérôme Bousquié almost 15 years ago
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
Updated by Jean-Philippe Lang almost 15 years ago
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?
Updated by Mihail Rukavishnikov over 14 years ago
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')
Updated by Anton Nepomnyaschih almost 14 years ago
+1. We have the same problem :( Jean, do you need any help with this? Steps to reproduce or any?..
Updated by Anton Nepomnyaschih almost 14 years ago
How can I add any log-file which can show you the problem and steps to reproduce?
Updated by Evgeny Zhiryakov almost 14 years ago
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.
Updated by Etienne Massip almost 14 years ago
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
Updated by Evgeny Zhiryakov almost 14 years ago
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?
Updated by Etienne Massip over 13 years ago
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.
Updated by Evgeny Zhiryakov over 13 years ago
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.
Updated by Etienne Massip over 13 years ago
Yes, sorry, it's a test so it should not log anything. Could you try by replacing RAILS_DEFAULT_LOGGER.info
with puts
, please ?
Updated by Evgeny Zhiryakov over 13 years ago
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>.
Updated by Etienne Massip over 13 years ago
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
Updated by Evgeny Zhiryakov over 13 years ago
- File output.txt output.txt added
Done, I attached the output in file output.txt
Updated by Etienne Massip over 13 years ago
That is twice the same mail.
What is you mail configuration, please ?
Updated by Evgeny Zhiryakov over 13 years ago
# 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: "********"
Updated by Etienne Massip over 13 years ago
Could you try the fix of Go MAEDA for async_smtp issue in #5058, please ?
Updated by Evgeny Zhiryakov over 13 years ago
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.
Updated by Etienne Massip over 13 years ago
AFAIK, :async_imap has no effect ?!
I think that this issue is actually the same as #5058.
Updated by Etienne Massip over 13 years ago
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
Updated by Etienne Massip over 13 years ago
- 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.