LUA sendmail script executes multiple times

Please post here if you have problems in using Wing FTP Server.
Post Reply
andrewr_scl
Posts: 1
Joined: Mon Mar 28, 2011 9:29 am

LUA sendmail script executes multiple times

Post by andrewr_scl »

I have created a FTP Event to Write Log OnFileUploaded
This creates %Name_%DD%MM%YYYY.txt and appends a line for each file uploaded.
This works as expected.

I have also created another FTP Event OnUserDisconnect
This runs the following LUA Script:

if ("%Name" == "ACME") then c_SendMail("user@email.co.uk","%Name FTP Activity","Please check log for file upload activity","D://logs/Upload/%Name/%Name_%DD%MM%YYYY.txt","SMTP1")
end

This executes on disconnect, sends the email with the log file attached.
Sounds perfect EXCEPT the email is sent 3 times. Any ideas?
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: LUA sendmail script executes multiple times

Post by FTP »

I don't think so, when this event is triggered, the lua script will be executed for one time. You can verify it with a simple script like this:

c_AddAdminLog("%Name logged out",1)


It will just add an admin log.
DomDis
Posts: 33
Joined: Sat Mar 18, 2023 7:44 pm

Re: LUA sendmail script executes multiple times

Post by DomDis »

FTP wrote: Tue Mar 29, 2011 3:12 am c_AddAdminLog("%Name logged out",1)
I tried doing a search on c_AddAdminLog from the forum index but it came up empty

What other types are available for loging ?
What other logs can I have my scripts write to ?
Post Reply