shugo/mournmail

private method 'gsub' called for nil:NilClass

Closed this issue · 3 comments

map7 commented

I've setup mournmail for my fastmail email account and get a listing of my email and can send, but when I hit enter on an email I get the following issue;

private method 'gsub' called for nil:NilClass

In the Bracktrace buffer I get

NoMethodError: private method `gsub' called for nil:NilClass
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/net-imap-0.3.1/lib/net/imap/data_encoding.rb:28:in `encode_utf7'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mournmail-1.0.3/lib/mournmail/summary.rb:145:in `block (2 levels) in read_ma
il'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mournmail-1.0.3/lib/mournmail/utils.rb:198:in `block in imap_connect'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mournmail-1.0.3/lib/mournmail/utils.rb:173:in `synchronize'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mournmail-1.0.3/lib/mournmail/utils.rb:173:in `imap_connect'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mournmail-1.0.3/lib/mournmail/summary.rb:136:in `block in read_mail'
/usr/local/rbenv/versions/3.0.2/lib/ruby/3.0.0/monitor.rb:202:in `synchronize'
/usr/local/rbenv/versions/3.0.2/lib/ruby/3.0.0/monitor.rb:202:in `mon_synchronize'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mournmail-1.0.3/lib/mournmail/summary.rb:129:in `read_mail'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mournmail-1.0.3/lib/mournmail/summary_mode.rb:58:in `block (2 levels) in <cl
ass:SummaryMode>'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mournmail-1.0.3/lib/mournmail/utils.rb:77:in `block (2 levels) in background
'
/usr/local/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/textbringer-1.3.0/lib/textbringer/utils.rb:55:in `block in background'
shugo commented

@map7 Thanks for your report!

It seems that the error occurs when spam_mailbox is not specified in your account configuration.

CONFIG[:mournmail_accounts] = {
  "example.com" => {
    ...
    spam_mailbox: "spam",
    ...
  },

If it's specified, mails in the mailbox will not be cached.

I've released mournmail-1.0.4 to fix the bug.

map7 commented

That fixed the problem. One more problem and it might just be me, but I seem to only be able to view one email, and when I try to view the second email no buffer is shown or updated. I tried closing all buffers but that didn't help. I had to exit textbringer and go back in.

shugo commented

That fixed the problem. One more problem and it might just be me, but I seem to only be able to view one email, and when I try to view the second email no buffer is shown or updated. I tried closing all buffers but that didn't help. I had to exit textbringer and go back in.

Could you create another issue?
Please show CONFIG[:mournmail_accounts] masking sensitive information.