> Date: Thu, 14 Feb 2013 00:49:13 +0100
> From: Polytropon <free...@edvax.de>
> To: FreeBSD Questions <freebsd-questions@freebsd.org>
> Subject: Re-sending selected e-mail messages
>
> I need a way to automatically re-sent stored e-mail messages
> according to some criteria and like to ask for advice or
> suggestions for an already existing solution before I start
> reinventing the wheel. :-)
>
> The messages in question are stored in MH format. 
>
> What is the easiest way to do this without reinventing the wheel,
> or should I? :-)

procmail is your friend.

  cat ~/sent* |procmail -f resendrc

where resendrc is:

   emailaddr="f...@bar.baz"
 
   :0 
   *^To: *${emailaddr}
   *^Subject:\/.*$
   | formail -I "Subject: {resend} ${MATCH}" | $SENDMAIL -oi -t

Delete the 'formail' if you want the Subject: unmolested.


_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to