5

When creating/editing an issue in redmine the notification mails get sent twice. Why?

I looked into the redmine configuration file "config/configuration.yml" and tried to remove the "email_delivery:" section in "production:" because there is already one defined in "default:"

Even when using the "Send a test mail" feature of "Administration > Settings > Email notifications" the test email gets sent twice.

But this only occurs when using the below ":sendmail" configuration. When using ":smtp" and setting an SMTP server the mail gets correctly sent only once. When using the commandline "mail" command mails also get sent just once.

This is how my configuration.yml looks like:

production:
  email_delivery:
    delivery_method: :sendmail
# ... comments ...
default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :sendmail
# ... other stuff

The mailer which is used is qmail. This is the output of mail.info for sending a test mail:

Feb 21 10:52:56 admin qmail-queue-handlers[12443]: Handlers Filter before-queue for qmail started ...
Feb 21 10:52:56 admin qmail-queue-handlers[12443]: from=support@web-consulting.at
Feb 21 10:52:56 admin qmail-queue-handlers[12443]: to=kraft@web-consulting.at
Feb 21 10:52:56 admin qmail-queue-handlers[12443]: to=kraft@web-consulting.at
Feb 21 10:52:56 admin qmail: 1361440376.142458 new msg 5758988
Feb 21 10:52:56 admin qmail: 1361440376.142504 info msg 5758988: bytes 2348 from <support@web-consulting.at> qp 12446 uid 10028
Feb 21 10:52:56 admin qmail: 1361440376.143705 starting delivery 34398: msg 5758988 to local 78-kraft@web-consulting.at
Feb 21 10:52:56 admin qmail: 1361440376.143730 status: local 1/10 remote 0/20
Feb 21 10:52:56 admin qmail: 1361440376.143735 starting delivery 34399: msg 5758988 to local 78-kraft@web-consulting.at
Feb 21 10:52:56 admin qmail: 1361440376.143738 status: local 2/10 remote 0/20
Feb 21 10:52:56 admin qmail-local-handlers[12447]: Handlers Filter before-local for qmail started ...
Feb 21 10:52:56 admin qmail-local-handlers[12448]: Handlers Filter before-local for qmail started ...
Feb 21 10:52:56 admin qmail-local-handlers[12448]: from=support@web-consulting.at
Feb 21 10:52:56 admin qmail-local-handlers[12448]: to=kraft@web-consulting.at
Feb 21 10:52:56 admin qmail-local-handlers[12448]: mailbox: /var/qmail/mailnames/web-consulting.at/kraft
Feb 21 10:52:56 admin qmail-local-handlers[12447]: from=support@web-consulting.at
Feb 21 10:52:56 admin qmail-local-handlers[12447]: to=kraft@web-consulting.at
Feb 21 10:52:56 admin qmail-local-handlers[12447]: mailbox: /var/qmail/mailnames/web-consulting.at/kraft
Feb 21 10:52:56 admin qmail: 1361440376.159507 delivery 34399: success: did_0+0+2/
Feb 21 10:52:56 admin qmail: 1361440376.159542 status: local 1/10 remote 0/20
Feb 21 10:52:56 admin qmail: 1361440376.160164 delivery 34398: success: did_0+0+2/
Feb 21 10:52:56 admin qmail: 1361440376.160248 status: local 0/10 remote 0/20
Feb 21 10:52:56 admin qmail: 1361440376.160283 end msg 5758988

It seems the ruby ActionMailer is already causing "to=kraft@web-consulting.at" twice.

Any ideas?

kraftb
  • 625
  • 5
  • 15

1 Answers1

3

Maybe you have an old version of sendmail?

  config.action_mailer.delivery_method = :sendmail
  config.action_mailer.sendmail_settings = {
   :location => '/usr/sbin/sendmail',
   :arguments => "-i"
  }

For me, I had to use sendmail with -i to fix the double-send problem

(Reference) http://stefanwienert.net/blog/2011/11/17/rails-schickt-mails-zweimal-wenn-man-sendmail-verwendet-slash-rails-sent-mails-twice-when-using-sendmail/

stwienert
  • 3,402
  • 24
  • 28
  • Didn't work on my end. Do I have to clean the cache or recompile Redmine afterwards? – Mateng Jun 05 '13 at 14:38
  • It does work, I just waited an hour. However, I am unsure how to reload configuration to avtivate changes like these. – Mateng Jun 05 '13 at 15:53
  • It worked but I had to write it like: config.action_mailer.delivery_method = :sendmail config.action_mailer.sendmail_settings: location: "/usr/bin/sendmail" arguments: "-i" In fact the problem is that redmine seems to generate a "To:" in the header AND sets an email address when calling "sendmail". This is fine for original sendmail because of the "-t" switch and for postfix prior to some specific version. But we are using qmail which simply ignores "-t" – kraftb Jul 24 '13 at 11:03
  • Well. My comment didn't get formatted well. Simply use the same syntax as in the rest of the file. – kraftb Jul 24 '13 at 11:10