Client server login - delphi

I have a server available which can be reached via an IP address and port 22. The server can only be accessed via a username and password. If I send the assignment "getinfo" to the server, it will give some text which I need.
I can access this via an SSH client, like KITTY, but how do I do this in Delphi?
I assume that the TIdTCPClient component will suffice, but I do not understand how a login can be implemented.

Related

Postfix Connection Timeout for Outgoing Mail - Port 25 is ***not*** blocked by ISP

Many similar questions have been asked here, but most have the issue of port 25 being blocked by a cloud provider (i.e. DigitalOcean) or the ISP (i.e. Xfinity). I have neither of these problems, but still can't send outgoing mail.
I try to send outgoing mail, but get this error from posfix/smtp
connect to alt2.gmail-smtp-in.l.google.com[142.250.152.27]:25: Connection timed out
I am running a postfix from a spare laptop that is running Ubuntu Server, so I know it isn't a problem with a cloud provider. Additionally, I have Google Fiber, and they do not block any ports, including port 25. Just as a test, when I telnet to the above address, I can successfully connect.
$ telnet alt2.gmail-smtp-in.l.google.com 25
Trying 2607:f8b0:4001:c56::1a...
Connected to alt2.gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP x17si5369573iow.10 - gsmtp
Any ideas what the final blocker is? The one thing I can think of is my postfix main.cf variables below might need tweaking. Also, FYI I am running the postfix server in a Docker container.
mydestination = localhost.$mydomain, localhost
proxy_interfaces = X.X.X.X # Static IP of Google Fiber router that is externally facing to WAN
After some digging, I looked up my hostname on Realtime Blackhole Lists, or RBLs, and discovered that my hostname and therefore mail server were being rejected as spam by any mail server that checks the public RBLs.
The solution to this was to set up SPF, DKIM, and DMARC through my DNS provider. Each of these play a role in reducing hostname spoofing, spam email, and other malicious activites. There are many tutorials online on how to do this.
SPF is Sender Policy Framework. This is used to prevent others from spoofing your domain.
DKIM is DomainKeys Identified Mail. This allows the senders to authenticate their emails by including a digital signature in the email header. DKIM uses public-key cryptography to verify that an email message was sent from an authorized mail server.
DMARC is Domain-based Message Authentication Reporting & Conformance, which builds on SPF and DKIM to prevent domain spoofing.

Implementing Mail Server using TIdSMTPServer

I have acquired the domain name - xyz.in from GoDaddy.com and also acquired the mail ID - info#xyz.in. And currently, I can able to send 500 mails by using GoDaddy.
So, I'm thinking to implement my Mail Server using Delphi - TIdSmtpServer. I found few samples but for sending mails how can I use the sender ID as info#xyz.in and send mails. As I need to send only mails, what are the other settings and please provide some basic sample code.
Thanks in advance.
SMTP is one-way, from sender to receiver. You cannot send emails with TIdSMTPServer, only receive them. Your SMTP server needs to store received emails as needed for you to retrieve them later, via POP3/IMAP, or whatever custom system you want to make.
When someone wants to send an email to you at info#xyz.in, they perform a DNS lookup of the MX record for xyz.in, then connect to that server and issue SMTP commands to deliver the email to the info mailbox 1. So you need to configure your domain's DNS MX record to point at the IP address of your SMTP server machine.
To send an email from your system to someone else, use TIdSMTP instead, so it can connect to and send the email to the other person's SMTP server. You can use TIdDNSResolver to lookup a domain's MX records to find the IP address(es) to connect to 1.
1: most users send an outgoing email through their ISP's own SMTP server and let it relay the email to each recipient's domain SMTP server as needed. And use their ISP's SMTP server to receive emails. This is easier for users to use and configure, and it is safer as it allows ISPs to implement security and anti-spam measures. So you may end up sticking with GoDaddy's SMTP server instead of running your own in the long run.

Indy HTTP(s) reverse proxy

I'm trying to create a HTTP(s) proxy server that will act like this:
Browser configured to use proxy on 127.0.0.1:1080. On this port, I need to have a server (TIdTCPServer?) that will pass data coming to a client, that is connected on this same server (maybe into another port to make things easier). The client need to be connected, and not serving connection because of possible NAT restrictions.
The idea is that the client will execute the requests and send back to the server, which should send to the browser.
Browser > connect to local server > send to client connected which make the request
I thought about IdHTTPProxy, but no idea on how to pass request to a client, and client execute, gets back the data to the server / browser.
I read about TIdMappedPortTCP, but looks like this should connect into another host/port, and in my case the client can't receive connections.

freeRadius using EAP with custom auth script

I am attempting to setup a freeradius server to authenticate against a web service. The reason for this is that there is a complicated workflow involving account status and mac address. The workflow seemed out of place to be in freeradius. So my user names, and encrypted passwords are stored remotely to the radius server. Everything works fine using radclient to test. When I started using the the Access Point, I learned it only communicates with the radius server via eap-tls. This means that the User-Password argument is not available for my script.
Is there a way to have eap auth check for user authentication against my script? By this i mean, can i get the password to send to my secondary service?
Alternately, is there a way to get the User-Password from the encrypted eap-message data?
Access points don't usually place restrictions on the EAP type. The device connecting to the AP negotiates an EAP type with FreeRADIUS. If it's using EAP-TLS it's probably a windows machine that hasn't been configured to do anything different.
Investigate EAP flavours to find out which ones are available. If you have EAP-TTLS-PAP you can send the plaintext password from the wireless client, and user it to authenticate against the web service.
In FreeRADIUS v3.0.x there's a rlm_rest module, which can perform basic auth on behalf of the user, with very little configuration.

How to use TidSMTP when mailserver has no smtp but ip only

i developed an application that sends email messages using indy (idSMTP + SSL).
The idSMTP properties I expose to the user are simply:
host
user
password
anyway in some cases the users have an internal mailsender that doesn't have an smtp address, but simply an internal ip (like 192.168.48.63) and no user and no password.
i tried to set host = id but it doesn't work.
Could you sugeest a solution?

Resources