imap caldav carddav nextcloud how?



  • cant config z-push to work with that backends.
    please help with working configs
    i use letsencrypt ssl smtp 587 imap 993 ports
    now i have errors:

    [FATAL] [tasks@advocatorb.ru] Exception: (AuthenticationRequiredException) - Access denied. Username or password incorrect
    13/10/2019 15:23:26 [ 6132] [WARN] [tasks@advocatorb.ru] Unknown:0 Unknown: Certificate failure for imap.advocatorb.ru: unable to get local issuer certificate: /CN=smtp.advocatorb.ru (errflg=2) (8)
    

  • Kopano

    Hi @orlovnv,

    there was a forum user who said he wanted to provide a how-to for the specific setup with Nextcloud. Could not find the post for that in a quick search, maybe you have more look finding him/her.


  • Kopano

    Hi @orlovnv,

    there are some z-push nextcloud how-tos available at the nextcloud forum or e.g. this one: https://pawelgorny.com/using-nextcloud-owncloud-with-z-push-for-caldav-and-carddav/.

    It would be easier to help you if you would post what and how you configured. Are the usernames and the passwords the same for all the services (imap, caldav, carddav)?

    Manfred



  • @Manfred i did all configs and now all work perfect, only one problem i have - it fullusername with domain, how to solve it?
    i see one topic but i have no success with changing caldav.php and carddav.php


  • Kopano

    Hi @orlovnv,

    @orlovnv said in imap caldav carddav nextcloud how?:

    @Manfred i did all configs and now all work perfect, only one problem i have - it fullusername with domain, how to solve it?
    i see one topic but i have no success with changing caldav.php and carddav.php

    sorry, I didn’t understand what the issue is.

    Manfred




  • Kopano

    Hi @orlovnv,

    there’s a Z-Push issue for it https://jira.z-hub.io/browse/ZP-1522 which is not solved yet. So, at the moment that doesn’t work.

    Manfred



  • @Manfred i read about it, but author of that topic managed to work only with username, but i didnt understand how, at that moment it is good for me



  • @orlovnv I have z-push working against dovecot imap and nextcloud by setting the following in the main configuration file

    define('USE_FULLEMAIL_FOR_LOGIN', false);
    

    Then just the local part of the email address is used, allowing CalDav and CardDav to authenticate.

    My dovecot imap configuration includes the following

    auth_username_format = %n
    

    Then for autodiscover to work properly I have configured autodiscover.conf.php to use the full email address (for autoconfiguring mail client correctly with the full email address, not just the local part). I also authenticate autodiscover against dovecot imap because dovecot will handle handle the full email address and use only the local part.

        define('USE_FULLEMAIL_FOR_LOGIN', true);
        define('BACKEND_PROVIDER', 'BackendIMAP');
    


  • @orlovnv I have setup Nextclould with z-push and it works perfectly for me. I assume you have two different passwords for the IMAP (which is handled by dovecot I assume) and your nextcloud install. This issue drove me crazy for some time. You MUST(!!!), and there is no exception that I found, make sure that your imap and nextcloud passwords are the same. If they are not these will be the issues.

    I would read that out of your first line of error messages you mentioned there. With certificates I can’t really help as I am not using an encrypted connection between z-push and nextcloud. It all runs on the same server and I did not bother to set up encryption between both services. I know not the best solution but it works.

    Let me know if I can help with anything.

    regards
    realShadow



  • I have been wondering about the issue that the password for caldav/carddav and imap have to be the same. This will give you problems when you are using two factor on Nextcloud. When you enable nextcloud two factor you can no longer login to carddav/caldav with your default ldap/sql whatever password.

    I have a few ideas how to work around this:

    • Allow to configure a imap master password (dovecot has this feature) in the z-push configuration so the authentication has to be done with the app password against the carddav/caldav nextcloud backend. -> Requires some changes to z-push
    • Somehow make you imap backend (like dovecot) authenticate to the app password you generate in nextcloud. I am trying to figure out if there is a way to do this. -> Need some help from a nextcloud dev.
    • Disable two factor for the z-push server towards the nextcloud server. At this moment Nextcloud does not support this so it is not an option at this moment.

    any other ideas? :)


Log in to reply