Mail doesn't seem to like the name-addr spec from RFC2822

This commit is contained in:
Dan Hansen 2011-10-10 00:35:04 -05:00
parent 71681d1bc7
commit 32f1b61719
4 changed files with 6 additions and 6 deletions

View file

@ -8,7 +8,7 @@ module NotificationMailers
@comment = Comment.find_by_id(comment_id)
if mail?
@headers[:from] = "[#{@comment.author.name} (Diaspora*)] <#{AppConfig[:smtp_sender_address]}>"
@headers[:from] = "\"#{@comment.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:subject] = truncate(@comment.parent.comment_email_subject, :length => TRUNCATION_LEN)
@headers[:subject] = "Re: #{@headers[:subject]}"
end

View file

@ -7,7 +7,7 @@ module NotificationMailers
def set_headers(comment_id)
@comment = Comment.find(comment_id)
@headers[:from] = "[#{@comment.author.name} (Diaspora*)] <#{AppConfig[:smtp_sender_address]}>"
@headers[:from] = "\"#{@comment.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:subject] = truncate(@comment.parent.comment_email_subject, :length => TRUNCATION_LEN)
@headers[:subject] = "Re: #{@headers[:subject]}"
end

View file

@ -7,7 +7,7 @@ module NotificationMailers
@conversation = @message.conversation
@participants = @conversation.participants
@headers[:from] = "[#{@message.author.name} (Diaspora*)] <#{AppConfig[:smtp_sender_address]}>"
@headers[:from] = "\"#{@message.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
@headers[:subject] = @conversation.subject.strip
@headers[:subject] = "Re: #{@headers[:subject]}" if @conversation.messages.size > 1
end

View file

@ -172,7 +172,7 @@ describe Notifier do
end
it "FROM: contains the sender's name" do
@mail["From"].to_s.should == "[#{@cnv.author.name} (Diaspora*)] <#{AppConfig[:smtp_sender_address]}>"
@mail["From"].to_s.should == "\"#{@cnv.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
end
it 'SUBJECT: has a snippet of the post contents' do
@ -207,7 +207,7 @@ describe Notifier do
end
it "FROM: contains the sender's name" do
comment_mail["From"].to_s.should == "[#{eve.name} (Diaspora*)] <#{AppConfig[:smtp_sender_address]}>"
comment_mail["From"].to_s.should == "\"#{eve.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
end
it 'SUBJECT: has a snippet of the post contents' do
@ -248,7 +248,7 @@ describe Notifier do
end
it 'FROM: has the name of person commenting as the sender' do
comment_mail["From"].to_s.should == "[#{eve.name} (Diaspora*)] <#{AppConfig[:smtp_sender_address]}>"
comment_mail["From"].to_s.should == "\"#{eve.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>"
end
it 'SUBJECT: has a snippet of the post contents' do