trigger script at login

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

trigger script at login

chongma
is it possible to trigger a script to run when a user logs in to send an
email?  ideally the script would also have access to username, ip
address and user agent?
Reply | Threaded
Open this post in threaded view
|

Re: trigger script at login

@lbutlr
On 2018-05-06 (09:21 MDT), Matthew Broadhead <[hidden email]> wrote:
>
> is it possible to trigger a script to run when a user logs in to send an email?

Depends on the software that controls logging in to send emails, I'd think.

That would not be postfix.

--
Vernon: Now this is the thought that wakes me up in the middle of the
night. That when I get older, these kids are going to take care of me
Carl: I wouldn't count on it.

Reply | Threaded
Open this post in threaded view
|

Re: trigger script at login

Wietse Venema
In reply to this post by chongma
Matthew Broadhead:
> is it possible to trigger a script to run when a user logs in to send an
> email?? ideally the script would also have access to username, ip
> address and user agent?

Many shell programs process the contents of a file after logging in.
Depending on the shell, that can be .login, .profile, /etc/profile, etc.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: trigger script at login

chongma
In reply to this post by @lbutlr
i have smtpd_sasl_auth_enable=true.  i am using dovecot which i guess
may be providing the sasl login mechansim.  thanks for pointing me in
the right direction


On 06/05/18 18:30, @lbutlr wrote:
> On 2018-05-06 (09:21 MDT), Matthew Broadhead <[hidden email]> wrote:
>> is it possible to trigger a script to run when a user logs in to send an email?
> Depends on the software that controls logging in to send emails, I'd think.
>
> That would not be postfix.
>

Reply | Threaded
Open this post in threaded view
|

Re: trigger script at login

André Rodier
On 06/05/18 22:23, Matthew Broadhead wrote:

> i have smtpd_sasl_auth_enable=true.  i am using dovecot which i guess
> may be providing the sasl login mechansim.  thanks for pointing me in
> the right direction
>
>
> On 06/05/18 18:30, @lbutlr wrote:
>> On 2018-05-06 (09:21 MDT), Matthew Broadhead
>> <[hidden email]> wrote:
>>> is it possible to trigger a script to run when a user logs in to send
>>> an email?
>> Depends on the software that controls logging in to send emails, I'd
>> think.
>>
>> That would not be postfix.
>>
>
Hello Matthew,

If you are using Dovecot, you can use the login script functionality,
which is probably what you want to do:

https://wiki.dovecot.org/PostLoginScripting

Kind regards,
André