Topic: Sending mails by VBS-scripts (Windows)
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx):nginx
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
====
Hi, friends
I'm trying to use my mail server to send messages by VBS-scripts (CDO)
I use this construction to send messages through yandex:
Dim o_Mess, v_Conf
v_Conf = "[url]http://schemas.microsoft.com/cdo/configuration/[/url]"
Set o_Mess = CreateObject("CDO.Message")
With o_Mess
.To = "admin@mydomain.com" 'receiver
.From = "kalyan <myyamail@ya.ru>" 'sender name and e-mail
.Subject = "Test CDO_msg s" 'mail subject
.TextBody = msg 'message body
With .Configuration.Fields
.Item(v_Conf & "sendusing") = 2
.Item(v_Conf & "smtpserver") = "smtp.yandex.ru"
.Item(v_Conf & "smtpauthenticate") = 1
.Item(v_Conf & "sendusername") = "myyamail@ya.ru"
.Item(v_Conf & "sendpassword") = "password"
.Item(v_Conf & "smtpserverport") = 465
.Item(v_Conf & "smtpusessl") = true
.Item(v_Conf & "smtpconnectiontimeout") = 30
.Update
End With
.send
End With
Set o_Mess = Nothing
It works, messages are well sent and received either. VBS-construction is checked and working
When I try to use the same code to send messages through my own server (I properly change server address, sender_e-mail and user credentials and can post here my changed file, though I don't see any avail of it) I get this error: something like "The transport failed to connect to the server" (error is in Russian)
this moment on my server pretty much information is captured in log (I enclosed file with it to avoid posting about 250 lines right here)
Could you help me to figure out the reason of "lost connection after CONNECT from unknown (my IP here as unknown)"?
STARTTLS
I tried also to use "sendtls" instead of "smtpusessl" :
Configuration.Fields.Item(v_Conf & "sendtls") = true
instead of
Configuration.Fields.Item(v_Conf & "smtpusessl")
and 587 tcp_port respectively and I've got error: "server response: 530 5.7.0 Must issue a STARTTLS command first"
with following information in log:
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 220 mailsrv.MYDOMAIN.com ESMTP Postfix
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: < unknown[192.168.1.122]: EHLO ntbor02
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: match_list_match: unknown: no match
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: match_list_match: 192.168.1.122: no match
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 250-mailsrv.MYDOMAIN.com
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 250-PIPELINING
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 250-SIZE 15728640
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 250-ETRN
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 250-STARTTLS
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 250-ENHANCEDSTATUSCODES
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 250-8BITMIME
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 250 DSN
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: < unknown[192.168.1.122]: MAIL FROM: <admin@orelcom.com>
Nov 11 09:03:59 mailsrv postfix/submission/smtpd[7234]: > unknown[192.168.1.122]: 530 5.7.0 Must issue a STARTTLS command first
Nov 11 09:05:11 mailsrv postfix/smtps/smtpd[7231]: idle timeout -- exiting
Nov 11 09:07:22 mailsrv postfix/submission/smtpd[7234]: < unknown[192.168.1.122]: QUIT
Later I've seen CDO doesn't support connection through STARTTLS, it is stated on microsoft site
So could you help me to make my VBS-scripts send messages through tcp_465_ssl\tls (with plain authentication or otherwise)
P.S.: I've enabled SMTPS previously, of course. It's accessible by telnet on 465 port and by MS_Outlook_mail_client either. So I can send mails using Outlook and SMTPS but I'm not able to use it right out of VBS-scripts
PPS.: I forgot to mention that line "smtpd_tls_auth_only = yes" is uncommented in main.cf postfix conf file
Appreciate any kind of your help here
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.