I want to use the mini-stamp-server to build a mail server. I wrote this simple code:
require 'mini-smtp-server'
class StdoutSmtpServer < MiniSmtpServer
def new_message_event(message_hash)
puts "#New email received:"
end
end
server = StdoutSmtpServer.new(2525, "127.0.0.1", 4)
server.start
server.join
I don't know how to send mail to the server, e.g., foo#127.0.0.1:2525 doesn't work.
Any idea?
In the most fundamental way, you can see if your mail server is working by using telnet to connect to it.
Once connected, by doing
telnet 127.0.0.1 2525
Then typing at the prompt:
EHLO your_username
This will verify that your mail server is working.
There are several references to troubleshooting SMTP protocol with telnet on the web.
Sending e-mail to it then is as you would any other mail server.
Related
I use actual version of phpMailer (downloaded yesterday from github). It sends mails from my local computer (Win10, xampp 7.4.3) and can't send it from server (centOs7, nginx, php7). Both computers in one LAN behind the same firewall.
I suspect php.ini configuration, but what should be configured exactly?
Thanks for any help.
The solution:
# sudo setsebool -P httpd_can_sendmail 1
The tracking of my search:
Switch on the DebugMode in phpMailer (for each new PHPMailer object):
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->SMTPDebug = 4;
Checking out 'Console' tab output in Chrome DevTools:
SMTP ERROR: Failed to connect to server: Permission denied (13)
Googling for the error text - https://stackoverflow.com/a/50302148/9751142
Hope this helps anybody else.
I try that in cmd telnet mail.server.com 25 but i got this error Could not open connection to the host, on port 25: Connect failed I used different port but i got the same error
Thanks in Advance!!
Port 25 is basically restricted these days to mail servers talking to teach others. Clients wishing to submit mail for delivery should use port 587.
I'm a mac user. I see that I can send mails on my command line with mail command. However I can't see when and how it was configured.
I checked postfix and sendmail configs but it didn't help.
If I check var/log/mail.log , I can see that mails are relayed to gmail smtp server : gmail-smtp-in.l.google.com
So, where is my mail configuration?
I created a custom FTP server using .NET 4.0. I am running both the client and server on the same Windows 7 machine, and my firewall is entirely disabled. I can connect to it using both FileZilla and FtpUse, establish PASV mode, and browse the contents of folders just fine. The problem comes in when attempting to connect via Windows Explorer. I can log in successfully, but when Explorer sends the PASV command (see client/server exchange below) Explorer pops up a message box that says "FTP Folder Error", "An error occurred opening that folder on the FTP Server. Make sure you have permission to access that folder". The details that follow are the last two responses it received from the server. I found this (http://support.microsoft.com/kb/2754804/en-us) update and installed it, but it didn't help. Anyone have any ideas what this could be? I open the TCP listener before returning a response from the PASV command, so I don't think it's a question of timing.
<< 220 ***********.
>> USER Domain\******
<< 331 Password required.
>> PASS *******
<< 230 Domain\****** logged in.
>> opts utf8 on
<< 200 OPTS UTF8 command successful - UTF8 encoding now on.
>> syst
<< 215 Windows_NT.
>> site help
<< 200
<< 200 End of help.
>> PWD
<< 257 "/".
>> TYPE A
<< 200 Type set to A.
>> PASV
<< 227 Entering Passive Mode (10,0,0,4,7,100)
Originally, I thought the problem might be related to
Windows explorer hangs up FTP connection after PASV command
But I tried opening the passive port ahead of time and it didn't help. Instead, the problem is related to the strictness of Windows Explorer. The IP address supplied as part of the 227 response must be identical to the address of the FTP site the client initially connected. In other words, if the client connects using
ftp://localhost
(which resolves to 127.0.0.1), the IP address provided with the PASV response MUST be 127.0.0.1 - otherwise, Windows Explorer will error. This is not to say that the passive port can't be opened with IPAddress.Any - it can:
var listener = new TcpListener(IPAddress.Any, 0)
However, the address returned with the result must still be 127.0.0.1 (using the above as an example). If the client initially connects with the IP of the machine, say 10.x.x.x for example, the IP address returned with the 227 response must also be 10.x.x.x.
FileZilla must somehow be more forgiving.
I'm trying to connect to a FTPS (explicit TLS FTP) server within a shell script and i'm kinda confused.
I tried using the regular FTP command, but i get 534 error "policy requires SSL" and 504 "Security mechanism not implemented"
ftp -inuv myhost
Returns 504 then
quote USER myuser
Returns 534
I also tried sftp but i get "couldn't read packet: connection reset by peer".
That damn peer is making my life a nightmare since IRC ;)
sftp myuser#myhost:mydirectory/ -P21
Connexion reset by peer and it says it can't connect to port 22, which is weird since i specified port 21...
Thanks for your help
There is a diference between ftps and sftp : sftp is ftp over ssh, so in your case you cannot use sftp. ftps is ftp that use ssl/tls
You need an ftp client that manages TLS, for instance http://lftp.yar.ru/ (found on the net)