mirror of
https://github.com/redmine/redmine.git
synced 2025-11-06 13:25:44 +01:00
Reject setting RFC non-compliant emission email addresses (#31154).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@18396 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -132,4 +132,18 @@ YAML
|
||||
Setting.where(:name => 'commit_update_keywords').delete_all
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
def test_mail_from_format_should_be_validated
|
||||
with_settings :default_language => 'en' do
|
||||
['[Redmine app] <redmine@example.net>', 'redmine'].each do |invalid_mail_from|
|
||||
errors = Setting.set_all_from_params({:mail_from => invalid_mail_from})
|
||||
assert_includes errors, [:mail_from, 'is invalid']
|
||||
end
|
||||
|
||||
['Redmine app <redmine@example.net>', 'redmine@example.net', '<redmine@example.net>'].each do |valid_mail_from|
|
||||
errors = Setting.set_all_from_params({:mail_from => valid_mail_from})
|
||||
assert_nil errors
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user