#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0

    Assign Procmail action line to variable


    Hi all,

    I'm trying to assign an action line to a variable in the procmailrc file so that I don't have to keep writing it over and over again. However, I can't get it to work.

    This is the variable as is:

    ALBAS='( /usr/pkg/bin/formail -I"Received:" -I"Content-Type: text/plain" \
    -I"To: $ECELL" -I"From: $ESDF" -I"Subject: Oth: $FROM2 - $SUBJECT" ) \
    | /usr/sbin/sendmail -t'


    And this is the action line:

    | $ALBAS

    But this results in an error:

    procmail: Executing "(,/usr/pkg/bin/formail,-I"Received:",-I"Content-Type:,text/plain",\,-I"To:,$ECELL",-I"From:,$ESDF",-I"Subject:,Oth:,$FROM2,-,$SUBJECT",),\,|,/usr/sbin/sendmail,-t"
    /bin/sh: Can't open (
    procmail: Non-zero exitcode (2) from "("
    procmail: Assigning "LASTFOLDER=( /usr/pkg/bin/formail -I"Received:" -I"Content-Type: text/plain" \ -I"To: $ECELL" -I"From: $ESDF" -I"Subject: Oth: $FROM2 - $SUBJECT" ) \ | /usr/sbin/sendmail -t"


    Anyone have any idea how I could re-write this variable, or call it differently on the action line?

    Thank you.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0

    breaking up variable; still not working


    I realized that it might be better to actually put the command on the action line, so I broke the variable apart so now it is:

    EMLCLD=-I"Received:" -I"Content-Type: text/plain" \
    -I"To: $ECELL" -I"From: $ESDF" -I"Subject: Oth: $FROM2 - $SUBJECT"


    And the Action Line is:

    | ( /usr/pkg/bin/formail "$EMLCLD" ) | /usr/sbin/sendmail -t

    This provides no error in procmail, however the message is not sent, so I imagine there is some mistake in how the variable is written for formail.

    I believe this may be a quoting issue - any thoughts on how to quote this properly would be appreciated.

IMN logo majestic logo threadwatch logo seochat tools logo