Mail client - run a program when receive an email

Joel Jaeggli joelja at darkwing.uoregon.edu
Wed Nov 10 18:59:52 UTC 2004


On Wed, 10 Nov 2004, Hardy Merrill wrote:

> Comments below.
>
> --- "Scot L. Harris" <webid at cfl.rr.com> wrote:
>
>> On Wed, 2004-11-10 at 12:46, Hardy Merrill wrote:
>>> For every email I receive I'd like to run a
>> program
>>> and have the program have access to the data in
>> the
>>> email.  It's been a while since I've used email on
>> Red
>>> Hat/Fedora (I got lazy and have been using yahoo
>> mail)
>>> - I used to use mutt with fetchmail and procmail
>> but
>>> never used that combination for anything like
>> this.
>>> Can it do that?  Can procmail kick off a program
>> and
>>> give the program the contents of the mail as
>> input?
>>>
>>> What other email clients can do that?  Can
>> evolution?
>>
>> Do you want the program to modify the email and pass
>> it on or just
>> analyze data in the email?
>
> I'm thinking of creating a football pool email app - I
> know this has probably been done a thousand times
> before, but I'd like to do it myself just for fun.
>
> My thought is to send members of the pool an email
> listing all the games, and having each member respond
> to the email with their picks.  My app would take in
> each email and run a script - the script would parse
> the email and ... etc.
>
> So the answer to your question is I just need the
> script to analyze the email - at this point I don't
> think the script needs to modify the email nor pass it
> on.  Actually, I do want the email "filtered" (or
> sent) to a "football pool" mail box, so the
> requirement is:
>   1. pipe email to script, and
>   2. send email to a specific mailbox

that really is the sort of thing you do in procmail.

take a look at man procmail and man procmailrc and look at the procmailex 
man page as well.

something like:

:0:
* ^Subject:.*football
football_pool

would deliver mails containing the subject including the word football to 
the football_pool folder...

> I plan to install and try Evolution.  If I can't get
> that to work I'll go the fetchmail/procmail/perl
> script/mutt route.
>
> Thanks!
>
> Hardy
>
>>
>> If you want to modify the message and pass it along
>> in it's modified
>> form then you probably want to look at using
>> procmail.  There are many
>> things you can do to a message in procmail including
>> modifying headers
>> and piping the message through another script or
>> program.  You can even
>> pass just the headers or the body of the message to
>> the pipe or the
>> whole thing.
>>
>> In evolution you can pipe the message to a an
>> external script or program
>> (such as spamassassin) but it will only get a return
>> code, you can not
>> modify the content of the message through evolution
>> filters.
>>
>>
>> --
>> Scot L. Harris
>> webid at cfl.rr.com
>>
>> If you would understand your own age, read the works
>> of fiction produced
>> in it.  People in disguise speak freely.
>>
>> --
>> fedora-list mailing list
>> fedora-list at redhat.com
>> To unsubscribe:
>> http://www.redhat.com/mailman/listinfo/fedora-list
>>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Check out the new Yahoo! Front Page.
> www.yahoo.com
>
>
>

-- 
-------------------------------------------------------------------------- 
Joel Jaeggli  	       Unix Consulting 	       joelja at darkwing.uoregon.edu 
GPG Key Fingerprint:     5C6E 0104 BAF0 40B0 5BD3 C38B F000 35AB B67F 56B2




More information about the users mailing list