PHPMailler sent email success but Reciever didn't receive email - phpmailer

I bought domain, host and email from Godaddy.
I am using phpMailer for my website's email function.
PhpMailer is showing email sent successfully but receiver didn't receive email.
I have put my php code and phpMailler debug log below.
Many thanks for your any suggestion..
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require '/home/vv0srjz4gnsz/public_html/system/library/phpmailer/src/Exception.php';
require '/home/vv0srjz4gnsz/public_html/system/library/phpmailer/src/PHPMailer.php';
require '/home/vv0srjz4gnsz/public_html/system/library/phpmailer/src/SMTP.php';
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->SMTPAuth = false;
$mail->SMTPAutoTLS = false;
$mail->Port = 25;
$mail->SMTPDebug = 3;
$mail->AddAddress('receiver#email.com', 'Receiver');
$mail->SetFrom('sender#email.com', 'Sender');
$mail->Subject = 'My Subject';
$mail->Body = 'Mail contents';
$mail->Username = 'auth#godaddyemaildomain.com';
$mail->Password = '!mypassword';
try{
if ($mail->send()) {
echo 'email sent success';
} else {
echo 'failed to send';
echo $mail->ErrorInfo;
}
} catch(Exception $e){
//Something went bad
echo "Fail - " . $mail->ErrorInfo;
}
?>
Result:
2023-02-17 09:53:11 Connection: opening to localhost:25, timeout=300, options=array()
2023-02-17 09:53:11 Connection: opened
2023-02-17 09:53:11 SERVER -> CLIENT: 220-sg2plzcpnl453267.prod.sin2.secureserver.net ESMTP Exim 4.95 #2 Fri, 17 Feb 2023 02:53:11 -0700 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2023-02-17 09:53:11 CLIENT -> SERVER: EHLO www.godaddyDomain.com
2023-02-17 09:53:11 SERVER -> CLIENT: 250-sg2plzcpnl453267.prod.sin2.secureserver.net Hello www.godaddyDomain.com [127.0.0.1]250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPE_CONNECT250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
2023-02-17 09:53:11 CLIENT -> SERVER: MAIL FROM:<sender#godaddyDomain.com>
2023-02-17 09:53:11 SERVER -> CLIENT: 250 OK
2023-02-17 09:53:11 CLIENT -> SERVER: RCPT TO:<receiver#godaddyDomain.com>
2023-02-17 09:53:11 SERVER -> CLIENT: 250 Accepted
2023-02-17 09:53:11 CLIENT -> SERVER: DATA
2023-02-17 09:53:11 SERVER -> CLIENT: 354 Enter message, ending with "." on a line by itself
2023-02-17 09:53:11 CLIENT -> SERVER: Date: Fri, 17 Feb 2023 09:53:11 +0000
2023-02-17 09:53:11 CLIENT -> SERVER: To: Mr Receiver <receiver#godaddyDomain.com>
2023-02-17 09:53:11 CLIENT -> SERVER: From: Mr Sender <sender#godaddyDomain.com>
2023-02-17 09:53:11 CLIENT -> SERVER: Subject: My Subject
2023-02-17 09:53:11 CLIENT -> SERVER: Message-ID: <muLYFVVw4LfUEMaV9Ot6WWxwnYHXYNs9UB1Mf0atZLU#www.godaddyDomain.com>
2023-02-17 09:53:11 CLIENT -> SERVER: X-Mailer: PHPMailer 6.1.7 (https://github.com/PHPMailer/PHPMailer)
2023-02-17 09:53:11 CLIENT -> SERVER: MIME-Version: 1.0
2023-02-17 09:53:11 CLIENT -> SERVER: Content-Type: text/plain; charset=iso-8859-1
2023-02-17 09:53:11 CLIENT -> SERVER:
2023-02-17 09:53:11 CLIENT -> SERVER: Mail contents
2023-02-17 09:53:11 CLIENT -> SERVER:
2023-02-17 09:53:11 CLIENT -> SERVER: .
2023-02-17 09:53:11 SERVER -> CLIENT: 250 OK id=1pSxQV-00HNWK-K8
2023-02-17 09:53:11 CLIENT -> SERVER: QUIT
2023-02-17 09:53:12 SERVER -> CLIENT: 221 sg2plzcpnl453267.prod.sin2.secureserver.net closing connection
2023-02-17 09:53:12 Connection: closed
email sent success
Any suggestion is appreciated..
Thanksss.

There are a myriad of reasons why your post was possibly not been received.
SPF, DMARC, DKIM, Blacklists...
It would help to start with your main.cf file parameters.
Have you inspected your mail logs?
Use the "tail" command and post any relevant errors.

Related

iothub-errorcode: InvalidProtocolVersion

Using the azure-iot-device sdk for node works in a standalone node program. When trying to use the same node code in a React web app, the connection to the IoT Hub fails "iothub-errorcode: InvalidProtocolVersion" with this error:
stream.js:61 WebSocket connection to 'wss://my-iothub.azure-devices.net/' failed: Error during WebSocket handshake: Unexpected response code: 400
App.js
var Protocol = require('azure-iot-device-mqtt').Mqtt;
var Client = require('azure-iot-device').Client;
var connectionString = "HostName=my-iothub.azure-devices.net;DeviceId=<redacted>;SharedAccessKey=<redacted>=";
var client = Client.fromConnectionString(connectionString, Protocol);
var connectCallback = function (err) {
if (err) {
console.error('Could not connect: ' + err.message);
}
...
};
client.open(connectCallback);
Headers (From Chrome dev tools)
Request URL: wss://my-iothub.azure-devices.net/
Request Method: GET
Status Code: 400 Bad Request
Content-Length: 158
Content-Type: application/json; charset=utf-8
Date: Wed, 02 Oct 2019 21:18:10 GMT
iothub-errorcode: InvalidProtocolVersion
Server: Microsoft-HTTPAPI/2.0
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cache-Control: no-cache
Connection: Upgrade
Host: my-iothub.azure-devices.net
Origin: http://localhost:3000
Pragma: no-cache
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Sec-WebSocket-Key: <redacted>
Sec-WebSocket-Protocol: mqtt
Sec-WebSocket-Version: 13
Upgrade: websocket
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0)
Possibly related to: https://github.com/Azure/azure-sdk-for-js/issues/3473#issuecomment-499719031
I am assuming you are trying to utilise IOT hub from your react web app which is deployed in Microsoft Azure , if this is the case, please try the following:
what you need to check is the web app settings:
Set the consumer group as mentioned in this link.
Enable WebSocket.
Additional reference , please check the code repo and documentation around IOT HUB usage in web app, which is mentioned below:
https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps
https://github.com/Azure/azure-iot-sdk-node/blob/master/device/ts-samples/sample_device.ts

