Closed cablett closed 9 months ago
cc @stanhu @nguyenquangminh0711 if you have any thoughts here too :+1:
I may have been elixir-land too long, but I feel like MailRoom's approach is (or should be) "let it fail". I'm happy to let everything crash with an error if the secret isn't there. maybe? I could be completely forgetting, it's been so long.
That's OK. I think we may want to log something like "failure" if a 500 or similar comes back from the postback. Maybe that's enough. :thinking:
@cablett I've been away a very long time, sorry for that. If logging is insufficient, feel free to reopen.
Hi @tpitale !
When delivery method is postback, we found there's a hidden failure if a mailbox's JWT
secret_file
config isn't set up properly, and I think it might be better if there's a bit more noise about that in the logs.There are two failure modes here for the
secret_file
key value pair:secret_file: ~/.nonexistent_file
, not enough permissions to read, etc)nil
.We don't want to crash out entirely, because some other valid mailboxes should still be able to process things (and I know it would just start up anyway because you've told me in the past that it's how mailroom is designed to work :smile_cat:).
I thought something like:
That way we can do something like
But I'm not sure if it's intended to add "all the auth" to a single request to ensure at least something works. I suppose what I'm saying is I'm not sure how we'd distinguish between "JWT auth not being used for postback so it's not filled in" and "JWT auth is broken because some fields are missing".
Do you think there's a solution that might work here?
Could be something as simple as logging "none of the configs will work" if none are set up properly.
What do you think?