Discussion:
Error in RC file
@lbutlr
2017-02-23 00:32:28 UTC
Permalink
I have the following in an rc file:

# Abort if over 24K
* $ B ?? > 24576
{ SWITCHRC= }

:0E
{
:0
* ^Content-Transfer-Encoding: base64
{
MSGTEXT=`/usr/local/bin/formail -I ""| /usr/local/bin/gbase64 -d`
}
:0E
{
MSGTEXT=`/usr/local/bin/formail -I ""
}
}

:0
{
MSGTEXT=`echo $MSGTEXT | sed 's/-.*8859-1// ' | dd bs=1 count=150`
}

which yields the error in the log

procmail: Skipped "$MSGTEXT | sed 's/-.*8859-1// ' | dd bs=1 count=150`”

I’m not seeing why this would fail.
--
Apple broke AppleScripting signatures in Mail.app, so no random signatures.
@lbutlr
2017-02-23 01:24:06 UTC
Permalink
Post by @lbutlr
{
MSGTEXT=`/usr/local/bin/formail -I ""
}
Well, that’s embarrassing.

ANYWAY, I have a different problem. This is the whole rc file (called via INCLUDERC)

MOBILE="***@recipe.ifttt.com"
MOFROM=“***@example.com"
MSGTEXT=""
SMSTEXT=""
VERBOSE=ON

:0c
{
:0
* ^Content-Transfer-Encoding: base64
{
MSGTEXT=`/usr/local/bin/formail -I ""| /usr/local/bin/gbase64 -d`
}

:0E
{
MSGTEXT=`/usr/local/bin/formail -I "" `
}

LOG="${MSGTEXT} before sed${NL}"
:0
{
MSGTEXT=`echo $MSGTEXT | sed 's/-.*8859-1// ' | dd bs=1 count=150`
}

LOG="${MSGTEXT} after sed${NL}"
SMSTEXT=":: $MSGTEXT ::"
LOG=$"About to send to ${MOBILE} \"${SMSTEXT}\"${NL}"

:0fw
| (formail -rt -I"Subject: ${LISTNAME} ${SUBJECT}" \
-I"From: ${MOFROM}" \
-I"To: ${MOBILE}" ; \
echo $SMSTEXT) | $SENDMAIL -t

:0
.trapped/
}

LOG="END OF SMS_PROCMAIL${NL}"
VERBOSE=OFF

Two things happen with this. First, the message is not sent with the From header I set and two, and empty (as in 0 byte) “messages” falls through to be written in .trapped.

Frankly, it’s been too long since I really hammered on procmail much, and most of what I knew has evaporated.
--
Apple broke AppleScripting signatures in Mail.app, so no random signatures.


____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
***@lists.rwth-aachen.de
https://mailman.rwth-aachen.de/
Stan Ryckman
2017-02-23 05:30:59 UTC
Permalink
On 2017-02-22 20:24, @lbutlr wrote:
[snip]
Post by @lbutlr
:0fw
| (formail -rt -I"Subject: ${LISTNAME} ${SUBJECT}" \
-I"From: ${MOFROM}" \
-I"To: ${MOBILE}" ; \
echo $SMSTEXT) | $SENDMAIL -t
:0
.trapped/
}
LOG="END OF SMS_PROCMAIL${NL}"
VERBOSE=OFF
Two things happen with this. First, the message is not sent with the
From header I set and two, and empty (as in 0 byte) “messages” falls
through to be written in .trapped.
Frankly, it’s been too long since I really hammered on procmail much,
and most of what I knew has evaporated.
I'm a little rusty myself, but is it possible that your $SENDMAIL
doesn't think you are authorized to set "From:"?

Also, is it possible that your $SENDMAIL thinks that a 0-byte message
is an error (which would then be interpreted as failure to deliver
due to the w flag, and thus drop through to .trapped)?

You should be able to test those two things by piping something
to $SENDMAIL directly from the shell, and thereby see if the
problem is outside the script.

Stan
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
***@lists.rwth-aachen.de
https://mailman.rwth-aachen.de/mailm
@lbutlr
2017-02-23 05:54:38 UTC
Permalink
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
***@lists.rwth-aachen.de
https://mailman.rwth-aachen.de/mailman/listinfo/procmail

Loading...