Hello Steffen,

Thanks for doing all this work!

A couple of snags:

On Sun, 2 Oct 2022, Steffen Nurpmeso steffen-at-sdaoden.eu |s-nail| wrote:

 _If_ you only have one account at a service provider, say,
 Google, then all you need to do to get yourself going is:

   # s-nail-oauth-helper.y --resource CONFIG-PATH --provider Yandex

Typo: s-nail-oauth-helper.py --resource CONFIG-PATH --provider Google :-)

More seriously, in the definition of act_authorize in the python script

def act_authorize(args, cfg, dt): #{{{
   global auth_code
   print('* OAuth 2.0 RFC 6749, 4.1.1. Authorization Request', file=sys.stderr)
   e = False
   for k in client.keys():
      if k != 'refresh_token' and k != 'access_token' \
            and not cfg.get(k) and client.get(k, '.') == '':
         print('! Missing client key: %s' % k, file=sys.stderr)
         e = True
   if e:
      print('PANIC: configuration incomplete or invalid', file=sys.stderr)
      return EX_DATAERR

   return EX_OK

   p = {}
...

The return line occurs too early. It causes the script to finish without doing anything. Commenting it out lets authorization go ahead.

Also, when I try to authorize using the Microsoft client id that the script puts into the config file during --action=template, I get an error page from Microsoft with the text:

myname@myorganization
Need admin approval
unverified
This app may be risky. If you trust this app, please ask your admin to grant you access. Learn more
Have an admin account? Sign in with that account
Return to the application without granting consent

If I edit in my own client_id, obtained by following the Mutt advice that you quote, then all is well and I get authorized successfully.

For all I know, that might be a problem specific to office365 accounts tied to organizations and someone with a personal Microsoft account could be ok. If any s-nail user has chosen on their own to use Microsoft as their email provider, as opposed to being outsourced to them by an organization, it would be interesting if they could check.

Stephen Isard

Reply via email to