Re: A user's last access time

2020-10-21 Thread infoomatic


On 21.10.20 18:27, @lbutlr wrote:
> How is SQLite different from MySQL? I have both on my system. They are both 
> on-disk database files.
>

sqlite is accessed through a library, data is stored in a file. whereas
mysql needs a running service/daemon (which takes care of storing the
data into files)



Re: A user's last access time

2020-10-21 Thread @lbutlr
On 20 Oct 2020, at 20:08, Victor Sudakov  wrote:
> @lbutlr wrote:
>> On 19 Oct 2020, at 20:31, Victor Sudakov  wrote:
>>> I have seen this but I do not want this information in a database. 
>> …
>> 
>>> Even a local sqlite database would do.
>> 
>> What?
>> 
> 
> This meant that an external DMBS/daemon process (MySQL, Redis etc) was not
> desirable, but any on-disk format Dovecot can save the data in was fine
> with me. The sqlite format too.

How is SQLite different from MySQL? I have both on my system. They are both 
on-disk database files.


-- 
'They come back to the mountains to die,' said the King. 'They live
in Ankh-Morpork.' --The Fifth Elephant



Re: A user's last access time

2020-10-20 Thread Victor Sudakov
@lbutlr wrote:
> On 20 Oct 2020, at 00:33, Aki Tuomi  wrote:
> > plugin {
> > 
> >last_login_dict = file:/somewhere/lastlogin
> > 
> > }
> 
> It may be worth nothing that this can be specified as ~/.lastlogin
> As well as something along the liens of /usr/local/virtual/%d/%u/.lastlogin
> 
> Dovecot is smart enough to do the expansion per user in the ~

Thanks for the hint.

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/


signature.asc
Description: PGP signature


Re: A user's last access time

2020-10-20 Thread Victor Sudakov
@lbutlr wrote:
> On 19 Oct 2020, at 20:31, Victor Sudakov  wrote:
> > I have seen this but I do not want this information in a database. 
> …
> 
> > Even a local sqlite database would do.
> 
> What?
> 

This meant that an external DMBS/daemon process (MySQL, Redis etc) was not
desirable, but any on-disk format Dovecot can save the data in was fine
with me. The sqlite format too.

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/


signature.asc
Description: PGP signature


Re: A user's last access time

2020-10-20 Thread @lbutlr
On 20 Oct 2020, at 00:33, Aki Tuomi  wrote:
> plugin {
> 
>last_login_dict = file:/somewhere/lastlogin
> 
> }

It may be worth nothing that this can be specified as ~/.lastlogin
As well as something along the liens of /usr/local/virtual/%d/%u/.lastlogin

Dovecot is smart enough to do the expansion per user in the ~

The contents of the file are simply the epoch times stamp of the last login and 
the string

"shared/last-login/%u"

As far as I can tell, though I suppose %u may vary by config?

