Z-Push not sending email form iPhone

Hello,

I have configured Exchange account in my iPhone 6s. I can receive emails but unable to send or reply any email here is the error I found in logs while send the email.

14/09/2017 11:42:16 [ 30] [WARN] [umar@example.me] /usr/share/z-push/backend/imap/imap.php:209 Undefined index: cc (8)
14/09/2017 11:42:16 [ 30] [ERROR] [umar@example.me] Mail<mail> error: mail() returned failure

Would you please help me about this issue.

Regards

Hi umardraz,

which Z-Push version are you using? Is it a new installation or it stopped working after an update?

Could you post the WBXML log of an email being sent? Are there any errors in apache logs?

Which OS are you using? Have you installed from the repository or sources?

Manfred

Hi

This is the new installation on Centos 7 using repository.

There is no error in apache while sending emails.

Here is the packages list

z-push-common-2.3.8+0-73.1.noarch
z-push-autodiscover-2.3.8+0-73.1.noarch
z-push-config-apache-2.3.8+0-73.1.noarch
z-push-backend-carddav-2.3.8+0-73.1.noarch
z-push-backend-imap-2.3.8+0-73.1.noarch
z-push-backend-caldav-2.3.8+0-73.1.noarch
z-push-backend-combined-2.3.8+0-73.1.noarch
z-push-ipc-sharedmemory-2.3.8+0-73.1.noarch

Here is WBXML logs

14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] Combined->Logon() success
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] ZPush::CommandNeedsPlainInput(3): false
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I  <ComposeMail:SmartReply>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I   <ComposeMail:ClientId>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I    7A85DECA-D2F5-4C9D-9471-80B9CA23A6AD
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I   </ComposeMail:ClientId>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I   <ComposeMail:SaveInSentItems/>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I   <ComposeMail:ReplaceMime/>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I   <ComposeMail:Source>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I    <ComposeMail:FolderId>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I     i/05a2240c
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I    </ComposeMail:FolderId>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I    <ComposeMail:ItemId>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I     94
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I    </ComposeMail:ItemId>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I   </ComposeMail:Source>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I   <ComposeMail:MIME>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I    Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: 7bit
From: umar@example.me
Mime-Version: 1.0 (1.0)
Subject: Re: test
Message-Id: <7A85DECA-D2F5-4C9D-9471-80B9CA23A6AD@example.me>
Date: Thu, 14 Sep 2017 21:29:14 +0500
References: <CAAKRE73-FoXn8k9MJ6ruTRWX_ukkd4KjcbA14JO7deByfjmnrA@mail.gmail.com>
To: Umar Draz <unix.co@gmail.com>
In-Reply-To: <CAAKRE73-FoXn8k9MJ6ruTRWX_ukkd4KjcbA14JO7deByfjmnrA@mail.gmail.com>

Hi

Sent from my iPhone

> On 14-Sep-2017, at 9:23 PM, Umar Draz <unix.co@gmail.com> wrote:
> 
> test

