Page 1 of 1

Email Alerts notification from sftp accounts before expire

Posted: Fri Jan 11, 2019 4:33 pm
by puneet
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.

Re: Email Alerts notification from sftp accounts before expi

Posted: Thu Jan 17, 2019 5:50 pm
by FTP
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