hMailServer IssueTracker
Display defect
| ID |
173
|
| Short summary | Fails to attach file from network drive |
| Created | 2009-03-05 17:47:56 |
| Created by | LesD |
| Status | Resolved |
| Priority | 2 - High |
| Quick link | |
Applies to |
|
| Found in | 5.0 build 326 |
| Resolved in | 5.1 build 334 |
Problem |
|
|
Background to this problem can be found in forum thread
Note that hMailServer is running inside a VirtualBox VM. After a lot of testing and a comment from you about network files, I think I have the pattern of the problem worked out. The idea of this script is to act as an auto-responder. When a message is received, a rule is triggered which calls a script to email the sender a file as an attachment. If the attachment is a local file then there is no problem. However, if it is a UNC path then the first time such a message is received it fails on the .Save line (same error as if the path was invalid). If a second message is received soon after then it runs fine. Subsequent messages are OK until there is a gap between messages in the region of 15 to 20 minutes (variable) after which the cycle repeats. [I have a couple of secondary issues which I will mention briefly. The documentation seems to say (based on snippets of code) that the .From property is something like “Me” and not the full address. In practice this is not so – it is the full “Me |
|
Issue steps
By martin, 2009-03-05 18:12:07
Asked follow up question in the forum topic.
By LesD, 2009-03-05 18:18:14
Sorry, I forgot a title: Please add: Script failing to send email with UNC path attachment. Also the end of my post was chopped off:
By LesD, 2009-03-05 18:18:53
Secondly, the .FromAddress seems to be the Sender address. There does not seem to be a property for the “Reply-to” address which is the address to which replies should be sent if present in the header. This is also an issue with the built-in Auto-reply feature. It is replying to the Sender and ignoring the Reply-to address. I think that is wrong.]
By LesD, 2009-03-05 18:21:40
Below is some documentation of the main problem.
Script:
sub SendTrainingSchedule(oMessage)
dim nMessage
const wDebug = True
Set nMessage = CreateObject("hMailServer.Message")
nMessage.From = "Name <name@domain.org>"
nMessage.FromAddress = " name@domain.org "
nMessage.AddRecipient "", oMessage.FromAddress
nMessage.Subject = "Training Schedule"
nMessage.Attachments.Add("c:TempTraining Schedule.xls")
nMessage.Save
Set nMessage = nothing
end sub
==========================
Rule setup on Account: TrainingNews:
Receipt
Message size Greater than 0
Run function SendTrainingSchedule
Error log:
"ERROR" 460 "2009-03-05 09:04:43.424" "Script Error: Source: (null) - Error: 80020009 - Description: (null) - Line: 31 Column: 3 - Code: (null)"
Line 31 is: nMessage.Attachments.Add
Script:
sub SendTrainingSchedule(oMessage)
dim nMessage
const wDebug = True
Set nMessage = CreateObject("hMailServer.Message")
nMessage.From = "Name <name@domain.org>"
nMessage.FromAddress = " name@domain.org "
nMessage.AddRecipient "", oMessage.FromAddress
nMessage.Subject = "Training Schedule"
nMessage.Attachments.Add("c:TempTraining Schedule.xls")
nMessage.Save
Set nMessage = nothing
end sub
==========================
Rule setup on Account: TrainingNews:
Receipt
Message size Greater than 0
Run function SendTrainingSchedule
Error log:
"ERROR" 460 "2009-03-05 09:04:43.424" "Script Error: Source: (null) - Error: 80020009 - Description: (null) - Line: 31 Column: 3 - Code: (null)"
Line 31 is: nMessage.Attachments.Add
By martin, 2009-03-06 23:45:12
I've fixed for 5.1 so that if you try to attach a file which is unavailable, the error message is slightly better. But I don't see this as a bug.
By LesD, 2009-03-08 03:00:18
Accepted. Looks like the problem is caused by the VirtualBox VM in which hMailServer is running. UNC access to the server in which the VM is running causes no problem.
Reference from a script to a UNC path on the network seems to fail the first time and then works thereafter for up to about 20 minutes from the last access and then fails again. This is a general VBScript problem. For example .OpenTextFile behaves the same way as hMailServer code.
I have not done any testing of hMailServer outside of the VM but I would think it unlikely that under normal circumstances such a problem would remain undiscovered.
Reference from a script to a UNC path on the network seems to fail the first time and then works thereafter for up to about 20 minutes from the last access and then fails again. This is a general VBScript problem. For example .OpenTextFile behaves the same way as hMailServer code.
I have not done any testing of hMailServer outside of the VM but I would think it unlikely that under normal circumstances such a problem would remain undiscovered.
You must be logged on to add a step. Log on now.