Mail merge email settings fail for Office365 account

Hi all!

I am trying to set up my mail merge in Writer, using LO 7.0.6 on Windows 10.
I have a work email account on Office365, and looking at the Office365 settings, I can see it recommends the following settings:

IMAP

SMTP

In LibreOffice, I have used the following settings in Tools - Options - LibreOffice Writer - Mail Merge Email:

Outgoing server (SMTP) settings

Server authentication

  • :ballot_box_with_check: The outgoing mail server (SMTP) requires authentication
  • :black_circle: The outgoing mail server uses the same authentication as the incoming mail server
  • Server name: outlook.office365.com
  • Port: 993
  • Type: IMAP
  • username and password: (as instructed by my employer)

I then test the settings, but I get both tests failed (establishing network connection and finding outgoing mail server), and this error message:

LibreOffice could not connect to the outgoing mail server. Check your system's settings and the settings in LibreOffice. Check the server name, the port and the secure connections settings
--
<class 'imaplib.IMAP4.abort'>: socket error: EOF, traceback follows
  File "C:\Program Files\LibreOffice\program\mailmerge.py", line 315, in connect
    self.server = imaplib.IMAP4(server, port)
  File "C:\Program Files\LibreOffice\program\python-core-3.7.10\lib\imaplib.py", line 201, in __init__
    self._connect()
  File "C:\Program Files\LibreOffice\program\python-core-3.7.10\lib\imaplib.py", line 243, in _connect
    self.welcome = self._get_response()
  File "C:\Program Files\LibreOffice\program\python-core-3.7.10\lib\imaplib.py", line 1047, in _get_response
    resp = self._get_line()
  File "C:\Program Files\LibreOffice\program\python-core-3.7.10\lib\imaplib.py", line 1151, in _get_line
    raise self.abort('socket error: EOF')

My employer states that setting up a client also requires:

  • Encryption method: TLS
  • Authentication method: OAuth2

Could this be why it fails? What could I try to make it work?

…probably fails due to this

Thank you, might very well be the case… Following up:

  • Is there a bug report to implement OAuth2 for mail merge? I couldn’t find one…
  • I tried using the OAuth2OOo extension and could get a token from my account, but couldn’t then make Mail Merge use that authentication. Has anyone managed to make it work? Or is there a different extension that would help?

AFAIK - there is only one bug report related to oAuth - see tdf#101630 (esp. see comments #61 and #62 (and some duplicates of that bug report). However, it is related to oAuth using Google Drive.

Thanks. I decided to file the enhancement request: https://bugs.documentfoundation.org/show_bug.cgi?id=144379