|
@@ -71,6 +71,26 @@ RSpec.describe Channel::EmailParser, type: :model do
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+ # see https://github.com/zammad/zammad/issues/2254
|
|
|
+ context 'when sender address contains > (#2254)' do
|
|
|
+ let(:mail_file) { Rails.root.join('test', 'data', 'mail', 'mail076.box') }
|
|
|
+ let(:sender_email) { 'millionslotteryspaintransfer@example.com' }
|
|
|
+
|
|
|
+ it 'removes them before creating a new user' do
|
|
|
+ expect { described_class.new.process({}, raw_mail) }
|
|
|
+ .to change { User.where(email: sender_email).count }.to(1)
|
|
|
+ end
|
|
|
+
|
|
|
+ it 'marks new user email as invalid' do
|
|
|
+ described_class.new.process({}, raw_mail)
|
|
|
+
|
|
|
+ expect(User.find_by(email: sender_email).preferences)
|
|
|
+ .to include('mail_delivery_failed' => true)
|
|
|
+ .and include('mail_delivery_failed_reason' => 'invalid email')
|
|
|
+ .and include('mail_delivery_failed_data' => a_kind_of(ActiveSupport::TimeWithZone))
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
# see https://github.com/zammad/zammad/issues/2224
|
|
|
context 'when header specifies Windows-1258 charset (#2224)' do
|
|
|
let(:mail_file) { Rails.root.join('test', 'data', 'mail', 'mail072.box') }
|