feat: per account imap and smtp debugging#10301
Conversation
0e8d1a5 to
22ba6c1
Compare
|
TODO: Fix integration test |
Done |
77998a6 to
421a8dc
Compare
There was a problem hiding this comment.
I posted a reply in the thread above.
I meant both. I don't like having a compressed int as a field. That makes it hard to understand when encountered outside of the code, e.g. in a database dump.
As this is not performance critical code I would prefer another way, e.g. a serialized JSON string or concatenated string ("imap|smtp") or similar.
|
Please change "4.1.0-alpha.2" to "4.1.0-alpha.3" in info.xml to trigger the migration. |
You may want to wait until #10326 is merged and bump after a rebase. |
Done. I've changed the version to '4.2.0-alpha.1' that way it will migrate properly after the '4.2.0-alpha.0' release. |
ChristophWurst
left a comment
There was a problem hiding this comment.
What I'm missing now is a way to enable Mail debug mode for one occ run.
Before I could do php NC_debug=1 occ mail:account:sync .... This allowed running one sync in debug mode and leave the rest (of production) untouched. Now I have to globally set the account for debug and it will influence production, e.g. through background jobs or when the user has the app open in the browser.
Any idea how we can bring the old trick back?
So you want to use a single use environmental variable to enable debugging, no problem. |
|
I’d like to suggest removing the option to enable debugging separately for each protocol (like IMAP or SMTP). This would make the setup simpler, with just one debug option instead. I think enabling debugging for individual protocols adds extra complexity without much benefit. |
Well the logic is that you only diagnose issues in one protocol at a time anyway, so there was no point in logging protocols you are not interested in. Lets see what @ChristophWurst and @st3iny think. |
|
Let's simplify and get this in
|
565737f to
47e66ec
Compare
Done. Rebased also since this was 5 months old now |
e0056e8 to
06400d3
Compare
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com> Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
c587612 to
95a96c5
Compare
st3iny
left a comment
There was a problem hiding this comment.
Tested and works. I applied all suggestions, rebased and squashed.
This app.mail.debug will not work form the command line!!!! So this command will not work, NC_MAIL_DEBUG=true php occ mail:account:sync 14 |
|
Let's handle this in another PR then. You could add a check for the environment variable directly to the client factory. |
At the moment there is no ability to debug a single mail account.
This adds the ability to enable debugging from the command line using a occ command on a single account and protocol. This also creates a separate file for each account that is enable instead of logging all accounts to the same log file. ( {data directory}/mail-{user id}-{account id}-imap.log )
// command arguments and options
mail:account:debug [--on] [--off]
// enable debugging for imap
mail:account:debug 14 --on
// disable debugging
mail:account:debug 14 --off
mail:account:debug 14
// enable for single run with environmental variable
NC_MAIL_DEBUG=true php occ mail:account:sync 14