With all those good tips from the list I had a go as well - phew!! Too
many details to take care of. :-(
One comment: to the list of conditions for finding a msg worth replying to
(by returning a vacation msg) I have added the ast line, ignoring msgs
generated by cron or lpd:
* ^To: .*YOUREMAIL
* !^FROM_DAEMON
* !^Approved-By:
* !^BestServHost:
* !^List-Id:
* !^Resent-(Message-ID|Sender):
* !^Sender: .*-errors@
* !^Sender: owner-
* !^X-[^:]*-List:
* !^X-(Authentication-Warning|Listprocessor-Version|Mailman-Version):
* !^X-Sent-To:
* !^X-Loop: YOURNAME out of office
* !$^From +$LOGNAME(@| |$)
Two questions:
Is there an easier way calling sed without having to do all that quoting
calling sed a second time to make sure sed (the first) doesn't barf?
:0
* ^Subject: \/.*
{ }
:0 hfw
| formail -rI"Precedence: junk" \
-I"Subject: Out of office [$MATCH]" \
-A"X-Loop: volker out of office"
:0 bfw
| ( S="`echo $MATCH | sed -e 's,/,\\/,g' -e 's/&/\\\\&/g' `"; \
sed -e 's/\$SUBJECT/'"$S"'/g' <$PROCDIR/procmail_vacationmsg; \
echo ""; \
awk '{print "> "$0}'; )
Can the awk part be done by sed as well? My answer is no, but I don't
know sed too well. I know it could be done by either GNU awk or solaris
nawk, but definitely not by solaris awk as that's so obnoxiously limited,
but this raises a compatibility issue.
Thanks
Volker