(It makes much more sense to me to put this information into the user database 
than into a text file, but that's neither here nor there).

-- 
"Are you pondering what I'm pondering?"
Pinky: (holding one of the pointy pieces from Sorry! and the bottle
of Slick 'n Slide) I think so, Br...
Brain: [shuts Pinky's mouth] No, on second thought, don’t tell me...
I don't think they allow that in a book with the Comics Code.



Re: A user's last access time

2020-10-20 Thread @lbutlr
On 19 Oct 2020, at 20:31, Victor Sudakov  wrote:
> I have seen this but I do not want this information in a database. 
…

> Even a local sqlite database would do.

What?

-- 
I desire the things that will destroy me in the end.



Re: A user's last access time

2020-10-20 Thread Victor Sudakov
Aki Tuomi wrote:
> 
> On 20.10.2020 9.30, Matthias Lay wrote:
> > Am Tue, 20 Oct 2020 09:31:16 +0700
> > schrieb Victor Sudakov :
> >
> >
> >> Hello Sami,
> >>
> >> I have seen this but I do not want this information in a database. If
> >> you know how to make the lastlogin_plugin write to a local file, that
> >> would be very helpful. Even a local sqlite database would do.
> >>
> >> The documentation for the plugin seems very scarce.
> >>
> >>
> > you could touch a file in the postlogin script
> 
> 
> You can use lastlogin plugin to write to a file too. It's not just database.
> 
> plugin {
> 
>    last_login_dict = file:/somewhere/lastlogin
> 
> }

Thanks, works this way. 

The contents of the lastlogin text file looks odd, but there is nothing AWK 
cannot transform :-)

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/


signature.asc
Description: PGP signature


Re: A user's last access time

2020-10-20 Thread Sami Ketola


> On 20. Oct 2020, at 5.31, Victor Sudakov  wrote:
> 
> Sami Ketola wrote:
>> 
>> 
>>> On 19. Oct 2020, at 18.54, Victor Sudakov  wrote:
>>> 
>>> Dear Colleagues,
>>> 
>>> Is there a file or directory within a user's Maildir, whose date of
>>> modification or access indicates the last time the user accessed his/her
>>> E-mail via IMAP or POP3?
>>> 
>>> I'd like to figure out the time a user last logged in into his/her mail
>>> account, not the last time a mail was delivered to the INBOX.
>>> 
>>> This information is probably available in the log, but a file which is
>>> touched each time a user accesses his/her mail, is more convenient.
>> 
>> Not directly but you might want to take a look at this: 
>> https://doc.dovecot.org/configuration_manual/lastlogin_plugin/
> 
> Hello Sami,
> 
> I have seen this but I do not want this information in a database. If
> you know how to make the lastlogin_plugin write to a local file, that
> would be very helpful. Even a local sqlite database would do.
> 
> The documentation for the plugin seems very scarce.

As you have already been told dict can be a file too. There just performance 
limits in writing to file dict.

Sami



Re: A user's last access time

2020-10-20 Thread Reio Remma

On 20/10/2020 05:31, Victor Sudakov wrote:

Sami Ketola wrote:



On 19. Oct 2020, at 18.54, Victor Sudakov  wrote:

Dear Colleagues,

Is there a file or directory within a user's Maildir, whose date of
modification or access indicates the last time the user accessed his/her
E-mail via IMAP or POP3?

I'd like to figure out the time a user last logged in into his/her mail
account, not the last time a mail was delivered to the INBOX.

This information is probably available in the log, but a file which is
touched each time a user accesses his/her mail, is more convenient.

Not directly but you might want to take a look at this: 
https://doc.dovecot.org/configuration_manual/lastlogin_plugin/

Hello Sami,

I have seen this but I do not want this information in a database. If
you know how to make the lastlogin_plugin write to a local file, that
would be very helpful. Even a local sqlite database would do.

The documentation for the plugin seems very scarce.



I think you should be able to use sqlite just as well as MySQL.

https://wiki.dovecot.org/Dictionary

Good luck!
Reio


Re: A user's last access time

2020-10-20 Thread Aki Tuomi

On 20.10.2020 9.30, Matthias Lay wrote:
> Am Tue, 20 Oct 2020 09:31:16 +0700
> schrieb Victor Sudakov :
>
>
>> Hello Sami,
>>
>> I have seen this but I do not want this information in a database. If
>> you know how to make the lastlogin_plugin write to a local file, that
>> would be very helpful. Even a local sqlite database would do.
>>
>> The documentation for the plugin seems very scarce.
>>
>>
> you could touch a file in the postlogin script


You can use lastlogin plugin to write to a file too. It's not just database.

plugin {

   last_login_dict = file:/somewhere/lastlogin

}

Aki




signature.asc
Description: OpenPGP digital signature


Re: A user's last access time

2020-10-20 Thread Matthias Lay
Am Tue, 20 Oct 2020 09:31:16 +0700
schrieb Victor Sudakov :


> Hello Sami,
> 
> I have seen this but I do not want this information in a database. If
> you know how to make the lastlogin_plugin write to a local file, that
> would be very helpful. Even a local sqlite database would do.
> 
> The documentation for the plugin seems very scarce.
> 
> 

you could touch a file in the postlogin script


pgpWpDkrJRnrj.pgp
Description: Digitale Signatur von OpenPGP


Re: A user's last access time

2020-10-19 Thread Victor Sudakov
Sami Ketola wrote:
> 
> 
> > On 19. Oct 2020, at 18.54, Victor Sudakov  wrote:
> > 
> > Dear Colleagues,
> > 
> > Is there a file or directory within a user's Maildir, whose date of
> > modification or access indicates the last time the user accessed his/her
> > E-mail via IMAP or POP3?
> > 
> > I'd like to figure out the time a user last logged in into his/her mail
> > account, not the last time a mail was delivered to the INBOX.
> > 
> > This information is probably available in the log, but a file which is
> > touched each time a user accesses his/her mail, is more convenient.
> 
> Not directly but you might want to take a look at this: 
> https://doc.dovecot.org/configuration_manual/lastlogin_plugin/

Hello Sami,

I have seen this but I do not want this information in a database. If
you know how to make the lastlogin_plugin write to a local file, that
would be very helpful. Even a local sqlite database would do.

The documentation for the plugin seems very scarce.


-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/


signature.asc
Description: PGP signature


Re: A user's last access time

2020-10-19 Thread Sami Ketola



> On 19. Oct 2020, at 18.54, Victor Sudakov  wrote:
> 
> Dear Colleagues,
> 
> Is there a file or directory within a user's Maildir, whose date of
> modification or access indicates the last time the user accessed his/her
> E-mail via IMAP or POP3?
> 
> I'd like to figure out the time a user last logged in into his/her mail
> account, not the last time a mail was delivered to the INBOX.
> 
> This information is probably available in the log, but a file which is
> touched each time a user accesses his/her mail, is more convenient.

Not directly but you might want to take a look at this: 
https://doc.dovecot.org/configuration_manual/lastlogin_plugin/

Sami



A user's last access time

2020-10-19 Thread Victor Sudakov
Dear Colleagues,

Is there a file or directory within a user's Maildir, whose date of
modification or access indicates the last time the user accessed his/her
E-mail via IMAP or POP3?

I'd like to figure out the time a user last logged in into his/her mail
account, not the last time a mail was delivered to the INBOX.

This information is probably available in the log, but a file which is
touched each time a user accesses his/her mail, is more convenient.

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/