mailman-elixir / mailman

Mailman provides a clean way of defining mailers in your Elixir applications
https://github.com/mailman-elixir/mailman
Other
203 stars 73 forks source link

Compatibility error with Elixir 1.7 when sending mail #83

Closed azuken closed 5 years ago

azuken commented 6 years ago

Hi,

I've just passed my projects to Elixir 1.7.1, with docker image. I use mailman to send confirmation mail when creating an account on my app, but I saw when I tested it after update that gen_smtp throw me an error for a missing case in a pattern matching. Here is the stack :

`[error] Task #PID<0.489.0> started from #PID<0.486.0> terminating

container | ** (MatchError) no match of right hand side value: 'C3'

container | (gen_smtp) /app/deps/gen_smtp/src/mimemail.erl:898: :mimemail.encode_quoted_printable/3

container | (gen_smtp) /app/deps/gen_smtp/src/mimemail.erl:845: :mimemail.encode_quoted_printable/1

container | (gen_smtp) /app/deps/gen_smtp/src/mimemail.erl:812: :mimemail.encode_component_part/1

container | (gen_smtp) /app/deps/gen_smtp/src/mimemail.erl:786: anonymous fn/2 in :mimemail.encode_component/5

container | (stdlib) lists.erl:1250: :lists.flatmap/2

container | (gen_smtp) /app/deps/gen_smtp/src/mimemail.erl:783: :mimemail.encode_component/5

container | (gen_smtp) /app/deps/gen_smtp/src/mimemail.erl:119: :mimemail.encode/2

container | (mailman) lib/mailman.ex:43: Mailman.deliver/3

container | (agilitic_auth) web/services/register_service.ex:336: Project.Web.RegisterService.send_confirmation_email/2

container | (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2

container | (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

container | Function: #Function<0.31475494/0 in Project.Web.RegisterService.create_account/3>

container | Args: []`

With Elixir 1.6 image, it works fine.

skosch commented 6 years ago

Thanks for the bug report @azuken, and my apologies for the delayed response! I have run into the same problem.

A new gen_smtp was released last week that seems to cover the missing case. I've updated the mix file accordingly. You can set your mix file to {:mailman, github: "kamilc/mailman", override: true} and run mix deps.update mailman, or you can wait for @kamilc to update the hex package. Let me know if this fixes it for you.

azuken commented 6 years ago

No problem, I rollbacked versions and waited for a fix !

I've tested GitHub version, and it seems to work fine 👍 I will wait the hex package update to commit it on my project.

Thanks for your support !

jacobparry commented 6 years ago

Do we know when @kamilc will update the hex package?

kamilc commented 6 years ago

@skosch I need your input as I'm running out of ideas... I've just tried to hex.publish the package but the mix docs part is erroring out on me with the following message:

> mix docs
** (RuntimeError) module Mailman.Adapter.Mailman.LocalSmtpConfig was not compiled with flag --docs
    (ex_doc) lib/ex_doc/retriever.ex:152: ExDoc.Retriever.export_docs?/1
    (ex_doc) lib/ex_doc/retriever.ex:136: ExDoc.Retriever.get_module/2
    (elixir) lib/enum.ex:1314: Enum."-map/2-lists^map/1-0-"/2
    (ex_doc) lib/ex_doc/retriever.ex:116: ExDoc.Retriever.docs_from_modules/2
    (ex_doc) lib/ex_doc.ex:101: ExDoc.generate_docs/3
    (ex_doc) lib/mix/tasks/docs.ex:159: anonymous fn/6 in Mix.Tasks.Docs.run/3
    (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ex_doc) lib/mix/tasks/docs.ex:158: Mix.Tasks.Docs.run/3

Is there anything that rings a bell?

skosch commented 6 years ago

Hi @kamilc – sorry for the delay. Have you tried updating ex_doc? I think 0.19.1 is the latest one and we're still on 0.16.

kamilc commented 5 years ago

This took way too long but this is how it goes in life sometimes :| Many Thanks @skosch for pointing me at the newer ex_doc version!

kamilc commented 5 years ago

The updated package is on Hex btw