Support #1828
Incorrect from/reply to address used in sent email
40%
Description
I have install redmine-contact with following log:
# rake db:migrate_plugins RAILS_ENV=production (in /usr/local/lib/redmine-1.2) Migrating engines... Migrating acts_as_activity_provider... Migrating acts_as_attachable... Migrating acts_as_customizable... Migrating acts_as_event... Migrating acts_as_list... Migrating acts_as_searchable... Migrating acts_as_tree... Migrating acts_as_versioned... Migrating acts_as_watchable... Migrating awesome_nested_set... Migrating classic_pagination... Migrating extended_profile... Migrating gravatar... Migrating open_id_authentication... Migrating prepend_engine_views... Migrating redmine-google-analytics-plugin... Migrating redmine-openid-selector... Migrating redmine_checkout... Migrating redmine_ckeditor... Migrating redmine_contact... == AddContactFormPref: migrating ============================================= -- add_column(:user_preferences, :contact_form, :boolean, {:default=>false}) -> 0.0392s == AddContactFormPref: migrated (0.0397s) ==================================== Migrating redmine_jchat... Migrating redmine_local_avatars... Migrating redmine_repository... Migrating rfpdf... Migrating ruby-net-ldap-0.0.4... Migrating sidebar...
If you fill in contact form and send it, the recipient is always the default project emmission address (which is ok I guess since this is Redmines default), but the reply-to field is not used/filled.
I would expect the user’s email address here if he is logged in, and the reply to: field contents if he/she is not logged in.
I see that some reply-to field code is in app/models/email.rb, but maybe redmines mailer code doesn’t use it, needs a patch?
History
#1 Updated by Andriy Lesyuk over 13 years ago
- Status changed from New to Open
Going to check this soon!
#2 Updated by Andriy Lesyuk over 13 years ago
- Priority changed from Normal to Major
- % Done changed from 0 to 10
Tried on 1.0.x, 1.1.x and 1.2.x. Works for all versions.
The :reply_to
is set on form submit (see email.rb
). Then :from
is assigned to value of :reply_to
in contact_mailer_patch.rb
.
As I wrote in mail please provide exact version of Redmine and which other plugins are you using. At the moment I have no idea why this happends... What I would recommend is to add debugging output like:
RAILS_DEFAULT_LOGGER.info "..."
To check where the value gets lost.
Thanks
#3 Updated by Ron Klinkien over 13 years ago
Here are the details of my environment:
svn info Path: . URL: http://redmine.rubyforge.org/svn/branches/1.2-stable Repository Root: http://redmine.rubyforge.org/svn Repository UUID: e93f8b46-1217-0410-a6f0-8f06a7374b81 Revision: 6645 Node Kind: directory Schedule: normal Last Changed Author: tmaruyama Last Changed Rev: 6601 Last Changed Date: 2011-08-24 14:56:36 +0200 (Wed, 24 Aug 2011) /redmine# RAILS_ENV=production ruby script/about About your application's environment Ruby version 1.8.7 (x86_64-linux) RubyGems version 1.3.7 Rack version 1.1.2 Rails version 2.3.11 Active Record version 2.3.11 Active Resource version 2.3.11 Action Mailer version 2.3.11 Active Support version 2.3.11 Application root /usr/local/lib/redmine-1.2 Environment production Database adapter mysql Database schema version 20110511000000 About your Redmine plugins Redmine Local Avatars plugin 0.1.1 Redmine Checkout plugin 0.5 Google Analytics plugin 0.2.0 Redmine Homepage 0.1.0 Redmine Favicon plugin 0.2 Redmine Repository plugin 0.0.2 Redmine Wiki HTML Util 0.0.1 Redmine Wiki Extensions plugin 0.3.5 Extended profile 0.0.2 Redmine Hide Emails By Default plugin 0.0.1 Redmine External Links plugin 1.0 Contact form 0.0.1
Wil try to get some verbose debugging output...
#4 Updated by Andriy Lesyuk over 13 years ago
I don’t see any issues with your environment!
Have added some debuggin myself (just update from SVN)... The debug strings start with " [CONTACT_FORM] "
.
P.S. Just a note:
Contact form plugin replaces Hide Emails By Default plugin (you just need to set “Hide user email by default” in Administration settings).
#5 Updated by Ron Klinkien over 13 years ago
Yes I noticed that earlier about the default email override, I removed the plugin.
I updated contact_form from svn, and this is the debug output:
If you need more, let me know, I changed small info, but it looks ok. the reply to address is correct in the log, but not in the mail.
Can you modify the code so it set the reply_to address in the mai too? Not just the from address. Maybe that works?
Processing ContactFormController#mail (for 188.142.60.33 at 2011-09-04 11:43:32) [POST] Parameters: {"commit"=>"Send", "contact_form"=>{"project_id"=>"", "subject"=>"Test", "reply_to"=>"ron@world.com", "full_name"=>"Ron", "message"=>"Test"}, "action"=>"mail", "authenticity_token"=>"v7GsRaYDcLlqJ1oo37AyUno70J2IMNnhFinP3GGyFW2=", "controller"=>"contact_form"} ^[[4;36;1mSQL (0.5ms)^[[0m ^[[0;1mSELECT max(`settings`.updated_on) AS max_updated_on FROM `settings` ^[[0m ^[[4;35;1mAnonymousUser Load (0.3ms)^[[0m ^[[0mSELECT * FROM `users` WHERE ( (`users`.`type` = 'AnonymousUser' ) ) LIMIT 1^[[0m ^[[4;36;1mUser Load (0.4ms)^[[0m ^[[0;1mSELECT * FROM `users` WHERE (`users`.`id` = 4) AND ( (`users`.`type` = 'User' OR `users`.`type` = 'AnonymousUser' ) ) ^[[0m ^[[4;35;1mRole Load (0.3ms)^[[0m ^[[0mSELECT * FROM `roles` WHERE (`roles`.`builtin` = 2) LIMIT 1^[[0m ^[[4;36;1mProject Load (0.4ms)^[[0m ^[[0;1mSELECT * FROM `projects` WHERE (((projects.status=1) AND (projects.is_public = 1))) ORDER BY name^[[0m [CONTACT_FORM] :reply_to = ron@world.com ^[[4;35;1mCustomField Load (0.4ms)^[[0m ^[[0mSELECT * FROM `custom_fields` WHERE (type = 'EmailCustomField') ORDER BY position^[[0m ^[[4;36;1mSetting Load (0.4ms)^[[0m ^[[0;1mSELECT * FROM `settings` WHERE (`settings`.`name` = 'mail_from') LIMIT 1^[[0m [CONTACT_FORM] Ron <ron@world.com> ^[[4;35;1mUserPreference Load (0.3ms)^[[0m ^[[0mSELECT * FROM `user_preferences` WHERE (`user_preferences`.user_id = 2) LIMIT 1^[[0m Reply to: Sending email notification to: rdnzl <support@domo.nl> ^[[4;36;1mSetting Load (0.2ms)^[[0m ^[[0;1mSELECT * FROM `settings` WHERE (`settings`.`name` = 'bcc_recipients') LIMIT 1^[[0m Redirected to http://domotiga.nl/contact Completed in 140ms (DB: 3) | 302 Found [http://domo.nl/contact/mail]
#6 Updated by Andriy Lesyuk over 13 years ago
Can you modify the code so it set the reply_to address in the mai too? Not just the from address. Maybe that works?
The issue is that :reply_to
sets a different header (Reply-To:)... I have committed a commented line (see below) - just uncomment to try.
I also tried to add :from
without :full_name
... Could you please try?
File contact_mailer_patch.rb
:
from(email.reply_to) # FIXME
#from("#{email.full_name} <#{email.reply_to}>")
#reply_to("#{email.full_name} <#{email.reply_to}>") # FIXME
Thanks
#7 Updated by Andriy Lesyuk over 13 years ago
- Priority changed from Major to Normal
- % Done changed from 10 to 40
Not confirmed...
#8 Updated by Andriy Lesyuk almost 13 years ago
- Target version deleted (
0.0.1b)
#9 Updated by Andriy Lesyuk almost 13 years ago
- Status changed from Open to Incomplete
#10 Updated by Andriy Lesyuk over 12 years ago
- Tracker changed from Bug to Support
- Status changed from Incomplete to Deferred