Re: Sending a new email with maildrop/mailbot

Larry Stone <[email protected]>
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
On Dec 5, 2013, at 6:49 PM, Sam Varshavchik <[email protected]> wrote:

> Larry Stone writes:
> 
>> 
>> So far, for the Maildrop equivalent, I've come up with using mailbot
>> (from reading the man page, it appears reformail is not the tool for
>> this) is:
>> if (/^From:.*REDACTED/ && \
>>     /^Subject:.*key subject/ && \
>>     /.*key text/:b && \
>> {
>>     `grep -i "key text" > .tmpmailfilter`
>>     cc "|/usr/local/bin/mailbot -t .tmpmailfilter \
>>       -A 'From: [email protected]' \
>>       -N -s "Key" /usr/sbin/sendmail -f '' [email protected]"
>>     `rm .tmpmailfilter`
>> }
>> 
>> This works so my only concern is that it is not optimal. Is there a way to
>> avoid using the temporary file by using a variable like in the procmail
>> recipe? Also, I tried setting the destination with [email protected]
>> but if IIRC, correctly, that caused it to go to the original sender as
>> well.
> 
> Something like this:
> 
> if (/^From:.*REDACTED/ && \
>  /^Subject:.*key subject/ && /.*key text.*/:b)
> {
>     cc "| (echo 'From: [email protected]'; echo 'Subject: key'; sed -n '/^From:/d;/^Subject:/d;1,/^$/p';"' echo "$MATCH") | /usr/sbin/sendmail -f "" [email protected]'
> }


Hmmm. Never even thought about building a message on the fly and just piping it to sendmail. But sure, that would work. But is something missing there? I know little about sed (always found other ways to do things) but where is $MATCH getting defined?

-- 
Larry Stone
[email protected]
http://www.stonejongleux.com/

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk

_______________________________________________
Courier-maildrop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
smime.p7s (application/pkcs7-signature, 4.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.