last_login to track email logins

Version 1.532

Feature
Finished

The da-popb4smtp binary now has extra code to store the last login for each account. For virtual email accounts, stored here: /etc/virtual/domain.com/last_login/user for DA email logins (eg: login to /roundube as "user" without @domain), it's logged here: /usr/local/directadmin/data/users/username/last_login The format of the last_login file is fairly basic, a timestamp, followed by data, eg: when=1530843760&ip=127.0.0.1 During the backup/restore, this file will fall under the "E-Mail Data" category. ----------- Enhanced skin The last login info (date and IP) will show up in the "hover-over usage popup" window. Go to the email page, and hover your mouse over the usage for a given account. If they've logged in recently, the "Last Login" and "Last Login IP" will be in the popup. Json will have the data in the same page: emails{ #{  usage{ last_login{ ip and when where "when" will be the unix timestamp. ----------- DISABLED BY DEFAULT The directadmin binary will not show this data by default until caching and fast reading of the data is implemented. The internal default is: email_show_last_login=0 to enable it, add: email_show_last_login=1 to the directadmin.conf and restart DA. Note that the da-popb4smtp will always log the last_login, even if this settings it off. The setting only applies to directadmin and the dataskq.

Interested to try DirectAdmin? Get a 30-day Free Trial!