[Last Call] Learn how to a build a cloud-first strategyRegister Now


Retrieve Last Login of email account via IMAP / POP3 / WEBMAIL

Posted on 2007-08-01
Medium Priority
Last Modified: 2013-12-17

I'm looking to programmatically retrieve the last login date of a particular email account via IMAP, POP3, or the webmail client that we offer. I'm failry sure I can figure out the webmail client thing myself, but where I'm stuck is IMAP and POP3.

We use courier for IMAP and postfix for POP3 on a linux box. I need any kind of a command or something to retrieve either all logins and the date the logged in, or per account and I'll look through them myself.

I've been looking on the internet and I've seen nothing that is even remotely close. I'm not a very good googler =P

Any help would be mucho appreciated. Thank you!

(ill be responding to this topic very quickly, so dont go anywhere!)

P.S. We use squirrelmail as our webmail client.
Question by:digitalpacman
LVL 25

Accepted Solution

Cyclops3590 earned 1500 total points
ID: 19614155
postfix isn't a pop3 server, its smtp only

I use courier as well, but it depends where the syslog conf file is configured to deliver those log messages
cat /etc/syslog.conf | grep mail
will tell you where to look
then what I do is this
cat <<log file>> | egrep "(imapd|pop3d)" | grep <<username>> | tail -1
not elegant, but it gets the job done for me.  then if you wanted to you could make that into a bash script where it accepts one parameter, the username, for easier usage later.

Author Comment

ID: 19614825
Thanks I will try that tommorow... well my sysadmin is what told me these things are. I'm a programmer.. so I just write their perl scripts and assist in hardware/software changes.. but only theoritical I don't deal in that world.

But thanks I'll try that hopefully it works my boss is ridin me hard for this =p

(we are reaching max diskspace so we need to write a cleanup script that disables unused accounts)

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Want to know how to use Exchange Server Eseutil command? Go through this article as it gives you the know-how.
The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month17 days, 23 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question