Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

empty/nil cc/bcc field causes exception (Mail::Field::ParseError) #10

Closed
jtwalters opened this Issue · 3 comments

2 participants

@jtwalters

require 'mail'
=> true
Mail.deliver do
?> from 'nobody@example.com'
to 'nobody@example.com'
cc ''
subject 'testing'
body 'this is a test'
end
Mail::Field::ParseError: AddressListsParser can not parse ||
Reason was: Expected one of
, (, !, #, $, %, &, ', *, +, -, /, =, ?, ^, _, `, {, |, }, ~, ", ., <, , at line 1, column 1 (byte 1) after

from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/elements/address_list.rb:25:in `initialize'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/fields/common/common_address.rb:70:in `new'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/fields/common/common_address.rb:70:in `tree'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/fields/common/common_address.rb:20:in `addresses'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/field.rb:120:in `method_missing'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/message.rb:262:in `block in destinations'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/message.rb:262:in `map'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/message.rb:262:in `destinations'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/network/delivery_methods/smtp.rb:62:in `deliver!'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/network/deliverable.rb:11:in `perform_delivery!'
from /usr/local/lib/ruby/gems/1.9.1/gems/mail-1.2.5/lib/mail/mail.rb:122:in `deliver'
from (irb):2
from /usr/local/bin/irb:12:in `<main>'
@jtwalters

not sure why my post wasn't parsed properly (newlines?)

@mikel
Owner

You need to indent it by at least 4 spaces.

Is this what you wrote:

require 'mail' => true
Mail.deliver do
  from 'nobody@example.com'
  to 'nobody@example.com'
  cc ''
  subject 'testing'
  body 'this is a test'
end

?

@mikel
Owner

Nevermind. Fixed in commit #d596fa6

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.