Project

General

Profile

Actions

Defect #4228

closed

no notification on issue creation by mail with redmine:email:receive_imap

Added by Jérôme Bousquié about 15 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email notifications
Target version:
-
Start date:
2009-11-17
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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

output.txt (11.6 KB) output.txt Evgeny Zhiryakov, 2011-03-01 05:38

Related issues

Related to Redmine - Patch #613: Asynchronous email deliveryClosed2008-02-06

Actions
Related to Redmine - Defect #6069: No Outgoing Mails when Customer creates Ticket via MailNew2010-08-06

Actions
Has duplicate Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtpClosed2010-03-12

Actions
Actions #1

Updated by Jean-Philippe Lang almost 15 years ago

  • Category set to Email notifications
Actions #2

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

Actions #3

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?

Actions #4

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') 
Actions #5

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?..

Actions #6

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?

Actions #7

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.

Actions #8

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

Actions #9

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?

Actions #10

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.

Actions #11

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.

Actions #12

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 ?

Actions #13

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>.
Actions #14

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
Actions #15

Updated by Evgeny Zhiryakov over 13 years ago

Done, I attached the output in file output.txt

Actions #16

Updated by Etienne Massip over 13 years ago

That is twice the same mail.

What is you mail configuration, please ?

Actions #17

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: "********" 

Actions #18

Updated by Etienne Massip over 13 years ago

Could you try the fix of Go MAEDA for async_smtp issue in #5058, please ?

Actions #19

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.

Actions #20

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.

Actions #21

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
Actions #22

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.

Actions

Also available in: Atom PDF