14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I   </ComposeMail:MIME>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] I  </ComposeMail:SmartReply>
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] DeviceManager->GetBackendIdForFolderId(): no backend-folderid available for 'i/05a2240c', returning as is.
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] Combined->SendMail()
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->SendMail(): RFC822: 555 bytes  forward-id: 'false' reply-id: '94' parent-id: '05a2240c' SaveInSent: '1' Re
pl
aceMIME: 'true'
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: Content-Type: text/plain;
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: 	charset=us-ascii
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: Content-Transfer-Encoding: 7bit
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: From: umar@netpc.me
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: Mime-Version: 1.0 (1.0)
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: Subject: Re: test
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: Message-Id: <7A85DECA-D2F5-4C9D-9471-80B9CA23A6AD@netpc.me>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: Date: Thu, 14 Sep 2017 21:29:14 +0500
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: References: <CAAKRE73-FoXn8k9MJ6ruTRWX_ukkd4KjcbA14JO7deByfjmnrA@mail.gmail.com>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: To: Umar Draz <unix.co@gmail.com>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: In-Reply-To: <CAAKRE73-FoXn8k9MJ6ruTRWX_ukkd4KjcbA14JO7deByfjmnrA@mail.gmail.com>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: 
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: Hi
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: 
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: Sent from my iPhone
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: 
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: > On 14-Sep-2017, at 9:23 PM, Umar Draz <unix.co@gmail.com> wrote:
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: > 
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: > test
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] RFC822: 
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->SendMail(): We get the new message
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->SendMail(): We get the From and To
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->getFromHeaderValue(): from defined: umar@netpc.me
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->SendMail(): To defined: unix.co@gmail.com
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] Utils::CheckAndFixEncodingInHeadersOfSentMail(): addresses "Umar Draz"  <unix.co@gmail.com>
14/09/2017 12:29:16 [   30] [WARN] [umar@example.me] /usr/share/z-push/backend/imap/imap.php:209 Undefined index: cc (8)
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] Utils::CheckAndFixEncodingInHeadersOfSentMail(): addresses 
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->setReturnPathValue(): No Return-Path address defined, we use From
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->SendMail(): is a new message or we are replacing mime
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->addTextPartsMessage(): The message has plain body
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->SendMail(): Copying new headers
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->SendMail(): Final mail to send:
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Mime-Version: 1.0
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] From: umar@netpc.me
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Subject: Re: test
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Message-id: <7A85DECA-D2F5-4C9D-9471-80B9CA23A6AD@netpc.me>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Date: Thu, 14 Sep 2017 21:29:14 +0500
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] References: <CAAKRE73-FoXn8k9MJ6ruTRWX_ukkd4KjcbA14JO7deByfjmnrA@mail.gmail.com>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] To: "Umar Draz"  <unix.co@gmail.com>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] In-reply-to: <CAAKRE73-FoXn8k9MJ6ruTRWX_ukkd4KjcbA14JO7deByfjmnrA@mail.gmail.com>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Cc: 
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Return-path: umar@netpc.me
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Content-Type: multipart/mixed;
 boundary="=_a7519784dca9a09a4661ee420668ea39"
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: This is a multi-part message in MIME format.
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: --=_a7519784dca9a09a4661ee420668ea39
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: Content-Type: multipart/alternative;
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body:  boundary="=_daa5d743605616bf653d74509319b565"
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: 
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: --=_daa5d743605616bf653d74509319b565
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: Content-Transfer-Encoding: base64
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: Content-Type: text/plain; charset=utf-8
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: 
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: SGkNCg0KU2VudCBmcm9tIG15IGlQaG9uZQ0KDQo+IE9uIDE0LVNlcC0yMDE3LCBhdCA5OjIzIFBN
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: LCBVbWFyIERyYXogPHVuaXguY29AZ21haWwuY29tPiB3cm90ZToNCj4gDQo+IHRlc3QNCg==
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: --=_daa5d743605616bf653d74509319b565--
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: 
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: --=_a7519784dca9a09a4661ee420668ea39--
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] Body: 
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->sendMessage(): SendingMail with mail
14/09/2017 12:29:16 [   30] [ERROR] [umar@example.me] Mail<mail> error: mail() returned failure
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->sendMessage(): send return value 
14/09/2017 12:29:16 [   30] [ INFO] [umar@example.me] StatusException: BackendIMAP->sendMessage(): The email could not be sent - code: 120 - file: /usr/share/z-push/backend/
im
ap/imap.php:2499
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] WBXMLEncoder->startWBXML() type: vnd.ms-sync.wbxml
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] O  <ComposeMail:SendMail>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] O   <ComposeMail:Status>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] O   120
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] O   </ComposeMail:Status>
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] O  </ComposeMail:SendMail>
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] WBXMLEncoder->endTag() WBXML output completed
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] WBXML-OUT: AwFqAAAVRVIDMTIwAAEB
14/09/2017 12:29:16 [   30] [WBXML] [umar@example.me] WBXML-IN : AwFqAAAVR1EDN0E4NURFQ0EtRDJGNS00QzlELTk0NzEtODBCOUNBMjNBNkFEAAEICUtMA2kvMDVhMjI0MGMAAU0DOTQAAQFQw4QrQ29udGVu
dC
1UeXBlOiB0ZXh0L3BsYWluOw0KCWNoYXJzZXQ9dXMtYXNjaWkNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IDdiaXQNCkZyb206IHVtYXJAbmV0cGMubWUNCk1pbWUtVmVyc2lvbjogMS4wICgxLjApDQpTdWJqZWN0OiBSZTo
gdGVzdA0KTWVzc2FnZS1JZDogPDdBODVERUNBLUQyRjUtNEM5RC05NDcxLTgwQjlDQTIzQTZBREBuZXRwYy5tZT4NCkRhdGU6IFRodSwgMTQgU2VwIDIwMTcgMjE6Mjk6MTQgKzA1MDANClJlZmVyZW5jZXM6IDxDQUFLUkU3My1G
b1huOGs5TUo2cnVUUldYX3Vra2Q0S2pjYkExNEpPN2RlQnlmam1uckFAbWFpbC5nbWFpbC5jb20+DQpUbzogVW1hciBEcmF6IDx1bml4LmNvQGdtYWlsLmNvbT4NCkluLVJlcGx5LVRvOiA8Q0FBS1JFNzMtRm9YbjhrOU1KNnJ1V
FJXWF91a2tkNEtqY2JBMTRKTzdkZUJ5ZmptbnJBQG1haWwuZ21haWwuY29tPg0KDQpIaQ0KDQpTZW50IGZyb20gbXkgaVBob25lDQoNCj4gT24gMTQtU2VwLTIwMTcsIGF0IDk6MjMgUE0sIFVtYXIgRHJheiA8dW5peC5jb0BnbW
FpbC5jb20+IHdyb3RlOg0KPiANCj4gdGVzdA0KAQE=
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] Combined->Logoff()
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendIMAP->close_connection(): disconnected from IMAP server
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendCalDAV->Logoff(): disconnected from CALDAV server
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] BackendCardDAV->Logoff(): disconnected from CARDDAV server
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] Combined->Logoff() success
14/09/2017 12:29:16 [   30] [DEBUG] [umar@example.me] LoopDetection->ProcessLoopDetectionTerminate()
14/09/2017 12:29:16 [   30] [ INFO] [umar@example.me] cmd='SmartReply' memory='6.45 MiB/6.75 MiB' time='1.50s' devType='iPhone' devId='vt6morjb3t6937bais1j147qek' getUser='u
ma
r@example.me' from='172.17.0.1' idle='0s' version='2.3.8+0' method='POST' httpcode='200'

