Long time lurker, first time poster. I’ve got a Virtualmin GPL box up and running, serving up about 20 virtual domains at the moment. I’d really love to be able to see when last each user logged in to get their mail.
Is this even possible?
Possible, sure. A common enough desire for us to add a button or menu item for it? No way.
Every IMAP and POP login is logged in /var/log/maillog. You can trivially grep out all such logins. It gets a little trickier to make some sort of easily read report out of this data…You could use Perl or Ruby or Python to build an associative array (aka hash) of the user logins it sees keyed to the username. At the end, it would naturally contain the last login of all users that it saw in the log file. About ten lines of Perl.
If you have no idea what I’m talking about, let me know, and I’ll see about taking out ten minutes and writing those ten lines for you.
if you use qmail+vpopmail you can use smth like this:
clear passwd: gh35U$h3w
limits: No user limits set.
account created: Fri Jun 15 17:18:50 2007
last auth: Never logged in
stress on the "last auth: Never logged in " line
PS: forum has a bug, cant edit my messages
Thanks, but I’m using Postfix/Dovecot. I’m up to my eyeballs in other work at the moment, but I think a log parser is probably going to be pretty simple. I’ve been playing with Splunk as well to see if I can use that.
Looks like you are tracking a user’s last email login now. Quick question.
Are you grep’ing the log each time a user is brought up in the gui? Or are you tracking this to another flat file or database?
I’ll like to build a script to automate a report for a couple of my domains and dont mind grep’ing mail log to grab it, but if you are already tracking this elsewhere, I’ll pull from that.
I believe that information would be obtained using the collectinfo.pl cron job that runs every few minutes. That means it would be stored with all the other Webmin/Virtualmin data it gathers, though I don’t know the exact format or where specifically it’s stored… it may be in /etc/webmin/virtual-server/history.
You may be able to determine that by reviewing the collectinfo.pl code.