Re: Getting xfilter AND delivery to working

Philip Rhoades <[email protected]> Fri, 05 Feb 2016 10:56:14 +1100
Newsgroups gmane.mail.maildrop
Message-ID <25d0ce1eb4a6a979cd46fee8fb06db84@localhost>
Milan,


On 2016-02-05 10:14, Milan Obuch wrote:
> On Fri, 05 Feb 2016 09:09:48 +1100
> Philip Rhoades <[email protected]> wrote:
> 
>> Milan,
> 
> [ snip ]
> 
>> > So let me reiterate:
>> > - you receive mail
>> > - you need to extract attachment from it
>> > - you need to save original mail to designated folder
>> >
>> > Did I understand it right?
>> 
>> Correct.
>> 
> 
> Nice, so see below.
> 
> [ snip ]
> 
>> You are probably right but I don't see how that helps solve the
>> problem . . I think it might be easier to take out the xfilter line,
>> let the mail be delivered as normal and set up an inotifywait script
>> to watch for new files in the appropriate mail dir and then process
>> them with my Ruby script . .
>> 
> 
> No need to do it this way. All you need is just two lines:
> 
> `/home/phil/bin/bash_internal_variables.sh > /home/phil/t`
> to $DEFAULT/.tst/


You must have missed my previous comment - while that DID work in terms 
of creating the "t" file - the "to" line did NOT work - I just tried it 
again - still not working . . this also failed:

   xfilter `/usr/bin/date > /home/phil/t`
   to $DEFAULT/.tst/


> (and replace bash_internal_variables.sh with your real script). That's
> all. Believe me, just try it. I did. And I am doing various things with
> maildrop. Some trial and error, some man pages reading is all that's
> required.


Well I don't know what is wrong with my setup then . .


> Now, we can go a bit deeper. If your original mail is correctly
> structured according MIME standard, which should be the norm nowadays,
> you could just use reformime. In my case, I use in one recipe the
> following:
> 
> PA=`reformime -e -s 1.1`
> 
> If mail MIME structure is the same everytime, there is nothing more to
> do, in your case, it could become
> 
> `reformime -e -s 1.2 > /home/phil/t`
> to $DEFAULT/.tst/
> 
> and you will have in file /home/phil/t just the attachment you wanted.
> You just need to adjust -s argument according your mail structure.
> It is possible to test structure with reformime with no arguments.
> For first experiments with reformime, you could just use
> 
> reformime < some_file_name_with_saved_mail
> 
> to check structure and then add some arguments to do other useful
> things.


That is interesting but I have to do some processing on the attachment 
before saving the output.


> Caveat: I am using full Courier mail suite, so I am not sure reformime
> is part of standalone maildrop package you are using, but I think it
> is.


Yes, I have it.

Thanks,

Phil.
-- 
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [email protected]

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140