D2C message using IoT Hub

I’d like to ask you a favor. I do have a problem confirming previously readed D2C message using IoT Hub. I am using REST API to pick up message like (I have replace SIG)
Request:
GET https://iot-hub-pospa.azure-devices.net/devices/18596c88-01e6-3f16-427b-10028d7305c5/messages/devicebound?api-version=2015-08-15-preview HTTP/1.1
IoTHub-MessageLockTimeout: 3600
Accept: application/json
Authorization: SharedAccessSignature sr=iot-hub-pospa.azure-devices.net&sig={sig}&se=1485558838&skn=iothubowner
Host: iot-hub-pospa.azure-devices.net
If-None-Match: "1c5006a4-2288-4a2f-b7ea-dcdf9b5bbc99"
Connection: Close
X-P2P-PeerDist: Version=1.1
X-P2P-PeerDistEx: MinContentInformation=1.0, MaxContentInformation=2.0
Accept-Encoding: peerdist
Response:
HTTP/1.1 200 OK
Content-Length: 35
ETag: "dfc78580-d251-4156-a5f6-c2a30811a504"
Server: Microsoft-HTTPAPI/2.0
iothub-messageid: 02cdb012-9749-48a9-bfb3-5812a4740675
iothub-to: /devices/18596c88-01e6-3f16-427b-10028d7305c5/messages/deviceBound
iothub-expiry:
iothub-correlationid:
iothub-ack: full
iothub-sequencenumber: 56
iothub-enqueuedtime: 2/2/2016 9:57:34 AM
iothub-deliverycount: 0
Date: Tue, 02 Feb 2016 10:21:43 GMT
Connection: close
2/2/2016 10:57:34 AM - Test message
Then when confirming I am getting HTTP 412 like
Request:
DELETE https://iot-hub-pospa.azure-devices.net/devices/18596c88-01e6-3f16-427b-10028d7305c5/messages/devicebound/02cdb012-9749-48a9-bfb3-5812a4740675?api-version=2015-08-15-preview HTTP/1.1
Accept: application/json
If-Match: "02cdb012-9749-48a9-bfb3-5812a4740675"
Authorization: SharedAccessSignature sr=iot-hub-pospa.azure-devices.net&sig={sig}&se=1485558838&skn=iothubowner
Host: iot-hub-pospa.azure-devices.net
Content-Length: 0
Connection: Close
Response:
HTTP/1.1 412 Precondition Failed
Content-Length: 330
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
iothub-errorcode: DeviceMessageLockLost
Date: Tue, 02 Feb 2016 10:21:49 GMT
Connection: close
 
