Discussion:
Appending contents to file
Danny de Bont
2016-01-21 15:34:47 UTC
Permalink
Hi guys,

Currently I am managing my Debian servers via simple commands in the
Subject of a mail message with an empty body ...

Procmail would read the Subject and then perform a certain command ...

For example:
If I want to start an Ftp server I would send an email with "Ftp start" as
the subject ... it works o.k for my needs ...

However ... I want to send more complicated commands in the Body and not
the Subject ...

For example:
When procmail gets an email with say "Execute command" in the Subject ... I
want procmail to pipe the command contained in the body (a one line BASH
command) to BASH ...

Here is an example of a command I would send in the Body:
echo -e "\rLT 4>Body of email message\r\r" > /dev/ttyS1

Any pointers?

Danny
udi M
2016-01-21 16:13:33 UTC
Permalink
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
***@lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
Danny de Bont
2016-01-21 20:02:28 UTC
Permalink
Thank you Sir ... it works like a charm ... however I have noticed a
problem with my implementation ... I have to type the whole command every
time ... and most of the time I use my cell phone to do it ...

How would I go about sending the the body as a variable to a BASH script?

Thank you
Danny
Post by Danny de Bont
Hi guys,
Currently I am managing my Debian servers via simple commands in the
Subject of a mail message with an empty body ...
Procmail would read the Subject and then perform a certain command ...
If I want to start an Ftp server I would send an email with "Ftp start" as
the subject ... it works o.k for my needs ...
However ... I want to send more complicated commands in the Body and not
the Subject ...
When procmail gets an email with say "Execute command" in the Subject ...
I want procmail to pipe the command contained in the body (a one line BASH
command) to BASH ...
echo -e "\rLT 4>Body of email message\r\r" > /dev/ttyS1
Any pointers?
Danny
:0
* Subject: Execute command
{
:0 bf
| /bin/bash
}
____________________________________________________________
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
Bob Holtzman
2016-01-21 21:17:09 UTC
Permalink
On Thu, Jan 21, 2016 at 06:13:33PM +0200, udi M wrote:

..........snip..........
<blockquote
type="cite"><br>
<pre wrap="">____________________________________________________________
procmail mailing list Procmail homepage: <a class="moz-txt-link-freetext" href="http://www.procmail.org/">http://www.procmail.org/</a>
<a class="moz-txt-link-freetext" href="http://mailman.rwth-aachen.de/mailman/listinfo/procmail">http://mailman.rwth-aachen.de/mailman/listinfo/procmail</a></pre>
</blockquote>
<br>
</body>
</html>
Most mailing lists prohibit html posts. If this one doesn't, it should!
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
Julian H. Stacey
2016-01-22 00:07:46 UTC
Permalink
Post by Bob Holtzman
..........snip..........
<blockquote
type="cite"><br>
<pre wrap="">____________________________________________________________
procmail mailing list Procmail homepage: <a class="moz-txt-link-freetext" href="http://www.procmail.org/">http://www.procmail.org/</a>
<a class="moz-txt-link-freetext" href="http://mailman.rwth-aachen.de/mailman/listinfo/procmail">http://mailman.rwth-aachen.de/mailman/listinfo/procmail</a></pre>
</blockquote>
<br>
</body>
</html>
Most mailing lists prohibit html posts. If this one doesn't, it should!
Agreed !
On lists I run, I enforce that with /etc/mail/aliases
a sample roughly like this, (less my multiple server complexity):

LIST: LIST-***@servers
LIST-0: "|/usr/local/bin/demime -8 -|/usr/local/majordomo/wrapper \
resend -l LIST -h servers LIST-outgoing"
LIST-outgoing: :include:/usr/local/majordomo/lists/LIST, \
LIST-***@list0, LIST-digest-***@list0

Only problem is, demime is a perl script that was taken out of newer
versions of FreeBSD & its replacement /usr/ports/mail/emil/ cores
occasionaly, & I need to upgrade OS, so if people reccomend other
better modern filters, I'd be interested.

A bunch of URLs & notes here:
http://berklix.com/~jhs/src/bsd/fixes/freebsd/ports/gen/mail/demime/README.no_customise

Cheers,
Julian
--
Julian Stacey, BSD Linux Unix Sys. Eng. Consultant Munich http://berklix.eu
Mail plain text, No quoted-printable, HTML, base64, MS.doc.
Prefix old lines '> ' Reply below old, like play script. Break lines by 80.
Loading...