Postfix - Passing email to a script
Mike Marchywka
marchywka at hotmail.com
Fri Jan 29 23:47:25 UTC 2021
On Fri, Jan 29, 2021 at 06:58:29PM +0000, David Fletcher wrote:
> Hi all,
>
> I'm developing a solution for distributing GPX route files to those who
> want to use them on smartphones instead of paper printed directions for
> navigating suggested routes with a classic car club. My idea is to give
> to anybody who wants the GPX file an email address which will trigger
> my mail server to send a reply with the GPX file attached.
I'm not sure what exists for this but I wrote my own thing
that is basically for what you suggest. Right now, I'm using
fetchmail and some scripts to monitor a yahoo account and
send back camera or other information from a remote machine
with no fixed IP address using neomutt. I'm in the process of making
a more integrated c++ version using a library I made
from neomutt as well as libetpan. I call the thing "mikemail"
for now and the only reason to discuss it so far
is this thing on collecting diet diary information and
returning reports,
https://www.linkedin.com/posts/marchywka_adding-artwork-activity-6748265617696059392-b3Ej
Thee are probably a lot of systems that do this as automated
email echanges are common. However, I got started on a bunch of
pieces and it seemed useful to integrate it and get rid
of things like fetchmail.
>
> At the moment I have working from the aliases file:-
> emailexperiments: "|/home/emailexperiments/autoreplytesting"
>
> which calls the script
> #!/bin/bash
>
> read header
> fromaddr=$(echo $header | cut -d' ' -f 2)
> sendEmail \
> -q\
> -f noreply at thefletchers.net\
> -t $fromaddr\
> -u "Autoreply testing"\
> -m Autoreply from server
>
> Put together from results of various Google searches. This appears to
> be working so far, tested by me from my own server and a friend using
> gmail. All I then need to do is add the attachment to the sendEmail
> call.
>
> The read command appears (IANAE) to fetch the next line from the email
> with each call. So far that first line contains
> From address at example.com etc etc
> BUT my question is, will it ALWAYS be the first line that contains the
> sender's address or do I need to use a loop to make certain I always
> find it?
>
> Thanks as always to all those who know and understand more than I do!
>
> Dave
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
--
mike marchywka
306 charles cox
canton GA 30115
USA, Earth
marchywka at hotmail.com
404-788-1216
ORCID: 0000-0001-9237-455X
More information about the ubuntu-users
mailing list