{"Message":"ErrorCode:DeviceMessageLockLost;Message 02cdb012-9749-48a9-bfb3-5812a4740675 lock was lost for Device 18596c88-01e6-3f16-427b-10028d7305c5\r\nTracking Id:05994074a3664933a0910b5fc70e04e5-G:GatewayWorkerRole.6-B:1-P:cffe397b-f627-4435-bd54-48f5ba79c3ca-TimeStamp:02/02/2016 10:21:49\r\nErrorCode:DeviceMessageLockLost"}
 
 
Does anybody know what should I do to successfully confirm/delete message from IoT Hub, please? Thanks
static DeviceClient _deviceClient;
_deviceClient = DeviceClient.CreateFromConnectionString(<IoTHubURI>, TransportType.Http1);
public void SendMessage(IDictionary<string, object> dictionary)
{
Microsoft.Azure.Devices.Client.Message message = new Microsoft.Azure.Devices.Client.Message();
try
{
foreach (var r in dictionary)
{
message.Properties[r.Key] = r.Value.ToString();
}
_deviceClient.SendEventAsync(message);
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
}

Registering Range Networks Dev Kit / OpenBTS with Restcomm

I'm trying to configure OpenBTS 4 to use Restcomm for SIP registrar, voice and SMS proxy. Looks like OpenBTS has a minimal SIP stack and expects not to be challenged when registering mobile devices as sip clients. I see this question addressed for FreeSwitch:
http://wiki.freeswitch.org/wiki/OpenBTS
Can Restcomm be configured to accept registration requests without auth challenge?
SIP message log:
21:52:14,743 INFO [gov.nist.javax.sip.stack.UDPMessageChannel] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) Setting SIPMessage peerPacketSource to: /192.168.1.22:5062
21:52:14,749 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) <message
from="192.168.1.22:5062"
to="0.0.0.0:5080"
time="1417931534736"
isSender="false"
transactionId="z9hg4bkobtskvtocsucdsglutmh"
callId="001013e826c0010-e5a7615573939dc7"
firstLine="REGISTER sip:192.168.1.22 SIP/2.0"
>
<![CDATA[REGISTER sip:192.168.1.22 SIP/2.0
To: <sip:IMSI001010000000002#192.168.1.22:5080>
From: <sip:IMSI001010000000002#192.168.1.22:5080>;tag=OBTSiciuwjsxgdqsjsrb
Via: SIP/2.0/UDP 127.0.0.1:5062;branch=z9hG4bKOBTSkvtocsucdsglutmh;received=192.168.1.22
Call-ID: 001013e826c0010-e5a7615573939dc7
CSeq: 56410 REGISTER
Contact: <sip:IMSI001010000000002#127.0.0.1:5062>;expires=5400
P-Preferred-Identity: <sip:IMSI001010000000002#127.0.0.1>
P-PHY-Info: OpenBTS; TA=1 TE=0.294483 UpRSSI=-62.603565 TxPwr=20 DnRSSIdBm=-66 time=1417931534.143
P-Access-Network-Info: 3GPP-GERAN; cgi-3gpp=0010103e8000a
User-Agent: OpenBTS 4.0.0.8025 Build Date Mar 19 2014
Max-Forwards: 70
Content-Length: 0
]]>
</message>
21:52:14,755 INFO [org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher] (Mobicents-SIP-Servlets-UDPMessageChannelThread-3) Request event dispatched to RestComm
21:52:14,765 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (RestComm-akka.actor.default-dispatcher-31) <message
from="0.0.0.0:5080"
to="192.168.1.22:5062"
time="1417931534763"
isSender="true"
transactionId="z9hg4bkobtskvtocsucdsglutmh"
callId="001013e826c0010-e5a7615573939dc7"
firstLine="SIP/2.0 407 Proxy Authentication required"
>
<![CDATA[SIP/2.0 407 Proxy Authentication required
To: <sip:IMSI001010000000002#192.168.1.22:5080>;tag=20906605_eef5d580_57a5b08a_e058ce9c-9ea9-4cad-b6c5-372364a3afa9
Via: SIP/2.0/UDP 127.0.0.1:5062;branch=z9hG4bKOBTSkvtocsucdsglutmh;received=192.168.1.22
CSeq: 56410 REGISTER
Call-ID: 001013e826c0010-e5a7615573939dc7
From: <sip:IMSI001010000000002#192.168.1.22:5080>;tag=OBTSiciuwjsxgdqsjsrb
Server: TelScale Sip Servlets 7.0.2-SNAPSHOT
Proxy-Authenticate: Digest realm="192.168.1.22",nonce="36303031356338332d326635622d343"
Content-Length: 0
]]>
</message>
21:52:45,836 INFO [gov.nist.javax.sip.stack.UDPMessageChannel] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) Setting SIPMessage peerPacketSource to: /192.168.1.22:5062
21:52:45,841 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) <message
from="192.168.1.22:5062"
to="0.0.0.0:5080"
time="1417931565828"
isSender="false"
transactionId="z9hg4bkobtscdqcajsutpuenhlc"
callId="001013e826c0010-e5a7615573939dc7"
firstLine="REGISTER sip:192.168.1.22 SIP/2.0"
>
<![CDATA[REGISTER sip:192.168.1.22 SIP/2.0
To: <sip:IMSI001010000000002#192.168.1.22:5080>
From: <sip:IMSI001010000000002#192.168.1.22:5080>;tag=OBTSzyvbgcivyilvjqxe
Via: SIP/2.0/UDP 127.0.0.1:5062;branch=z9hG4bKOBTScdqcajsutpuenhlc;received=192.168.1.22
Call-ID: 001013e826c0010-e5a7615573939dc7
CSeq: 56411 REGISTER
Contact: <sip:IMSI001010000000002#127.0.0.1:5062>;expires=5400
P-Preferred-Identity: <sip:IMSI001010000000002#127.0.0.1>
P-PHY-Info: OpenBTS; TA=1 TE=0.385417 UpRSSI=-66.000000 TxPwr=28 DnRSSIdBm=-48 time=1417931565.071
P-Access-Network-Info: 3GPP-GERAN; cgi-3gpp=0010103e8000a
User-Agent: OpenBTS 4.0.0.8025 Build Date Mar 19 2014
Max-Forwards: 70
Content-Length: 0
]]>
</message>
21:52:45,847 INFO [org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher] (Mobicents-SIP-Servlets-UDPMessageChannelThread-4) Request event dispatched to RestComm
21:52:45,851 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (RestComm-akka.actor.default-dispatcher-31) <message
from="0.0.0.0:5080"
to="192.168.1.22:5062"
time="1417931565849"
isSender="true"
transactionId="z9hg4bkobtscdqcajsutpuenhlc"
callId="001013e826c0010-e5a7615573939dc7"
firstLine="SIP/2.0 407 Proxy Authentication required"
>
<![CDATA[SIP/2.0 407 Proxy Authentication required
To: <sip:IMSI001010000000002#192.168.1.22:5080>;tag=12394044_eef5d580_57a5b08a_5b523e6e-471b-4e99-93c0-ad56b68b2b93
Via: SIP/2.0/UDP 127.0.0.1:5062;branch=z9hG4bKOBTScdqcajsutpuenhlc;received=192.168.1.22
CSeq: 56411 REGISTER
Call-ID: 001013e826c0010-e5a7615573939dc7
From: <sip:IMSI001010000000002#192.168.1.22:5080>;tag=OBTSzyvbgcivyilvjqxe
Server: TelScale Sip Servlets 7.0.2-SNAPSHOT
Proxy-Authenticate: Digest realm="192.168.1.22",nonce="32356138316339342d353833652d343"
Content-Length: 0
]]>
</message>
Jean Deruelle provided the answer I needed:
https://github.com/Mobicents/RestComm/issues/29
A new config tag authenticate has been added to the restcomm.xml configuration file.
Set it to false to disable auth for incoming requests (REGISTER,
INVITE, MESSAGE) from SIP Clients If set to true Restcomm will
authenticate users and incoming messages from those users
true
<!-- If set to true Restcomm will authenticate users and incoming messages from those users -->
<authenticate>false</authenticate>

