Discussion:
Send an alert on master user login
Andre Rodier
2014-10-09 09:36:52 UTC
Permalink
Hello,

I want to know if there is an option in Dovecot to send an alert, or run
a script when someone is using the master user facility.

I can do something myself with fail2ban, but maybe there is an option in
Dovecot?

Thanks.
Andr?.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: andre.vcf
Type: text/x-vcard
Size: 235 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20141009/5df4f267/attachment.vcf>
Andre Rodier
2014-10-09 12:04:10 UTC
Permalink
Hello Again,

It's more complex than I thought to do this with fail2ban, especially
when using the web mail.

So, I am asking again, if anyone knows how to run a custom script every
time master user is used, I would be happy.

I already have a post login script, but I don't find any variable in the
environment that tell me if it's a master user login or not.

Thanks.
Post by Andre Rodier
Hello,
I want to know if there is an option in Dovecot to send an alert, or run
a script when someone is using the master user facility.
I can do something myself with fail2ban, but maybe there is an option in
Dovecot?
Thanks.
Andr?.
Andre Rodier
2014-10-09 12:07:36 UTC
Permalink
Post by Andre Rodier
Hello Again,
It's more complex than I thought to do this with fail2ban, especially
when using the web mail.
So, I am asking again, if anyone knows how to run a custom script every
time master user is used, I would be happy.
I already have a post login script, but I don't find any variable in the
environment that tell me if it's a master user login or not.
Thanks.
Post by Andre Rodier
Hello,
I want to know if there is an option in Dovecot to send an alert, or run
a script when someone is using the master user facility.
I can do something myself with fail2ban, but maybe there is an option in
Dovecot?
Thanks.
Andr?.
Hi again,

I found the variable passed to the script that refers to master user.

It's 'MASTER_USER'

Thanks.
Robert Schetterer
2014-10-09 13:34:41 UTC
Permalink
Post by Andre Rodier
Hello,
I want to know if there is an option in Dovecot to send an alert, or run
a script when someone is using the master user facility.
I can do something myself with fail2ban, but maybe there is an option in
Dovecot?
perhaps you can do it with scripts
but you should prefer trigger it out of log

however perhaps read

http://wiki2.dovecot.org/PostLoginScripting
Post by Andre Rodier
Thanks.
Andr?.
Best Regards
MfG Robert Schetterer
--
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstra?e 15, 81669 M?nchen

Sitz der Gesellschaft: M?nchen, Amtsgericht M?nchen: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein
Andre Rodier
2014-10-09 14:17:52 UTC
Permalink
Post by Andre Rodier
Hello,
I want to know if there is an option in Dovecot to send an alert, or run
a script when someone is using the master user facility.
I can do something myself with fail2ban, but maybe there is an option in
Dovecot?
Thanks.
Andr?.
I am answering to myself.

If anyone is interested, here a custom perl script to report master user
login functionality:

Regards,
Andr?.


-------------- next part --------------

[Email]
Dest=administrator at example.com
From=postmaster at example.com
Server=smtp1
Bcc=admin at example2.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: master-user-report.pl
Type: application/x-perl
Size: 1506 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20141009/da4c1c70/attachment.pl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: post-login.sh
Type: application/x-shellscript
Size: 303 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20141009/da4c1c70/attachment.bin>
Loading...