• Ssud0nz

      Moolevel 0

    Hi all,

    I’m trying to sync my old emails (hosted in Office365) to Mailcow. The docs.mailcow.email Icon docs

    are very simple and don’t provide much help.

    The error I’m having is:

    Host2: connecting and login on host2 [localhost] port [993] with user [lucas@example.com*XXXXXXX@mailcow.local]
    Host2 IP address: ::1
    Host2 banner: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
    Host2 capability before authentication: IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN AUTH
    Host2: localhost says it has CAPABILITY for AUTHENTICATE LOGIN
    Host2: success login on [localhost] with user [lucas@example.com*XXXXXXX@mailcow.local] auth [LOGIN] or [LOGIN]
    ++++ Listing 1 errors encountered during the sync ( avoid this listing with --noerrorsdump ).
    Err 1/1: Host1 failure: Error login on [outlook.office365.com] with user [lucas@example.com] auth [LOGIN]: 2 NO LOGIN failed.
    The most frequent error is ERR_AUTHENTICATION_FAILURE_USER1. Check the credentials for lucas@example.com.
    Exiting with return value 161 (EXIT_AUTHENTICATION_FAILURE_USER1) 1/50 nb_errors/max_errors PID 81291
    Disconnecting from host2 localhost user2 lucas@example.com*XXXXXXX@mailcow.local
    No log file because of option --nolog

    The sync job is configured like this:

    Any help would be much appreciated. Thanks!

    • EETNyx

        Moolevel 67

      I would guess you did not setup your account on Office365 correctly. This sync service is simple IMAP under hood,.. so try to use IMAP LOGIN outside MC, until you will be able to, it’s not MC problem,…

      Have something to say?

      Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

      • esackbauer

        • Community Hero
        Moolevel 432
      • Edited

      You need to check the imapsync documentation:
      https://imapsync.lamiral.info/FAQ.d/FAQ.Office365.txt

      Q. How to sync from Office365 to XXX?
      
      R. On Windows, use:
      
        imapsync.exe ... --office1
      
      On Unix, use:
      
        imapsync ... --office1
      
      Option --office1 is like (release 1.970 or higher):
        
        imapsync ... --host1 outlook.office365.com \
                     --ssl1 \
                     --exclude "^Files$" 

      So you are missing the custom parameter --office1
      If that doesnt work you need to create an app password on MS365, or use OAUTH2 token:
      https://imapsync.lamiral.info/oauth2/oauth2_imap/README_oauth2.txt

      I guess its simpler to move the mails with a PST file to your mailcow account.

      No one is typing