Use dkim in phpmailer code with privacy key

I am using PHPMailer.
I added DKIM attributes when sending file.
The code is like:
// $mail is PHPMailer class
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "*******";
$mail->Port = ***;
$mail->Mailer= "SMTP";
//...
$mail->DKIM_domain = 'mydomain.com';
$mail->DKIM_identity = '#mydomain.com';
$mail->DKIM_private = __DIR__ . '/privacy_key_mydomain.txt';
$mail->DKIM_selector = 'default';
$mail->DKIM_passphrase = ''; // only ssl.
//...
(Same as example on: Send mail in phpmailer using DKIM Keys)
When sending to email, such as mine (gmail), I have no problem, and I see that my email is signed by mydomain.com.
I see also, in the email source that DKIM-Signature is sent.
Nevertheless, some of my clients I am sending emails reject my email, with following message (especially for yahoo emails - more that 90% of rejects uses yahoo for their emails).
554 Message not allowed - Headers are not RFC compliant[291]
As I did some workaround, I found this message to be detected as a spam.
I am using CPANEL for my site, which has round-cube - so I test it at round-cube (sending the customer a message with round-cube) - seems OK. No spam detect.
So, I suspect the privacy key file may be incorrect (I have an SSL site - so I use the same privacy key as my own site).
What may be wrong? What shall I check out in order to avoid my emails will be detected as spams?
Here is the email source result:
Delivered-To: myaccount#gmail.com
Received: by 10.114.75.12 with SMTP id y12csp118366ldv;
Tue, 15 Jul 2014 11:44:11 -0700 (PDT)
X-Received: by 10.140.104.49 with SMTP id z46mr36090427qge.74.1405449850437;
Tue, 15 Jul 2014 11:44:10 -0700 (PDT)
Return-Path: <support#mydomain.com>
Received: from lin9.maindomain10.net (lin9.maindomain10.net. [1.2.3.4])
by mx.google.com with ESMTPS id t14si21957304qac.66.2014.07.15.11.44.09
for <myaccount#gmail.com>
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Tue, 15 Jul 2014 11:44:10 -0700 (PDT)
Received-SPF: pass (google.com: domain of support#mydomain.com designates 1.2.3.4 as permitted sender) client-ip=1.2.3.4;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of support#mydomain.com designates 1.2.3.4 as permitted sender) smtp.mail=support#mydomain.com;
dkim=pass header.i=#mydomain.com
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mydomain.com; s=default;
h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Subject:Reply-To:From:To:Date:Subject:To; bh=HBLjhR1eb0w5FQ9aVj60Gu0x3jP9XWQ7LQkpzTRHjfQ=;
b=ECWMCs3iPsjuvlT473K9u3skwyNRVunmnv3p440Nk2ZJVrbuWoO0vgzaWM8gjCC503ADKivdfrrOek8TgTSEI7G4B3WMCHI50PWq68W5rcscYJqErWxuqAVcSl4r5tomk88AYPhHiotCugmRTjwQ2K/JBtHsAvMhTlVQMMXsMl0=;
Received: from mainuser by lin9.maindomain10.net with local (Exim 4.82)
(envelope-from <support#mydomain.com>)
id 1X77hp-0001f9-SH; Tue, 15 Jul 2014 14:44:01 -0400
To: myName Mizrahi <myaccount#gmail.com>
Subject: Statistics from Sample Name site
Date: Tue, 15 Jul 2014 14:44:01 -0400
To: myName Mizrahi <myaccount#gmail.com>
From: "donotreply#mydomain.com" <root#localhost>
Reply-To: Sample Name site <donotreply#mydomain.com>
Subject: Statistics from Sample Name site
Message-ID: <d984a2c6308ef2a97cf6ccfe6292263a#mydomain.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.4 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=UTF-8
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - lin9.maindomain10.net
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [927 895] / [47 12]
X-AntiAbuse: Sender Address Domain - mydomain.com
X-Get-Message-Sender-Via: lin9.maindomain10.net: authenticated_id: mainuser/sender_address_domain
When sending message from round-cube, the email source look like this:
Delivered-To: myaccount#gmail.com
Received: by 10.114.75.12 with SMTP id y12csp118605ldv;
Tue, 15 Jul 2014 11:48:53 -0700 (PDT)
X-Received: by 10.224.161.129 with SMTP id r1mr34110372qax.86.1405450132678;
Tue, 15 Jul 2014 11:48:52 -0700 (PDT)
Return-Path: <support#mydomain.com>
Received: from lin9.maindomain10.net (lin9.maindomain10.net. [1.2.3.4])
by mx.google.com with ESMTPS id x8si13226659qas.81.2014.07.15.11.48.52
for <myaccount#gmail.com>
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Tue, 15 Jul 2014 11:48:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of support#mydomain.com designates 1.2.3.4 as permitted sender) client-ip=1.2.3.4;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of support#mydomain.com designates 1.2.3.4 as permitted sender) smtp.mail=support#mydomain.com;
dkim=pass header.i=#mydomain.com
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mydomain.com; s=default;
h=Message-ID:Subject:To:From:Date:Content-Transfer-Encoding:Content-Type:MIME-Version; bh=Bynm51C7RZD/vZ81iEMKjxxLoAJtSmKFcwU/eyFzPs8=;
b=fUX+UKS9Ua0HK35AOBRBJbmqTEuKscCYAsPyxs3If3dhhvb/AvAjl1gR9Rz9AN0EX0mu275wtaN5Y1JWP+8w8VcGebJ9FEWsltCl9nwqL6bos/eEqJxTWjDG6ch9MHo3G0mSE326Pyc13JWa59InSgJyWi8MSstT1POfuEhfe28=;
Received: from localhost.localdomain ([127.0.0.1]:54911 helo=mydomain.com)
by lin9.maindomain10.net with esmtpa (Exim 4.82)
(envelope-from <support#mydomain.com>)
id 1X77mO-0001l7-1O
for myaccount#gmail.com; Tue, 15 Jul 2014 14:48:44 -0400
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
format=flowed
Content-Transfer-Encoding: 7bit
Date: Tue, 15 Jul 2014 14:48:43 -0400
From: support#mydomain.com
To: myaccount#gmail.com
Subject: test
Message-ID: <ed6307c2c9504e8ba9ec21f073d5f863#mydomain.com>
X-Sender: support#mydomain.com
User-Agent: Roundcube Webmail/0.9.5
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - lin9.maindomain10.net
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - mydomain.com
X-Get-Message-Sender-Via: lin9.maindomain10.net: authenticated_id: support#mydomain.com
Round-Cube works with no spam.
What is the main difference that's make the issue?
Thanks :)
5.2.4 is pretty old and buggy - You need to update to the latest PHPMailer from GitHub.

401 unauthorized on final REGISTER Handshake on custom lync-client

I have implemented ntlmv2 for lync-server login in an custom made lync client.The message that I send to server is .....
(3rd register message)
REGISTER sip:example.com SIP/2.0
Via: SIP/2.0/TLS 19x.1xx.0.1xx:3246
From: <sip:lynctest8#example.com>;tag=2257063211;epid=22570632
To: <sip:lynctest8#example.com>
Call-ID: A2B000F95CB8XZRikcdYitb4QBvEr4P2
CSeq: 3 REGISTER
Contact: <sip:19x.1xx.0.1xx:3246;transport=tls;ms-opaque=28c9d310c1>;methods="INVITE, MESSAGE, INFO, OPTIONS, BYE, CANCEL, NOTIFY, ACK, REFER, BENOTIFY";proxy=replace;+sip.instance="<urn:uuid:6b6590c5-2a3f-5dee-ad87-5ab6694cf66d>"
Max-Forwards: 70
User-Agent: UCCAPI/4.0.7577.0 OC/4.0.7577.0 (Microsoft Lync 2010)
Supported: gruu-10, adhoclist, msrtc-event-categories
Supported: ms-forking
Supported: ms-cluster-failover
Supported: ms-userservices-state-notification
Ms-keep-alive: UAC;hop-hop=yes
Event: registration
Ms-subnet: 19x.1xx.0.0
Proxy-Authorization: NTLM qop="auth", realm="SIP Communications Service", opaque="8CEED616", targetname="lyncfe.example.com", version=4, gssapi-data="TlRMTVNTUAADAAAAGAAYAKgAAADGAMYAwAAAABAAEABYAAAALAAsAGgAAAAUABQAlAAAABAAEACGAQAAVYKQYgYBsR0AAAAPAAAAAAAAAAAAAAAAAAAAAG4AZQB5AGUAYgBhAGwAbABsAHkAbgBjAHQAZQBzAHQAOABAAG4AZQB5AGUAYgBhAGwAbAAuAGMAbwBtAEUAWQBFAEIAQQBMAEwALQBQAEMA9jYBMVaneo2SEFBrg1/YnLPWl4gGzCyjeTg+SJIb99jnRvh/xOM1KQEBAAAAAAAAAD9j2kfbzAGz1peIBswsowAAAAACABAATgBFAFkARQBCAEEATABMAAEADABMAFkATgBDAEYARQAEABgAbgBlAHkAZQBiAGEAbABsAC4AYwBvAG0AAwAmAGwAeQBuAGMAZgBlAC4AbgBlAHkAZQBiAGEAbABsAC4AYwBvAG0ABQAYAG4AZQB5AGUAYgBhAGwAbAAuAGMAbwBtAAcACABjQk/rRdvMAQAAAAAAAAAAGL4kYo+YoVBEmij7AkIylQ==" , crand="becdaa89", cnum ="1", response="0100000024A95BA08AA3947964000000"
Content-Length: 0
The response that I get from server is in log is......
TL_INFO(TF_COMPONENT) [0]05FC.02D0::01/25/2012-08:06:57.900.00000042 (SIPStack,CSIPMessage::CacheConnectionFlags:SIPMessage.cpp(1664))[0]( 00000000039B4DC0 ) From server [lyncfe.example.com] connection, flags [PeerInternal TrafficInternal 0xa0100c], CID [0x12300]
TL_INFO(TF_PROTOCOL) [0]05FC.02D0::01/25/2012-08:06:57.900.00000043 (SIPStack,SIPAdminLog::TraceProtocolRecord:SIPAdminLog.cpp(125))$$begin_record
Trace-Correlation-Id: 4074196035
Instance-Id: 000018F0
Direction: incoming;source="internal edge";destination="external edge"
Peer: lyncfe.example.com:5061
Message-Type: response
Start-Line: SIP/2.0 401 Unauthorized
From: <sip:lynctest8#example.com>;tag=1672455111;epid=16724551
To: <sip:lynctest8#example.com>;tag=6E92C85AEBAC66461CD3D9E7FF35D674
CSeq: 3 REGISTER
Call-ID: CDEA0494B083GDXKgQYZ3IuhqvqePNLL
Date: Wed, 25 Jan 2012 08:06:57 GMT
WWW-Authenticate: NTLM realm="SIP Communications Service", targetname="lyncfe.example.com", version=4
WWW-Authenticate: TLS-DSK realm="SIP Communications Service", targetname="lyncfe.example.com", version=4, sts-uri="https://lyncfe.example.com:443/CertProv/CertProvisioningService.svc"
Via: SIP/2.0/TLS 19x.1xx.0.2xx:60027;branch=z9hG4bK72A5FBC9.AAC299504F0761A1;branched=FALSE;ms-received-port=60027;ms-received-cid=16B9100
Via: SIP/2.0/TLS 19x.1xx.0.1xx:3082;received=2xx.xx.1xx.1xx;ms-received-port=3082;ms-received-cid=12700
ms-diagnostics: 1000;reason="Final handshake failed";HRESULT="0xC3E93EC3(SIP_E_AUTH_UNAUTHORIZED)";source="lyncfe.example.com"
Server: RTC/4.0
Content-Length: 0
Message-Body: –
$$end_record
What is the problem here? Can you give any hints/solutions to solve it?
It most likely due to SSL handshake while end point "https://lyncfe.example.com:443/CertProv/CertProvisioningService.svc". Please check your client certs and also enable SSL debug to see what's happening during handshake.
Thanks, Everyone. My problem has been solved. It was GSS-API-data and auth-token generation problem.

Resources