Hi umardraz,

did you specify sendmail_path in the php.ini of apache? In the php.ini you could also configure additional logging for mail() calls.

Manfred

@manfred said in Z-Push not sending email form iPhone:

Manfred

HI Manfred,

We can not use direct smtp instead of sendmail?

Regards

Hi umardraz,

you can use direct smpt if you set IMAP_SMTP_METHOD in the config.php of the imap backend to ‘smtp’. Or is it set to ‘smtp’ and causing this error?

Manfred

HI

Thanks for your help, now I will prefer smtp method.

Here is my imap backend’s smtp setting

$imap_smtp_params = array(‘host’ => ‘ssl://172.17.0.1’, ‘port’ => 465, ‘auth’ => true, ‘username’ => ‘imap_username’, ‘password’ => ‘imap_password’, ‘allow_self_signed’ => T
rue);

But I am getting error while sending emails

Sep 14 19:22:36 mail postfix/smtps/smtpd[388]: warning: TLS library problem: 388:error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca:s3_pkt.c:1275:SSL alert number 48:

Hi umardraz,

you could try setting verify_peer and verify_peer_name of $imap_smtp_params to false.

Manfred

Thanks :)

@manfred

Thanks for your help regarding that. Now the smtp start working. Now whenever I try to send email I got these error in z-push

