Email Alerts notification from sftp accounts before expire

Please post here if you have problems in using Wing FTP Server.

Email Alerts notification from sftp accounts before expire

Postby puneet » Fri Jan 11, 2019 4:33 pm

Hi Team,

We need help as we have many account in wingftp which are set as password based so we need to configure email notification shot for password expiration reaching to threshold XX days

Your help would be appreciable.
puneet
 
12
 
Thu Apr 05, 2018 7:28 am

Re: Email Alerts notification from sftp accounts before expi

Postby FTP » Thu Jan 17, 2019 5:50 pm

Maybe you can use Task scheduler to execute the Lua script (once a day), like the following code:

Code: Select all
do
   --Get user list from domain "domain1"
   local strUserlist = c_GetUserList("domain1")
   local userlist = Split(strUserlist,"\n")

   for _,username in pairs(userlist) do
      local user = c_GetUser("domain1",username)
      local expiretime_t = c_TranslateTime(user.expiretime)

      if user.enable_expire == true and (expiretime_t - os.time()) / 3600*24 == 30 then
   c_SendMail(user.note_email, "FTP Account Expiration","Dear "..username..",\r\n\r\n Your FTP account will be expired soon...","","SMTP")
      end
   end
end
FTP
Site Admin
 
1636
 
Tue Sep 29, 2009 6:09 am


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests