[PLUG] Execute Script Via Email

TomasK tomas.kuchta.lists at gmail.com
Fri Jan 22 06:28:53 UTC 2021


This seems to be such bad idea - security.

Would not it make sense to use some traceable, authenticated and secure
way of doing this - vpn or ssh to local network then ssh to the client?

Just saying, Tomas

PS:
I bet there are easier way to shoot yourself in the foot than making
computers execute stuff from email. Unless of course you are building
backdoor for the time you no longer work there.

On Thu, 2021-01-21 at 21:53 -0800, Ken Stephens wrote:
> I set up a printing queue in 1991 using a shell script that polled a
> directory for a file.  You could set up email users for each command
> and
> have the script poll the mail queues.  It would execute a given
> command for
> each user.  There is always another way to do it in Linux.
> 
> Ken
> 
> On Thu, Jan 21, 2021 at 7:35 PM Ben Koenig <techkoenig at gmail.com>
> wrote:
> 
> > 
> > On 1/21/21 12:05 PM, Ali Corbin wrote:
> > > On Thu, Jan 21, 2021 at 8:11 AM Michael Barnes <barnmichael at gmail
> > > .com>
> > > wrote:
> > > 
> > > > Is there a way to execute a script via email? I have a machine
> > > > that does
> > > > several monitoring tasks of equipment. When certain conditions
> > > > are
> > 
> > detected
> > > > and at scheduled times, the machine sends status emails to me.
> > > > I would
> > 
> > like
> > > > to send an email back to execute a script to perform tasks.
> > > > 
> > > > Is there an easy way to do this?
> > > > 
> > > 
> > > I  suspect that it's not easy, but I'm sure it's possible,
> > > because you
> > 
> > can
> > > set up blogger.com to create a post from an email sent to
> > 
> > someid at blogger.com
> > > . Unfortunately, the mechanism that actually does it will be on
> > > their
> > > servers in a place that's not visible.  Perhaps a google search
> > > might
> > > explain how they do this.
> > 
> > 
> > There are actually a few more steps in that process. Most web
> > interfaces
> > for blogs or support ticket databases are actually scanning a
> > configured
> > email inbox on a routine basis. Sometimes this is a cron job or
> > other
> > process running as a daemon on the web server. Every time this
> > process
> > scans the inbox, any new emails are parsed and operated on
> > according to
> > various filters.
> > 
> > 
> > I set one of these up back in 2019. We configured osTicket to scan
> > our
> > support@ inbox every 60 seconds. Any emails it found would be
> > ingested
> > as tickets in the SQL database and then moved to a "read" box for
> > archival purposes if osTicket went down. Pretty sure that was all
> > just
> > PHP code in osTicket...all I did was click buttons.
> > 
> > 
> > Blogs and other web frameworks do all kinds of things in respond to
> > email. Once an email client opens a message it can basically do
> > whatever
> > it wants. By default Thunderbird does every time an email is
> > received.
> > Those notifications you receive in the corner of your screen are
> > typically part of an external program, not your email client.
> > 
> > 
> > If your email client can execute 'notify-send "$EMAIL_SUBJECT"
> > "$EMAIL_BODY" ' in response to an email, it can execute any program
> > accessible to the user it runs as. Trying to do this as part of the
> > email server process seems like an excessive amount of work if you
> > ask me.
> > 
> > 
> > Sounds like all we need is an email client that supports running
> > arbitrary commands when filtering emails..
> > 
> > -Ben
> > 
> > _______________________________________________
> > PLUG: https://pdxlinux.org
> > PLUG mailing list
> > PLUG at pdxlinux.org
> > http://lists.pdxlinux.org/mailman/listinfo/plug
> > 
> 
> _______________________________________________
> PLUG: https://pdxlinux.org
> PLUG mailing list
> PLUG at pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug



More information about the PLUG mailing list