procmail
[Top] [All Lists]

Re: distilling the body

1997-11-13 06:25:54
Cliff Trapp asked,

| Please help me with the following scenario: I want to send a postscript
| document to the distiller via email and have it return a PDF file. The
| problem I get to is since I send just the body to the distiller, I lose
| the return information formail needs. I know I need to RTFM, but I am
| swamped and my head is spinning...and spinning..
| Being new to this I throw myself on your mercy and beg for help. Please
| don't flame me.

May we drench you with several dozen gallons of tap water instead?  We'll
let you know in advance so that you will know not to wear suede or anything
else subject to water damage.

| PATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
| MAILDIR=$HOME/Mail      # You'd better make sure it exists
| DEFAULT=$MAILDIR/mbox
| LOGFILE=$MAILDIR/from
| LOCKFILE=$HOME/.lockmail

You don't need any lockfile for the recipes here, and you're probably
better off using local lockfiles than a global one for those that do.

| FORMAIL=/usr/local/bin/formail

Since you have /usr/local/bin in $PATH, you can invoke it as "formail" and
you don't need a variable for it.  For that matter, you can do the same with
distill because $HOME/bin is already in your $PATH.

| :0 b
| *

If a recipe is unconditional, it doesn't need any conditions.

| | $HOME/bin/distill  |  uuencode file.uu |$FORMAIL -r | /usr/lib/sendmail -oi 
-t

What you probably need is to go back to the fluffy manual and read about the
`f' (filter) flag.

  :0bfW # distill and uuencode the body
  | distill | uuencode file.uu

  :0hfW # invert the head (you probably are better off with -rt than -r)
  | formail -rt

  :0 # mail it back
  ! -t

You very likely do not need "! -oi -t" there because (1) I don't see how
uuencode is going to output a line consisting of a lone period and nothing
else and (2) in more recent versions of procmail, if $SENDMAIL's basename
begins with "sendmail", procmail translates "!" to "| $SENDMAIL -oi".

<Prev in Thread] Current Thread [Next in Thread>