Socket exception - no connection could be made
Closed this issue · 7 comments
Hi.
trying to use mailsort.exe with -h localhost. However I get Socket exception - no connection could be made because the target machine actively refused it. But testing with telnet open localhost 143 all works ok and connection works. So I can try any url none works. What is wrong with mailsort.exe on server 2008r2?
thanks
Am I understanding correctly you are trying to run MailSort on the same server you have the mail server installed on?
Can you try specifying the --ssl
flag? This will try to connect via port 993.
It would be great if you could post the entire command (make sure to omit your password), so I can see if there is anything else going on.
Thanks for coming back. yes mailsort is running on local server where mail server is on standard non ssl imap port 143. so the call was
mailsort - h localhost - u email -p pass -s false -c config.json
mailsort - h 127.0.0.1 - u email -p pass -s false -c config.json
mailsort - h 127.0.0.1:143 - u email -p pass -s false -c config.json
all gave the same error: Socket exception - no connection could be made because the target machine actively refused it -> it looks like it goes to bad IP or bad Port or both
telnet open 127.0.0.1 143 --> results in * OK IMAPrev1 so all good...
conclusion: It looks like -s false is not accepted as command line and it always goes port 993 as UseSSl is always true
I found an issue with the -s
flag. Specifying -s false
still makes MailSort connect via SSL. I fixed it and pushed a new version (1.2.1). Can you try using the new version and the --no-ssl
flag? You don't need to specify --no-ssl true
, the presence of the flag means MailKit won't connect using SSL.
Hi collin. Yes -s false would be great. However omitting -s flag defaults currently to true which is bad. Better is no -s flag results UseSSl false.
Hi, since I want SSL connection to be the default, I now included a --no-ssl flag to disable it. Can you try that?
thanks. it connects now. Solved with --no-ssl !
Glad to hear that!