rebol esmtp failure? - rebol

I wanted to try esmtp with smtp.hotpop.com
esend myfriend#yahoo.com "Test"
using http://www.rebol.org/view-script.r?script=esmtp.r and
http://www.rebol.org/view-script.r?script=esend.r
but it fails.
What's wrong ?
Here is all the information you should need to help you set up your mail client:
* Incoming/POP Server: pop.hotpop.com, port 110
* Alternate POP Server: pop.hotpop.com, port 1100
* Username: reboltutorial#HotPOP.com
* Outgoing/SMTP Server: smtp.hotpop.com, port 25*
* Email Address: reboltutorial#HotPOP.com
* Reply-To Address: reboltutorial#HotPOP.com (or any other email address you have)
* Leave Messages on server: false (some clients will instead have a "Delete messages from server" option, which should be set to true).
* Maximum Message Size: 500 KB (512000 bytes)
* Mailbox Size: 10 MB
* Mailbox Usage: 0.0% (0.0 KB)
*HotPOP's outgoing (SMTP) mail server requires authentication. The username and password are the same as the POP Server and website. Do not select "secure" password authentication.

Well, I couldn't get much of a response from this site .. and there are 100+ questions to answer to signup for their free service.
But esmtp is now built into the latest rebol binaries. no need to use one from the library.
so ...try the following
set-net [ reboltutorial#hotpop.com smtp.hotpop.com ]
trace/net on
send reboltutorial#hotpop.com "testing"
and see what error message comes up.
the protocol should ask you for your userid and password so that you can authenticate.

Related

Wallet pass push notifications APNs

So I have completed all the signing and compressing process for Apple passes and have been able to connect the pass to my server for updating. The only problem I have left to solve is implementing push notifications.
I have been trying for a couple of days now but just can't seem to manage and I think I am missing something really simple. I am not too proficient with networking so I would really appreciate the help.
This is the log I get from guzzle with my best try.
Trying 17.188.136.150:443... * TCP_NODELAY set * Connected to api.push.apple.com (17.188.136.150) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /usr/local/etc/openssl/cert.pem CApath: /usr/local/etc/openssl#1.1/certs * SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305 * ALPN, server accepted to use h2 * Server certificate: * subject: CN=api.push.apple.com; OU=management:idms.group.533599; O=Apple Inc.; ST=California; C=US * start date: Mar 14 17:50:10 2019 GMT * expire date: Apr 12 17:50:10 2021 GMT * subjectAltName: host "api.push.apple.com" matched cert's "api.push.apple.com" * issuer: CN=Apple IST CA 2 - G1; OU=Certification Authority; O=Apple Inc.; C=US * SSL certificate verify ok. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * Failed sending HTTP POST request * Connection #0 to host api.push.apple.com left intact
I am using the same certificate I used for the pass I am trying to update and am sending the device token I received upon registering the pass. This is my php code.
$client = new Client();
try {
$result = $client->post('https://api.push.apple.com:443', [
'headers' => ['apns-id' => <pass_type_id> , ':path' => '/3/device/<device_id_received_upon_registration>'],
'json' => ['apns'=>''],
'debug'=>true,
'version'=>2.0,
'ssl_key' => [<path_to_key>, <key_password>],
'cert' => [<path_to_certificate (same one used for signing pass)>, <certificate_password>]]);
}
catch (GuzzleHttp\Exception\ClientException $e) {
dd($e);
}
I am really lost with this one. Please help me out. I also tried connecting to port 1295 with some other code I copy pasted but it wasn't working as it should and had even more difficulty debugging as I am more familiar with port 443.
It works for me, with small changes:
$pem_file = '<path_to_your_pem_file_including_private_key>';
$pem_secret = '<private_key_password>';
$url = "https://api.push.apple.com/3/device/" . $device_push_token;
$response = $client->post($url, [
'headers' => ['apns-topic' => $pass_type_id],
'json' => json_decode('{}'),
'debug' => true,
'version' => 2.0,
'cert' => [$pem_file, $pem_secret]
]);
var_dump($response->getStatusCode());
var_dump($response->getReasonPhrase());
What is changed is the payload that needs to be empty JSON object (but present) and the header name for the topic, it is apns-topic not apns-id. I also constructed the URL directly, not via the headers and used a pem file with private key included in it, not sure if those matter.
Maybe you should also check what you pass at the end of the URL, it is not the device_id, but the device_push_token.
NB: remember to always send the wallet push notification to the production apple endpoint, not the sandbox!

mbsync authentication failed

I was able to configure mbsync and mu4e in order to use my gmail account (so far everything works fine). I am now in the process of using mu4e-context to control multiple accounts.
I cannot retrieve emails from my openmailbox account whereas I receive this error
Reading configuration file .mbsyncrc
Channel ombx
Opening master ombx-remote...
Resolving imap.ombx.io... ok
Connecting to imap.ombx.io (*.*.10*.16*:*9*)...
Opening slave ombx-local...
Connection is now encrypted
Logging in...
IMAP command 'LOGIN <user> <pass>' returned an error: NO [AUTHENTICATIONFAILED] Authentication failed.
In other posts I've seen people suggesting AuthMechs Login or PLAIN but mbsync doesn't recognizes the command. Here is my .mbsyncrc file
IMAPAccount openmailbox
Host imap.ombx.io
User user#openmailbox.org
UseIMAPS yes
# AuthMechs LOGIN
RequireSSl yes
PassCmd "echo ${PASSWORD:-$(gpg2 --no-tty -qd ~/.authinfo.gpg | sed -n 's,^machine imap.ombx.io .*password \\([^ ]*\\).*,\\1,p')}"
IMAPStore ombx-remote
Account openmailbox
MaildirStore ombx-local
Path ~/Mail/user#openmailbox.org/
Inbox ~/Mail/user#openmailbox.org/Inbox/
Channel ombx
Master :ombx-remote:
Slave :ombx-local:
# Exclude everything under the internal [Gmail] folder, except the interesting folders
Patterns *
Create Slave
Expunge Both
Sync All
SyncState *
I am using Linux Mint and my isync is version 1.1.2
Thanks in advance for any help
EDIT: I have run a debug option and I have upgraded isync to version 1.2.1
This is what the debug returned:
Reading configuration file .mbsyncrc
Channel ombx
Opening master store ombx-remote...
Resolving imap.ombx.io... ok
Connecting to imap.ombx.io (*.*.10*.16*:*9*)...
Opening slave store ombx-local...
pattern '*' (effective '*'): Path, no INBOX
got mailbox list from slave:
Connection is now encrypted
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Openmailbox is ready to
handle your requests.
Logging in...
Authenticating with SASL mechanism PLAIN...
>>> 1 AUTHENTICATE PLAIN <authdata>
1 NO [AUTHENTICATIONFAILED] Authentication failed.
IMAP command 'AUTHENTICATE PLAIN <authdata>' returned an error: NO [AUTHENTICATIONFAILED] Authentication failed.
My .msyncrc file now contains these options instead
SSLType IMAPS
SSLVersions TLSv1.2
AuthMechs PLAIN
At the end, the solution was to use the correct password. Since openmailbox uses an application password for third-party e-mail clients I was using the wrong (original) password instead of the application password.

Pentaho PDI - Mail using gmail account Connection timed out

Whilst trying to send email using GMAIL on the PDI job, I face a connection timed out error.
Settings were as give below
SMTP ->smtp.gmail.com
Port -> 465 (also tried with 587 and 25)
And followed by SSL connection with my full credentials.
This is the error I am getting
2016/08/24 11:56:48 - Mail - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : Problem while sending message: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
java.net.ConnectException: Connection timed out: connect
I see a similar open question here but with little help
Any help?
by using below server configuration i used to send mail from PDI
1.SMTP ->smtp.gmail.com
2.Port -> 465
3. use authentication [check this]
4.authentication user (use your gmail id)
5.authentication password (use your gmail password)
6.use secure authentication
7. secure connection type = SSL
when this job will execute in your gmail account a security concern mail will be sent by gmail team and you need to allow that security check

cpanel mail forwarding not working

Forwarding is (I believe) set up correctly.Messages sent to domain addresses this morning that should have been forwarded have not been received by the target email account
result of /var/log/exim_mainlog is as follows
2015-04-02 02:31:22 1YdY8G-0004Ol-Ve == to#emailid (from#emailid) R=lookuphost T=remote_smtp defer (110): Connection timed out
2015-04-02 02:31:22 1YdY8G-0004Ol-Ve ** to#emailid : retry timeout exceeded
Please try to setup your mail forward to different mail account. I think your mail server IP is block on remote server and due to that you are getting timeout in mail logs.

Authentication on a very low level TCP Server written for Node.JS?

How do I implement something similar to the HTTP Basic authentication, in a TCP server written for Node.JS ? The code for a basic TCP server is the following:
// Load the net module to create a tcp server.
var net = require('net');
// Setup a tcp server
var server = net.createServer(function (socket) {
// Every time someone connects, tell them hello and then close the connection.
socket.addListener("connect", function () {
console.log("Connection from " + socket.remoteAddress);
socket.end("Hello World\n");
});
});
// Fire up the server bound to port 7000 on localhost
server.listen(7000, "localhost");
// Put a friendly message on the terminal
console.log("TCP server listening on port 7000 at localhost.");
While there are several ways to provide authentication over a TCP connection, all require some form of "protocol" being an agreed-upon communications grammar/syntax.
For example, in the Simple Mail Transport Protocol, the following conversation occurs (where S: and C: designate lines provided by the SMTP server and email client, respectively):
S: 220 server.example.com
C: HELO client.example.com
S: 250 server.example.com
C: MAIL FROM:<sender#example.com>
S: 250 2.1.0 sender#example.com... Sender ok
C: RCPT TO:<recipient#example.com>
S: 250 recipient <recipient#example.com> OK
C: DATA
S: 354 enter mail, end with line containing only "."
C: full email message appears here, where any line
C: containing a single period is sent as two periods
C: to differentiate it from the "end of message" marker
C: .
S: 250 message sent
C: QUIT
S: 221 goodbye
In replies from the server, the initial numeric value indicates the success or failure of the requested operation, or that the reply contains an informational message. Using a three digit numeric value allows for efficient parsing as all replies beginning with 2xx indicate success, 3xx are informational, 4xx indicate protocol errors, and 5xx are reserved for server errors. See IETF RFC 5321 - https://www.rfc-editor.org/rfc/rfc5321 for the full protocol.
So in your specific case, you might consider something as simple as:
[connect to TCP server]
S: ? # indicates the server is ready for authorization
C: username password # send authentication credentials
The server would then reply with:
S: ! # indicates successful authentication and
# that server is ready for more commands
Or
S: ? # indicates authentication failure
If too many failed attempts to authenticate are seen, the server might sever the connection to reduce the potential for abuse, such as DDOS attacks.
Once authenticated, the client could send:
C: > # begin streaming
Or any other command you which to support.