Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    iphone (IOS) not able to send mails

    Z-Push when using other backends
    6
    41
    5694
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • maedball
      maedball @bob4os last edited by

      @bob4os
      I really appreciate your help on this sunny Sunday morning ;-)

      I disabled all of them, still I cant send.

      I recall from my last solution (really long time ago) that apple hat some issues when a specific folder was not available. If you have a working active sync connection with z-push, can you check two things for me?

      1. Do you see here in the advanced settings something for sending mails?

      20210613_095510000_iOS.png

      1. Which standard folders do you have in your ios mailbox?
        55f7bd10-6782-4baa-869e-2629b5d4de6a-image.png
      1 Reply Last reply Reply Quote 0
      • bob4os
        bob4os last edited by

        You’re welcome :-)

        Same options there, folders are similar (german language for me).

        I have a lot of Apple iOS device connected to my Z-Push instance and no issue with any device.
        Whether recently added with iOS 14 (it all started with iOS 14) nor updated iOS devices, where the account was migrated.

        Could you take a look at policies.ini and compare your settings with mine?

        [default]
        devpwenabled = 1
        alphanumpwreq = 0
        devencenabled = 0
        docbrowseenabled =
        attenabled = 1
        mindevpwlenngth = 4
        maxinacttimedevlock = 900
        maxdevpwfailedattempts = 12
        maxattsize = ''
        allowsimpledevpw = 1
        devpwexpiration = 0
        devpwhistory = 0
        allowstoragecard = 1
        allowcam = 1
        reqdevenc = 0
        allowunsignedapps = 1
        mindevcomplexchars = 3
        allowwifi = 1
        allowtextmessaging = 1
        allowpopimapemail = 1
        allowbluetooth = 2
        allowirda = 0
        reqmansyncroam = 0
        maxcalagefilter = 0
        allowhtmlemail = 1
        maxemailagefilter = 0
        maxemailbodytruncsize = -1
        maxemailhtmlbodytruncsize = -1
        reqsignedsmimemessages = 0
        reqencsmimemessages = 0
        reqsignedsmimealgorithm = 0
        reqencsmimealgorithm = 0
        allowsmimeencalgneg = 2
        allowsmimesoftcerts = 1
        allowbrowser = 1
        allowconsumeremail = 1
        allowinternetsharing = 1
        
        maedball 1 Reply Last reply Reply Quote 0
        • maedball
          maedball @bob4os last edited by

          @bob4os

          sure thing:
          devpwenabled = 1 (0)
          allowirda = 0 (1)
          maxdevpwfailedattempts = 12 (8)

          I have changed everything to your settings except irda (i think this should really make no difference ;)) reenabled provisioning in the z-push.conf and retried.
          Directly after resetup of the mail account i see this again in the log , still the same error in the iphone:

          13/06/2021 21:21:25 [110456] [FATAL] [maedball] Exception: (ProvisioningRequiredException) - Retry after sending a PROVISION command
          

          Hmm if this error occurred since IOS 14, maybe i can check tomorrow with my colleagues if they know any differences from my mobility team. (they are using o365 but still maybe they have an idea).

          1 Reply Last reply Reply Quote 0
          • bob4os
            bob4os last edited by

            Could you remove the account, delete the device states with z-push-admin.php -a remove -d <deviceid> and recreate the whole account and try again?
            Just want to rule out the “devpwenabled” option.

            maedball 1 Reply Last reply Reply Quote 0
            • maedball
              maedball @bob4os last edited by

              @bob4os well:

              13/06/2021 21:55:22 [ 1405] [ERROR] [maedball] LoopDetection->ProcessLoopDetectionPreviousConnectionFailed(): Command 'Provision' at 13/06/2021 21:54:58 with pid '104908' terminated unexpectedly or is still running.
              13/06/2021 21:55:22 [ 1405] [ERROR] [maedball] Please check your logs for this PID and errors like PHP-Fatals or Apache segmentation faults and report your results to the Z-Push dev team.
              13/06/2021 21:55:39 [110456] [WARN] [maedball] Mobile loop detected! Messages sent to the mobile will be restricted to 1 items in order to identify the conflict
              1
              

              but it wait, there is more ;-)

              2021/06/13 21:54:31 [error] 246432#246432: *6050 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method Utils::SafeGetContents() in /usr/share/z-push/lib/utils/utils.php:995
              Stack trace:
              #0 /usr/share/z-push/lib/default/filestatemachine.php(221): Utils::SafePutContents()
              #1 /usr/share/z-push/lib/core/devicemanager.php(186): FileStateMachine->LinkUserDevice()
              #2 /usr/share/z-push/index.php(224): DeviceManager->Save()
              #3 {main}
                thrown in /usr/share/z-push/lib/utils/utils.php on line 995" while reading response header from upstream, client: 52.98.155.85, server: myserver.net, request: "POST /Microsoft-Server-ActiveSync?Cmd=Provision&User=maedball&DeviceId=83e1baa94125441c98006a91f60c6396&DeviceType=Outlook HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "myserver.net"
              2021/06/13 21:54:59 [error] 246432#246432: *7012 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method Utils::SafeGetContents() in /usr/share/z-push/lib/utils/utils.php:995
              Stack trace:
              #0 /usr/share/z-push/lib/default/filestatemachine.php(221): Utils::SafePutContents()
              #1 /usr/share/z-push/lib/core/devicemanager.php(186): FileStateMachine->LinkUserDevice()
              #2 /usr/share/z-push/index.php(224): DeviceManager->Save()
              #3 {main}
                thrown in /usr/share/z-push/lib/utils/utils.php on line 995" while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: myserver.net, request: "POST /Microsoft-Server-ActiveSync?User=maedball&DeviceId=7USFM7UGBD1TB3TOKLQ5C8K3E8&DeviceType=iPhone&Cmd=Provision HTTP/2.0", upstream: "fastcgi://127.0.0.1:7777", host: "myserver.net"
              2021/06/13 21:55:58 [error] 246432#246432: *7374 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method Utils::SafeGetContents() in /usr/share/z-push/lib/utils/utils.php:995
              Stack trace:
              #0 /usr/share/z-push/lib/default/filestatemachine.php(221): Utils::SafePutContents()
              #1 /usr/share/z-push/lib/core/devicemanager.php(186): FileStateMachine->LinkUserDevice()
              #2 /usr/share/z-push/index.php(224): DeviceManager->Save()
              #3 {main}
                thrown in /usr/share/z-push/lib/utils/utils.php on line 995" while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: myserver.net, request: "POST /Microsoft-Server-ActiveSync?Cmd=FolderSync&User=maedball&DeviceId=71F78D5910B041C4902532958DE4FE5A&DeviceType=WindowsOutlook15 HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "myserver.net"
              
              
              
              1 Reply Last reply Reply Quote 0
              • bob4os
                bob4os last edited by

                Yeah, somebody changed the function SafeGetContents to SafeGetContentsUnserialized and did not bother to check for dependencies!
                There are some leftover calls to the old function - sorry about this, this usually does not happen here.

                maedball 1 Reply Last reply Reply Quote 0
                • maedball
                  maedball @bob4os last edited by

                  @bob4os
                  No need to excuse yourselves ;-)
                  I am happy so find such a fine software out there for free and even have people helping on a SUNDAY at 10PM…

                  1 Reply Last reply Reply Quote 0
                  • bob4os
                    bob4os last edited by

                    Copy the GetSafeContents function from GitHub https://github.com/Z-Hub/Z-Push/blob/5fc6ca6e680b36f6d80ad052fc7c2ed89cc77a36/src/lib/utils/utils.php line 1425 and following into your “lib/utils/utils.php”, this should work until it has been properly fixed.

                    maedball 1 Reply Last reply Reply Quote 0
                    • maedball
                      maedball @bob4os last edited by

                      @bob4os Thank you very much. The question is if it makes sense to open all the small warnings and issues I see in the Z-push log like:

                      13/06/2021 22:42:35 [ 1411] [WARN] [maedball] /usr/share/z-push/backend/caldav/caldav.php:841 A non-numeric value encountered (2)
                      
                      13/06/2021 22:59:24 [110456] [WARN] [maedball] BackendIMAP->StatMessage('4278c508','23'): Failed to retrieve overview:
                      
                      13/06/2021 23:00:49 [ 1411] [WARN] [maedball] /usr/share/z-push/include/mimeDecode.php:865 iconv(): Detected an illegal character in input string (8)
                      
                      13/06/2021 23:00:45 [ 1414] [WARN] [maedball] SyncObject->Check(): object from type SyncMail: parameter 'from' contains an invalid email address 'Angelika Klein <>'. Address is removed
                      
                      13/06/2021 23:01:36 [ 1404] [ERROR] [maedball] Ignored broken message (SyncMail). Reason: '2' Folderid: 'i/48a41822' message id '196'
                      
                      13/06/2021 23:01:53 [108025] [ERROR] [maedball] TimezoneUtil::guessTZNameFromPHPName() no compatible timezone found for 'UTC+01:00'. Returning 'GMT Standard Time'. Please contact the Z-Push dev team.
                      
                      13/06/2021 23:02:04 [ 1407] [ERROR] [maedball] BackendIMAP->delete_calendar_dav(): event not found, we will end with zombie events
                      1
                      
                      13/06/2021 23:01:53 [108025] [ERROR] [maedball] TimezoneUtil::guessTZNameFromPHPName() no compatible timezone found for 'UTC+01:00'. Returning 'GMT Standard Time'. Please contact the Z-
                      
                      13/06/2021 23:04:29 [ 1411] [WARN] [maedball] cleanupDate('Fri, 1 Aug 2014 20:14:12 UT'): strtotime() failed - message might be broken.
                      
                      13/06/2021 23:04:32 [106660] [WARN] [maedball] /usr/share/z-push/lib/core/streamer.php:309 strlen() expects parameter 1 to be string, array given (2)
                      
                      13/06/2021 23:04:32 [106660] [WARN] [maedball] /usr/share/z-push/include/z_RFC822.php:182 trim() expects parameter 1 to be string, array given (2)
                      
                      13/06/2021 23:05:35 [104908] [ERROR] [maedball] z_RFC822 error: Validation failed for: 
                      
                      1 Reply Last reply Reply Quote 0
                      • bob4os
                        bob4os last edited by

                        Are you using PHP 8?

                        maedball 1 Reply Last reply Reply Quote 0
                        • maedball
                          maedball @bob4os last edited by

                          @bob4os
                          7.4 php-frm - > via Nginx.

                          It is more or less a stock Ubuntu 20.04 lts with dovecot (imap) and Nextcloud (cal and card dav)

                          1 Reply Last reply Reply Quote 0
                          • bob4os
                            bob4os last edited by

                            /usr/share/z-push/backend/caldav/caldav.php:841 - ZP-1571
                            /usr/share/z-push/include/mimeDecode.php:865 - ZP-1579
                            BackendIMAP->delete_calendar_dav(): event not found, we will end with zombie events - a mail with a cancelation of an event was found, the calendar entry has most likely never existed, so this is to be expected…

                            These are new to me:
                            /usr/share/z-push/lib/core/streamer.php:309 strlen() expects parameter 1 to be string, array given (2)
                            /usr/share/z-push/include/z_RFC822.php:182 trim() expects parameter 1 to be string, array given (2)

                            1 Reply Last reply Reply Quote 0
                            • maedball
                              maedball last edited by

                              Just in case someone has the same issue.

                              I changed the imap settings to SSL and suddenly IOS was able to send mails.

                              Now i just need to find out why z-push is disconnecting once outlook is connected:

                              [WARN] [michael.klein] /usr/share/z-push/backend/imap/imap.php:127 imap_open(): Couldn't open stream {mailserver:993/imap/ssl} (2)
                              [ERROR] [michael.klein] BackendIMAP->Logon(): can't connect as user 'michael.klein' on '{mailserver:993/imap/ssl}': Can not authenticate to IMAP server: [CLOSED] IMAP connection broken (authenticate)
                              [FATAL] [michael.klein] Exception: (AuthenticationRequiredException) - Access denied. Username or password incorrect
                              [michael.klein] IP: 10.20.0.4 failed to authenticate user 'michael.klein'
                              [WARN] [michael.klein] Unknown:0 Unknown: Can not authenticate to IMAP server: [CLOSED] IMAP connection broken (authenticate) (errflg=2) (8)
                              
                              1 Reply Last reply Reply Quote 0
                              • AndreasB
                                AndreasB @maedball last edited by

                                Hello,

                                does anyone have founf a solution for this behavior?
                                I have the same problem a described in the initial post. The connection to my IMAP Backend with all Android Client are still working. All IOS device are not be able to send mails. In this account the did not have a mail adress, and are notifing the user with "Cannot Send Mail | Check the settings for the outgoing servers in settings -> Mail -> Accounts.
                                I tried different task to solve the problem, in example:

                                • All connection to the IMAP and SMTP backend are based on ssl/tls

                                • Changed the provisioning to false

                                • I deleted the account setting after every change and resets the device on the Z-Push frontend

                                Kind regards Andreas

                                maedball 1 Reply Last reply Reply Quote 0
                                • maedball
                                  maedball @AndreasB last edited by

                                  @andreasb I was never able to get it working with the native IOS app. Instead i switched to the outlook app on IOS… It is not ideal but at least it works

                                  AndreasB 1 Reply Last reply Reply Quote 0
                                  • AndreasB
                                    AndreasB @maedball last edited by

                                    @maedball
                                    I found a solution.
                                    After a couple of days in investigation what is the root cause for the strange behavior, I tried to setup the native IOS Mail APP with my full mail address as login name and now I can send mails as expected.
                                    Maybe the missing AD is the problem in the Active Sync with communication in with a native IMAP backend.
                                    Can you check this in your setup?

                                    maedball 1 Reply Last reply Reply Quote 0
                                    • maedball
                                      maedball @AndreasB last edited by

                                      @andreasb Sounds promising, unfortunately will this lead to a complete rebuild of my setup. I need to change dovecot aswell as nextcloud to work with emails instead of userids ;). However i will try, just not right away ;-). If this is however the reason, by what can it be caused, any idea?

                                      1 Reply Last reply Reply Quote 0
                                      • JungleMarc
                                        JungleMarc last edited by JungleMarc

                                        I can get latest iOS working on Z-Push without issues.

                                        It requires that the server is setup proper on SSL certs for the http server you use.

                                        Is there a specific reason why you choose Nginx as opposed to Apache?
                                        The packages install defaults Z-Push and Webapp through Apache. It works well.

                                        Beware of iOS Outlook app. This app is not using exchange directly, instead it uses cloud service that connects back to Z-Push (lol why!!) and it stores account related data in cloud services.

                                        If you care about your privacy, stick to other mail clients. I invite you to read about that. And also keep a good eye on your Kopano access logs, you’ll be surprised of how much data is being accessed by the MS cloud.

                                        Very old iOS versions would allow self-signed certs for email, but that changed since iOS 13.

                                        maedball 1 Reply Last reply Reply Quote 0
                                        • maedball
                                          maedball @JungleMarc last edited by

                                          @junglemarc: I had it also not working also with apache and tried nginx also with no luck.

                                          The certificates are Lets encrypt certificates. I know about the outlook app (and i am also not happy with it) but been able to send mails on the go is kind of needed ;-).

                                          JungleMarc 1 Reply Last reply Reply Quote 0
                                          • JungleMarc
                                            JungleMarc @maedball last edited by

                                            pretty sure we can help you out get it working

                                            When you setup the account in iOS Settings,

                                            leave the domain section blank

                                            only use the username / password and server fields.

                                            What do you see in the logs if you give it a try?

                                            maedball 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post