I have 2 quick (I hope) questions...
First, how do I add a carrige return to a string, for example I have a
statement like { ERR="error" }. I can generate the error message fine,
but wheen there are multiple errors they are all strung together. What
would I put in to add a linefeed to the above statement?
Secondly, I used a procmail rc file someone posted to this list (it has
been very helpful), but there is a problem shelling out (I think). Here
is what I have in the rc file:
# Get the subject
SUBJ=`formail -zxSubject: | sed -e `s/^Re: *//g'`
# Get the sender
SENDER=`formail -zxFrom: `
# Get the date
DATE="date"
# Any errors?
:0
* ERR ?? .
{
# replace the headers with a reply header
:0 fh
| formail -rt -I"Subject: Re: $SUBJ"
# replace the body with the error message(s), and quote the
# origional message
:0 fb
| ( echo $ERR ; sed -e 's/^/> /' )
-- cut here --
I get the following errors in my log file, and the message header comes
out somewhat screwed up:
-- cut here --
sed: option requires an argument -- e
Usage: sed [-nV] [--quiet] [--silent] [--version] [-e script]
[-f script-file] [--expression=script] [--file=script-file] [file...]
procmail: Skipped "*//g'`"
procmail: Skipped "`date`"
Subject: Re: s/^Re:
Folder: /usr/lib/sendmail -oi
-t 409
sed: option requires an argument -- e
Usage: sed [-nV] [--quiet] [--silent] [--version] [-e script]
[-f script-file] [--expression=script] [--file=script-file] [file...]
procmail: Skipped "*//g'`"
Subject: Re: s/^Re:
Folder: /usr/lib/sendmail -oi
-t 409
sed: option requires an argument -- e
Usage: sed [-nV] [--quiet] [--silent] [--version] [-e script]
[-f script-file] [--expression=script] [--file=script-file] [file...]
procmail: Skipped "*//g'`"
Subject: Re: s/^Re:
Folder: /usr/lib/sendmail -oi
-t 410
-- cut here --
I know NOTHING about sed, and nothing really substantive about procmail,
so if someone could give me a hand I would appreciate it.
Also, I would like, as a default, to forward the email to another
address. Someone in another message here suggested using the $DEFAULT
variable. When I looked it up in the man pages, they seemed to indicate
that $DEFAULT was the spool directory to send the mail to. When I
changed $DEFAULT to the spool directory of the user I want the mail to go
to, there is an error and the mail is not sent. Is there an easier
solution?
Lastly, thanks to all the people who answered my last question regarding
mail processing. I hope I am not asking totally stupid questions, I am
just new to the whole unix/mail thing, and kind of had it thrust upon me
at work, so I am trying to play catchup as fast as possible. Again,
thanks to everyone out there for being so helpful!