[Wolves] Email Addys
wolves at mailman.lug.org.uk
Tue Jul 22 15:17:00 2003
Wayne Morris spoo'd forth:
> Pretty much the only mail that reaches me is what I expect after
> spamfiltering, senders are either new contacts , replies to my
> The rest I would like to do the following with:
> New sender : add to my MySql database if not already there
> Sender with 'ferk off' in heading. mark as such in mysql
> The above I guess would be a pipey/strippy/savey operation?
Yeah. You want to read up a little on Exim filters; specifically, in
your .forward file, you want to pipe your message to a command. This
would be something like (this is untested, don't just do it!)
# Exim filter <- this bit is important
pipe /home/wayne/stick-it-in-mysql # pipe message to your command
save # save as normal in your local mailbox
Then stick-it-in-mysql would be a little script that grabs the sender
name and whether it says "ferk off", queries mysql for that sender
name, saves it as a new entry if it needs to, and tags it if it found
"ferk off". Write this in your choice of language; I'd do it in Python,
but I won't offer code because you may prefer something else.
> One thing that would be very cool for a similar operation would be a
> 'right click' mouse menu item - 'save highlighted item to sql database
> in field, or send it to php page x.php as post field 'email'
Evolution seems to be able to send a message to a shell command as part
of a filter. I don't know a way of kicking off this process on one
message on demand, though. This would mean that you could set up a
filter to apply to all new messages and use *that* to pipe the messages
to stick-it-in-mysql, rather than an Exim filter, if you were more
comfortable with that.
Have a play around, or we can talk about this further at a meeting...
Something must be Done
This is Something
Therefore, This must be Done
-- The Thatcherite Syllogism