smtp error on cpanel hosting when sending email - smtp

i have php mailer where i have contact form in my webpage. There if someone fill the details like Name, Contact, Email, message etc and click on Send button, the below error throwing in screen, but i could able to receive mails but this error message comes every time sending message.
SMTP -> FROM SERVER:220-astro.websitewelcome.com ESMTP Exim 4.85 #2
Thu, 30 Jul 2015 02:14:10 -0500 220-We do not authorize the use of
this system to transport unsolicited, 220 and/or bulk e-mail. CLIENT
-> SMTP: EHLO dpaxis.com SMTP -> FROM SERVER: 250-astro.websitewelcome.com Hello dpaxis.com [192.185.13.234]
250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN
250-STARTTLS 250 HELP CLIENT -> SMTP: AUTH LOGIN CLIENT -> SMTP:
aW5mb0BkcGF4aXMuY29t CLIENT -> SMTP: RGViYUA5ODE1UGVndQ== CLIENT ->
SMTP: MAIL FROM: SMTP -> FROM SERVER:250 OK CLIENT -> SMTP: RCPT TO:
SMTP -> FROM SERVER:250 Accepted CLIENT -> SMTP: DATA SMTP -> FROM
SERVER:354 Enter message, ending with "." on a line by itself CLIENT
-> SMTP: Date: Thu, 30 Jul 2015 02:14:10 -0500 CLIENT -> SMTP: Return-Path: CLIENT -> SMTP: To: dpaxis CLIENT -> SMTP: From: Test
Name CLIENT -> SMTP: Reply-To: Test Name CLIENT -> SMTP: Subject: TEST
CLIENT -> SMTP: Message-ID:
<7d74be28b53bdecd9f9eb5c06e9cd7ea#dpaxis.com> CLIENT -> SMTP:
X-Priority: 3 CLIENT -> SMTP: X-Mailer: PHPMailer 5.2.6
(https://github.com/PHPMailer/PHPMailer/) CLIENT -> SMTP:
MIME-Version: 1.0 CLIENT -> SMTP: Content-Type: multipart/alternative;
CLIENT -> SMTP: boundary="b1_7d74be28b53bdecd9f9eb5c06e9cd7ea" CLIENT
-> SMTP: Content-Transfer-Encoding: 8bit CLIENT -> SMTP: CLIENT -> SMTP: --b1_7d74be28b53bdecd9f9eb5c06e9cd7ea CLIENT -> SMTP:
Content-Type: text/plain; charset=iso-8859-1 CLIENT -> SMTP:
Content-Transfer-Encoding: 8bit CLIENT -> SMTP: CLIENT -> SMTP: Name:
Test Name Email: test#gmail.com Phone: 787848788748 Service: PHP /
MySQL Message: TEST This Form was submitted from:
http://dpaxis.com/dpaxisuc/coming-soon.html CLIENT -> SMTP: CLIENT ->
SMTP: CLIENT -> SMTP: --b1_7d74be28b53bdecd9f9eb5c06e9cd7ea CLIENT ->
SMTP: Content-Type: text/html; charset=iso-8859-1 CLIENT -> SMTP:
Content-Transfer-Encoding: 8bit CLIENT -> SMTP: CLIENT -> SMTP: Name:
Test Name

This is not an error message, it's just debug output. Disable it by setting $mail->SMTPDebug = 0;.
PHPMailer 5.2.6 is very old and buggy. Get the latest version and base your code on one of the examples you'll find on there too.
Also, please learn how to format your question so that it's actually readable.

Related

The repository does not have a GitHub Pages site. See https://docs.github.com/v3/repos/pages/

I have a Jekyll site published to Github Pages. I am trying to use the Github API to be able to schedule posts.
I can "Get a Github Pages site" with the API, https://docs.github.com/en/rest/pages?apiVersion=2022-11-28#get-a-github-pages-site
When I try to test the Github API for "Request a Github Pages build," it gives me the following error:
curl
-X POST
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer $Classic_Personal_Access_Token_with_all_permissions_for_testing"
-H "X-GitHub-Api-Version: 2022-11-28"
https://api.github.com/repos/aykchoe/aykchoe.github.io/pages/builds -vv
Trying 192.30.255.116:443...
Connected to api.github.com (192.30.255.116) port 443 (#0)
ALPN: offers h2
ALPN: offers http/1.1
CAfile: /etc/ssl/cert.pem
CApath: none
(304) (OUT), TLS handshake, Client hello (1):
(304) (IN), TLS handshake, Server hello (2):
(304) (IN), TLS handshake, Unknown (8):
(304) (IN), TLS handshake, Certificate (11):
(304) (IN), TLS handshake, CERT verify (15):
(304) (IN), TLS handshake, Finished (20):
(304) (OUT), TLS handshake, Finished (20):
SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
ALPN: server accepted h2
Server certificate:
subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=.github.com
start date: Mar 16 00:00:00 2022 GMT
expire date: Mar 16 23:59:59 2023 GMT
subjectAltName: host "api.github.com" matched cert's ".github.com"
issuer: C=US; O=DigiCert Inc; CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1
SSL certificate verify ok.
Using HTTP2, server supports multiplexing
Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
h2h3 [:method: POST]
h2h3 [:path: /repos/aykchoe/aykchoe.github.io/pages/builds]
h2h3 [:scheme: https]
h2h3 [:authority: api.github.com]
h2h3 [user-agent: curl/7.85.0]
h2h3 [accept: application/vnd.github+json]
h2h3 [authorization: Bearer $Classic_Personal_Access_Token_with_all_permissions_for_testing]
h2h3 [x-github-api-version: 2022-11-28]
Using Stream ID: 1 (easy handle 0x15600d800)
POST /repos/aykchoe/aykchoe.github.io/pages/builds HTTP/2
Host: api.github.com
user-agent: curl/7.85.0
accept: application/vnd.github+json
authorization: Bearer $Classic_Personal_Access_Token_with_all_permissions_for_testing
x-github-api-version: 2022-11-28
HTTP/2 403
server: GitHub.com
date: Sat, 14 Jan 2023 03:49:29 GMT
content-type: application/json; charset=utf-8
content-length: 203
x-oauth-scopes: admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages
x-accepted-oauth-scopes:
github-authentication-token-expiration: 2023-02-13 03:44:38 UTC
x-github-media-type: github.v3; format=json
x-github-api-version-selected: 2022-11-28
x-ratelimit-limit: 5000
x-ratelimit-remaining: 4996
x-ratelimit-reset: 1673671506
x-ratelimit-used: 4
x-ratelimit-resource: core
access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'
vary: Accept-Encoding, Accept, X-Requested-With
x-github-request-id: C127:4B9A:5325FBA:5629D14:63C22649
{
"message": "The repository does not have a GitHub Pages site. See https://docs.github.com/v3/repos/pages/",
"documentation_url": "https://docs.github.com/rest/pages#request-a-github-pages-build"
}
Connection #0 to host api.github.com left intact
From Googling, it seems like a permissions error (http 403), but not sure what I could be missing.
I tried both fine-grain token and classic.
I noticed my git user was different than the repo owner, so I added it as a collaborator.
I tried switching the git user to the repo owner.
I tried making a new Jekyll repo with Github Pages and running the API code.

Keyrock doesn't accept user, even when using admin

I got two users created by me, admin, with admin permissions, and another user, now with admin permissions too, but initially community (i'll be referring to this account as community).
I've registered an application with the community user and associated the admin later. As callbackUrl i've registered the address below in my keyrock instance
<keystone ip>:/oauth2/token
The request i am making to get oauth2 follows below, it uses https://raw.githubusercontent.com/Bitergia/fiware-chanchan-docker/master/images/pep-wilma/4.3.0/auth-token.sh as a guideline. I've changed the user,pass, host, client id and app secret
curl -s --insecure -i --header "Authorization: Basic NmJjODMyMWMzNDQwNGVlYzkwYzNhNzhlYTU0ZTE2NjY6M2YwMzQyZjE4ZTM1NGI0ZDg5YjhlYWVkNTZmNGI5Mjc=" --header "Content-Type: application/x-www-form-urlencoded" -X POST http://<keyrock IP>/oauth2/token -d 'grant_type=password&username=<user>&password=<pass>&client_id=<clientID>&client_secret=<secret>'
The request reaches the keystone and it replies with a 404 (access token not found).
When i try to get oauth2 tokens from keyrock for both the admin and the community, it says
Error: Root - User access-token not authorized
I can login in horizon with both users.
What did i miss in order to get a oauth2 token from idm?
Edit: Code used to create users:
users_default_pass = '...'
user0 = _register_user(keystone,"user0",passwd=users_default_pass)
keystone.roles.grant(user=user0.id,role=keystone.roles.find(name='community'), project=user0.default_project_id)
Edit2: raw response and response from keystone captured with tcpflow
request:
POST /oauth2/token HTTP/1.1
User-Agent: curl/7.35.0
Host: 130.206.118.xxx:5000
Accept: */*
Authorization: Basic ZWU2YmFjMWNjOTQ3NDdhNmI4MTU3NDdiNDk5NmVhZjQ6NTRkY2NjMjgxODhhNDMxYTk4OTY3MjkwN2UxYjIxYzY=
Content-Type: application/x-www-form-urlencoded
Content-Length: 143
grant_type=password&username=admin&password=admin&client_id=ee6bac1cc94747a6b815747b4996eaf4&client_secret=54dccc28188a431a989672907e1b21c6
write error to stdout
response:
HTTP/1.1 404 Not Found
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 93
Date: Wed, 09 Sep 2015 09:46:19 GMT
{"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}
write error to stdout
Took me a while to find it :)
In KeyRock, oauth2 is implemented in Horizon. Looking at your request, I've found couple things:
You are using HTTP instead of HTTPS
Requests are being sent against port 5000 (usually Keystone)
That made me think that your requests are going against Keystone.
By default, KeyRock handles oauth2 requests at Horizon, which means, use https and port 443. As you said, doing requests against Keystone fails:
HTTP/1.1 404 Not Found
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 93
Date: Wed, 09 Sep 2015 15:36:34 GMT
{"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}
Make sure you do the request against Horizon with HTTPS and port 443 and everything should work!

Error when posting data with cURL

I have written the following curl command.
curl -v -X POST -H 'Accept: application/json'
-H 'Content-Type: application/json' -u username:password
-d 'Id=5&Email=add#ress.com&OptInType=0&EmailType=0&DataFields=null&Status=0}'
https://api.dotmailer.com/v2/contacts
However when I run in Powershell, it returns the following error
"message":"Could not parse the body of the request based on the
content type\"application/json\"
ERROR_BODY_DOES_NOT_MATCH_CONTENT_TYPE"}
This is the verbose server response
Hostname was NOT found in DNS cache
Trying 94.143.104.204...
Connected to api.dotmailer.com (94.143.104.204) port 443 (#0)
successfully set certificate verify locations:
CAfile: C:\Program Files\cURL\bin\curl-ca-bundle.crt CApath: none
SSLv3, TLS handshake, Client hello (1):
SSLv3, TLS handshake, Server hello (2):
SSLv3, TLS handshake, CERT (11):
SSLv3, TLS handshake, Server finished (14):
SSLv3, TLS handshake, Client key exchange (16):
SSLv3, TLS change cipher, Client hello (1):
SSLv3, TLS handshake, Finished (20):
SSLv3, TLS change cipher, Client hello (1):
SSLv3, TLS handshake, Finished (20):
SSL connection using TLSv1.0 / AES128-SHA
Server certificate:
subject: C=GB; ST=England; L=London; OU=DDG; O=dotMailer Ltd; CN=*.dotmailer.com
start date: 2012-01-16 15:51:40 GMT
expire date: 2015-01-16 15:51:40 GMT
subjectAltName: api.dotmailer.com matched
issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Organization Validation CA - G2
SSL certificate verify ok.
Server auth using Basic with user 'username'
*POST /v2/contacts HTTP/1.1
*Authorization: Basic XXXpdXNlci0zNGFmNWU0NTdmYTJAYXBpY29ubmVjdG9yLmNvbTpzaW1vbmUxMjM=
User-Agent: curl/7.37.0
Host: api.dotmailer.com
Accept: application/json
Content-Type: application/json
Content-Length: 72
upload completely sent off: 72 out of 72 bytes
HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Date: Thu, 24 Jul 2014 08:46:46 GMT
Content-Length: 139
{"message":"Could not parse the body of the request based on the
content type \"application/json\"
ERROR_BODY_DOES_NOT_MATCH_CONTENT_TYPE"}
Connection #0 to host api.dotmailer.com left intact
Can anyone point me in the right direction for getting my command right?
Thanks.
Your data in -d doesn't seem to be in json format. Try jsonlint to validate json format. Or if you are trying to post text data, use text/plain as Content-type.

GMail AUTH LOGIN SMTP Authentication

I'm trying to authenticate myself against GMail SMTP Server by using the LOGIN authentication mechanism. AUTH LOGIN is advertised as supported in the response to the EHLO command, but when I'm trying to send AUTH LOGIN to the server, I'm getting "504 5.7.4 Unrecognized Authentication Type" response. Here is the dialog between the server and the client:
S: 220 mx.google.com ESMTP d9sm13589149wiy.2
C: EHLO client
S: 250-mx.google.com at your service, [x.x.x.x]
S: 250-SIZE 35882577
S: 250-8BITMIME
S: 250-AUTH LOGIN PLAIN XOAUTH
s: 250 ENHANCEDSTATUSCODES
C: AUTH LOGIN
S: 504 5.7.4 Unrecognized Authentication Type d9sm13589149wiy.2
Am I doing something wrong here?
Use STARTTLS first, negociate a security exchange SSL or TLS, then recall EHLO and then you can , i guess, use the PLAIN and LOGIN machanisms
What I've found out is that once I'm using "AUTH LOGIN base64username", which is not really how LOGIN should be working, it actually seems to work:
S: 220 mx.google.com ESMTP n3sm42168657wiz.9
C: EHLO client
S: 250-mx.google.com at your service, [x.x.x.x]
S: 250-SIZE 35882577
S: 250-8BITMIME
S: 250-AUTH LOGIN PLAIN XOAUTH
S: 250 ENHANCEDSTATUSCODES
C: AUTH LOGIN base64username
S: 334 UGFzc3dvcmQ6
C: base64password
S: 235 2.7.0 Accepted

openssl client SMTP with gmail port 587, no response (250 OK) from after <crlf>.<crlf>

I've been trying to use openssl to establish a connection with smtp.gmail.com port 587 or 465 with:
openssl s_client -host smtp.gmail.com -port 587 -starttls smtp
and the authentication, mail from, rcpt to, and data were all successful. but my problem is, after i write . in a new line, no 250 OK response from the server.
here is the process:
CONNECTED(00000003)
depth=1 /C=US/O=Google Inc/CN=Google Internet Authority
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
i:/C=US/O=Google Inc/CN=Google Internet Authority
1 s:/C=US/O=Google Inc/CN=Google Internet Authority
i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority
---
Server certificate
-----BEGIN CERTIFICATE-----
(certification)
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
issuer=/C=US/O=Google Inc/CN=Google Internet Authority
---
No client certificate CA names sent
---
SSL handshake has read 1910 bytes and written 338 bytes
---
New, TLSv1/SSLv3, Cipher is RC4-MD5
Server public key is 1024 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : RC4-MD5
Session-ID: 28E597C0025A93C82AD4A7C517F699B37D106D760597467B522C1041F1BC17C8
Session-ID-ctx:
Master-Key: 1CC83A8A4B7864DF9BBD9E9742B4E5A5937941EB2A28B88A1D4214920B77AC976D3ADC2DA7B60CF8BD6BC2B0712A42A2
Key-Arg : None
Start Time: 1296911515
Timeout : 300 (sec)
Verify return code: 20 (unable to get local issuer certificate)
---
250 ENHANCEDSTATUSCODES
ehlo
250-mx.google.com at your service, [121.94.150.147]
250-SIZE 35651584
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250 ENHANCEDSTATUSCODES
auth login
334 VXNlcm5hbWU6
<my email>
334 UGFzc3dvcmQ6
<my password>
235 2.7.0 Accepted
mail from:<email>
250 2.1.0 OK t14sm1471936icd.10
rcpt to:<email>
250 2.1.5 OK t14sm1471936icd.10
data
from: someone <email>
354 Go ahead t14sm1471936icd.10
to : someone <email>
subject: test
test
test2
.
451 4.4.2 Timeout - closing connection. t14sm1471936icd.10
read:errno=0
I am using cygwin in win7 32.
I've been searching for all of the possible keywords on google but no solution comes out.
PLEASE HELP!
Maybe add the '-crlf' option to the comand line :
openssl s_client -host smtp.gmail.com -port 587 -starttls smtp -crlf