15/09/2017 01:36:18 [ 68] [ERROR] [umar@netpc.me] trace: 1:/usr/share/z-push/backend/imap/imap.php:2495 - Mail_smtp->send()
15/09/2017 01:36:18 [ 68] [ERROR] [umar@netpc.me] trace: 2:/usr/share/z-push/backend/imap/imap.php:318 - BackendIMAP->sendMessage()
15/09/2017 01:36:18 [ 68] [ERROR] [umar@netpc.me] trace: 3:/usr/share/z-push/backend/combined/combined.php:268 - BackendIMAP->SendMail()
15/09/2017 01:36:18 [ 68] [ERROR] [umar@netpc.me] trace: 4:/usr/share/z-push/lib/request/sendmail.php:127 - BackendCombined->SendMail()
15/09/2017 01:36:18 [ 68] [ERROR] [umar@netpc.me] trace: 5:/usr/share/z-push/lib/request/requestprocessor.php:112 - SendMail->Handle()
15/09/2017 01:36:18 [ 68] [ERROR] [umar@netpc.me] trace: 6:/usr/share/z-push/index.php:107 - RequestProcessor::HandleRequest()
15/09/2017 01:36:18 [ 68] [ERROR] [umar@netpc.me] BackendIMAP->saveSentMessage(): The email could not be saved to Sent Items folder. Check your configuration.

Here is my imap-conf.php

<?php

define('IMAP_SERVER', '172.17.0.1');
define('IMAP_PORT', 993);
define('IMAP_OPTIONS', '/notls/norsh/ssl/novalidate-cert');
define('IMAP_AUTOSEEN_ON_DELETE', false);
define('IMAP_FOLDER_CONFIGURED', true);
define('IMAP_FOLDER_PREFIX', '');
define('IMAP_FOLDER_PREFIX_IN_INBOX', false);
define('IMAP_FOLDER_INBOX', 'INBOX');
define('IMAP_FOLDER_SENT', 'SENT');
define('IMAP_FOLDER_DRAFT', 'DRAFTS');
define('IMAP_FOLDER_TRASH', 'TRASH');
define('IMAP_FOLDER_SPAM', 'SPAM');
define('IMAP_FOLDER_ARCHIVE', 'ARCHIVE');
define('IMAP_INLINE_FORWARD', true);
define('IMAP_EXCLUDED_FOLDERS', '');
define('IMAP_DEFAULTFROM', '');

define('IMAP_SMTP_METHOD', 'smtp');
global $imap_smtp_params;
$imap_smtp_params = array('host' => 'ssl://172.17.0.1', 'port' => 465, 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password', 'verify_peer
' => false, 'verify_peer_name' => false, 'allow_self_signed' => true);

define('MAIL_MIMEPART_CRLF', "\r\n");
define('SYSTEM_MIME_TYPES_MAPPING', '/etc/mime.types');
define('IMAP_MEETING_USE_CALDAV', true);

?>

Hi umardraz,

you have to check if the imap folder names match the ones in the config. Maybe it’s not “SENT”, but “common.sent” or something like that.

Manfred

HI

this is the folder list

rwx------ 5 vmail vmail 4096 Sep 11 04:22 .Archive
drwx------ 5 vmail vmail 4096 Sep 11 04:24 .Deleted Items
drwx------ 5 vmail vmail 4096 Sep 12 14:38 .Drafts
drwx------ 5 vmail vmail 4096 Sep 10 07:04 .Junk E-mail
drwx------ 2 vmail vmail 4096 Sep 15 10:26 new
drwx------ 5 vmail vmail 4096 Sep 15 05:36 .Sent Items
drwx------ 5 vmail vmail 4096 Sep 15 10:27 .Sent Messages
drwx------ 5 vmail vmail 4096 Sep 11 04:15 .Spam
drwx------ 5 vmail vmail 4096 Sep 11 15:17 .Spambox
drwx------ 5 vmail vmail 4096 Sep 15 10:27 .Trash

Regards

Hi umardraz,

so I’d say it’s either " .Sent Items" or “.Sent Messages” whatever your imap server configuration is.

Manfred

Yes I had update the imap-conf.php and change SENT with Sent Messages

Thanks