Re: Bug in SMTP methods in 4D Internet Commands plugin

2019-02-12 Thread Tim Daniels via 4D_Tech
Spam filter on the receiving end? Maybe try sending to a different address,
preferably in a different email domain.

On Fri, Feb 8, 2019 at 3:26 PM Ben Kershaw via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Randy Engle wrote:
>
> >Received both emails  including:  " Invalid subject containing changed
> by” So… Something else is hokey-pokey
>
> I can’t figure what it’s all about. It fails using a brand new database,
> on two different machines, on two different networks, connected to two
> different SMTP servers. In 30 years of 4D development, this is the
> strangest issue I’ve seen.
>
> Thanks for testing it out. I figured it couldn’t be an IC plugin bug, but
> everything I saw pointed to that. Oh well - it’ll be fun finding out what
> it really is.
>
> Thanks,
> Ben Kershaw
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Bug in SMTP methods in 4D Internet Commands plugin

2019-02-08 Thread Ben Kershaw via 4D_Tech
Randy Engle wrote:

>Received both emails  including:  " Invalid subject containing changed by” So… 
>Something else is hokey-pokey

I can’t figure what it’s all about. It fails using a brand new database, on two 
different machines, on two different networks, connected to two different SMTP 
servers. In 30 years of 4D development, this is the strangest issue I’ve seen.

Thanks for testing it out. I figured it couldn’t be an IC plugin bug, but 
everything I saw pointed to that. Oh well - it’ll be fun finding out what it 
really is.

Thanks,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Bug in SMTP methods in 4D Internet Commands plugin

2019-02-07 Thread Randy Engle via 4D_Tech
Ben

I just tried this out with your code below.

Received both emails  including:  " Invalid subject containing changed by"

So...

Something else is hokey-pokey.

Randy Engle



-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Ben Kershaw via 
4D_Tech
Sent: Thursday, February 7, 2019 8:06 AM
To: 4d_tech@lists.4d.com
Cc: Ben Kershaw <4d...@bonaire-diver.com>
Subject: Bug in SMTP methods in 4D Internet Commands plugin

I've discovered a bug in the 4D Internet Commands SMTP methods. If the message 
subject contains the text "changed by", there won't be any errors returned but 
the e-mail will not be sent.

I've tested it on the following versions, all running on macOS 10.13.6
   * 4D 16.3HF4 64-bit, 4D Internet Commands 16.3 build 16.224100
   * 4D 16.4 64-bit build 16.226553, 4D Internet Commands 16.4 build 16.226553
   * 4D 16.4 32-bit build 16.226553, 4D Internet Commands 16.4 build 16.226553
   * 4D 17.0 build 17.225365

I've also tested it running under Windows server.

I've tested it on different machines, using different SMTP servers, on 
different networks. Same result. I find it hard to believe that having "changed 
by" in the message subject would cause the e-mail to not be sent, but my 
testing shows otherwise. Still, I've enclosed a small method below, and I'd 
appreciate it if others could try it out and let everyone know the result 
(you'll need to set the variables for the STMP server, addresses, and 
username/password if your SMTP server needs authentication).

This is a weird one. I'm assuming it's caused by some old debugging code that 
was left in place, but who knows.

Thanks,
Ben Kershaw


C_TEXT($tSMTPServer;$tEMailFrom;$tEMailTo;$tUserName;$tPassword)
C_LONGINT($lSMTPServerPort;$lMessageID;$lError;$lArrayElement)

$tSMTPServer:=""
$lSMTPServerPort:=25
$tUserName:=""
$tPassword:=""

$tEMailFrom:=""
$tEMailTo:=""

ARRAY TEXT($atSubject;0)
APPEND TO ARRAY($atSubject;"Valid subject")  //This will work fine APPEND TO 
ARRAY($atSubject;"Invalid subject containing changed by")  //This won't return 
an error, but the e-mail won't be sent

For ($lArrayElement;1;Size of array($atSubject))
$lMessageID:=0
$lError:=SMTP_New ($lMessageID)
$lError:=SMTP_Host ($lMessageID;$tSMTPServer)
$lError:=SMTP_From ($lMessageID;$tEMailFrom)
$lError:=SMTP_Subject ($lMessageID;$atSubject{$lArrayElement})
$lError:=SMTP_Body ($lMessageID;"This is the message body";2)
$lError:=SMTP_To ($lMessageID;$tEMailTo)
If ($lSMTPServerPort#25)
$lError:=IT_SetPort (2;$lSMTPServerPort)
End if 
If ($tUserName#"")
$lError:=SMTP_Auth ($lMessageID;$tUserName;$tPassword)
End if 
$lError:=SMTP_Send ($lMessageID)
$lError:=SMTP_Clear ($lMessageID)
End for
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Bug in SMTP methods in 4D Internet Commands plugin

2019-02-07 Thread Ben Kershaw via 4D_Tech
I've discovered a bug in the 4D Internet Commands SMTP methods. If the message 
subject contains the text "changed by", there won't be any errors returned but 
the e-mail will not be sent.

I've tested it on the following versions, all running on macOS 10.13.6
   * 4D 16.3HF4 64-bit, 4D Internet Commands 16.3 build 16.224100
   * 4D 16.4 64-bit build 16.226553, 4D Internet Commands 16.4 build 16.226553
   * 4D 16.4 32-bit build 16.226553, 4D Internet Commands 16.4 build 16.226553
   * 4D 17.0 build 17.225365

I've also tested it running under Windows server.

I've tested it on different machines, using different SMTP servers, on 
different networks. Same result. I find it hard to believe that having "changed 
by" in the message subject would cause the e-mail to not be sent, but my 
testing shows otherwise. Still, I've enclosed a small method below, and I'd 
appreciate it if others could try it out and let everyone know the result 
(you'll need to set the variables for the STMP server, addresses, and 
username/password if your SMTP server needs authentication).

This is a weird one. I'm assuming it's caused by some old debugging code that 
was left in place, but who knows.

Thanks,
Ben Kershaw


C_TEXT($tSMTPServer;$tEMailFrom;$tEMailTo;$tUserName;$tPassword)
C_LONGINT($lSMTPServerPort;$lMessageID;$lError;$lArrayElement)

$tSMTPServer:=""
$lSMTPServerPort:=25
$tUserName:=""
$tPassword:=""

$tEMailFrom:=""
$tEMailTo:=""

ARRAY TEXT($atSubject;0)
APPEND TO ARRAY($atSubject;"Valid subject")  //This will work fine
APPEND TO ARRAY($atSubject;"Invalid subject containing changed by")  //This 
won't return an error, but the e-mail won't be sent

For ($lArrayElement;1;Size of array($atSubject))
$lMessageID:=0
$lError:=SMTP_New ($lMessageID)
$lError:=SMTP_Host ($lMessageID;$tSMTPServer)
$lError:=SMTP_From ($lMessageID;$tEMailFrom)
$lError:=SMTP_Subject ($lMessageID;$atSubject{$lArrayElement})
$lError:=SMTP_Body ($lMessageID;"This is the message body";2)
$lError:=SMTP_To ($lMessageID;$tEMailTo)
If ($lSMTPServerPort#25)
$lError:=IT_SetPort (2;$lSMTPServerPort)
End if 
If ($tUserName#"")
$lError:=SMTP_Auth ($lMessageID;$tUserName;$tPassword)
End if 
$lError:=SMTP_Send ($lMessageID)
$lError:=SMTP_Clear ($lMessageID)
End for 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**