@lbutlr | 1 Jun 15:41 2016

Working sms time check?

I think I have this working:

:0
* LISTNAME ??^^procmail^^
{
  SMS_TIME=`find . -mtime +24h -maxdepth 1 -name .SMS_$LISTNAME | sed 's/^.......//'`
  :0
  * ! 9876543210^0 SMS_TIME ?? ^^$LISTNAME^^
  {
    LOG="touch .SMS_$LISTNAME"
    SMS_TIME=`touch .SMS_$LISTNAME`
    INCLUDERC=$HOME/.sms_procmail
    SWITCHRC
  }
  :0E
  {
    SWITCHRC
  }
}

LISTNAME is generated in another script, based on Sean’s script to extract the list name from a  variety of headers.

I know find is expensive, but the whole point of this is to alert me when there is a new post in a group that gets
few posts, but not to alert me to every single post in case a thread gets activity for a day or two, so in theory
these find’s should be firing quite rarely. One list, for example, I haven’t gotten posts from since
early this year, but I don’t want to miss them.

If I have the logic right then if the find doesn’t match a file (either because the file is less than 24 hours
old or because it does not exist) the file will be touched, the SMS notification script will load, and the
script will pop back; otherwise if the file exists and is less than 24 hour hours old the script will simply
(Continue reading)

@lbutlr | 1 Jun 07:06 2016

stripping the signature from an email

I have the following:

:0
{ 
  MSGTEXT=`/usr/local/bin/formail -I ""`
  LOG="1 MSGTEXT=${MSGTEXT}${NL}"
  MSGTEXT=`echo $MSGTEXT | sed '/^-- $/,$d'`
  LOG=“${NL}2 MSGTEXT=${MSGTEXT}${NL}”
…

Which results in:

1 MSGTEXT=
one two three four five
Six seven eight

-- 
It's Tchaikovsky's 'Another One Bites the Dust'," said Crowley, closing
his eyes as they went through Slough.

2 MSGTEXT=one two three four five Six seven eight -- It's Tchaikovsky's 'Another One Bites the Dust'," said
Crowley, closing his eyes as they went through Slough.

Shouldn’t the sed strip the signature delimiter and the signature text?

I assume that the echo is condensing the MSGTEXT without passing the newlines?

--

-- 
Never trust a man who, when left alone in a room with a tea cosy,
doesn't try it on -- Billy Connolly
(Continue reading)

@lbutlr | 30 May 23:18 2016

excessive output quenched

I have the following in my sms include.

MSGTEXT=`/usr/local/bin/formail -I ""| /usr/local/bin/lynx --dump --dont_wrap_pre -stdin`

And then

MSGTEXT=`echo $MSGTEXT | sed '/:$/d' |sed '/^>/d'`
SMSTEXT=`echo $MSGTEXT | sed -e 's/^   //' |sed -e 's/[-=_]//g'| tr '\n' ' '  | cut -c1-140`

This SOMETIMES results int eh following errors:

procmail: Excessive output quenched from "/usr/local/bin/formail -I ""| /usr/local/bin/lynx --dump
--dont_wrap_pre -stdin”

procmail: Excessive output quenched from "echo $MSGTEXT | sed '/:$/d' |sed '/^>/d'"

You would think this happens with excessively long messages, but it doesn’t. Some of the messages are
quite short, though they will be messages with multiple parts (usually a txt and an HTML portion).

--

-- 
I WILL NOT TRADE PANTS WITH OTHERS Bart chalkboard Ep. 7F05

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
@lbutlr | 30 May 19:51 2016

Triggering after a timeout?

I have several recipes like the following:

:0
* LISTNAME ??^^procmail^^
{ 
  INCLUDERC=$HOME/.sms_procmail
  SWITCHRC
}

When a message is sent to the list procmail (this list), I get an SMS alert. This is fine for lists like this one
that get a low volume of mail, but I would like to do is figure out a way within procmail to only trigger this if
an SMS hasn’t been sent in 24 hours.

The only thing I can think of is touching a file and then checking the time stamp for the file, but that would
require invoking a shell and before I go to that I am wondering if anyone has any better ideas?

(I think something like this would work)

SMS_TIME=`find . -mtime -24h .sms_$LISTNAME`
:0
* LISTNAME ?? ^^procmail^^
{
   :0
   * SMS_TIME ?? ^^$LISTNAME^^
   {
     INCLUDERC=$HOME/.sms_procmail
     `touch .sms_procmail`
     SWITCHRC
   }
  :0E
(Continue reading)

Xu Wang | 25 May 08:12 2016
Picon

Extract last email from an email file (mbox format)

Hi how can I efficiently extract the last email in a huge mbox email file?

Kind regards,

Xu
Zhiliang Hu | 11 Mar 16:25 2016

recepient's email address truncated

I use a procmail recipe like the following for a number of small lists:

ReplyTo = "Reply-To: `formail -xFrom:`"

:0 c
* ^(To|Cc):.*listone <at> mydomain.name
* ? formail -X"From " -xFrom: -xSender: -xReply-To: -xResent-From: \
      | /var/list/.bin/multigram -b1 -m -l 28668 \
        /home/myaccount/etc/listone.txt
{
    :0 c
    /home/myaccount/etc/listone/.

    :0 fwh
    | formail -I "Reply-To: $ReplyTo"
      :0A
      ! `cat /home/myaccount/etc/listone.txt`
}

Everything works fine for quite some time. Lately there were some 
occasional email bounces on *some users*, on *some* list mails (not 
consistent). The bounce shows that the recepient's email address was 
truncated (4-5 letters chopped off from the right side). Test mails 
from the same server machine to the same email address goes just fine.
I double checked the email list file for any non-ascii characters etc
and it was clean.

Because this is hardly repeatable, I am not sure what else I should look 
at? Any advice would be appreciated.

(Continue reading)

Bernard Schoenacker | 28 Jan 16:55 2016
Picon

my first procmail rules

hi,

it's possible to look any recipe in my first procmailrc ?

see the attachment

cheers

bernard
Attachment (procmailrc-1.gz): application/gzip, 2088 bytes
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
Danny de Bont | 21 Jan 16:34 2016
Picon

Appending contents to file

Hi guys,

Currently I am managing my Debian servers via simple commands in the Subject of a mail message with an empty body ...

Procmail would read the Subject and then perform a certain command ...

For example:
If I want to start an Ftp server I would send an email with "Ftp start" as the subject ... it works o.k for my needs ...

However ... I want to send more complicated commands in the Body and not the Subject ...

For example:
When procmail gets an email with say "Execute command" in the Subject ... I want procmail to pipe the command contained in the body (a one line BASH command) to BASH ...

Here is an example of a command I would send in the Body:
echo -e "\rLT 4>Body of email message\r\r" > /dev/ttyS1

Any pointers?

Danny

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
@lbutlr | 17 Jan 08:33 2016

Transform part of a message body

I get some emails sometimes that have a long line of characters, usually used to mark a huge set of footers

Something like

============================
Text goes here

(or maybe -’s *’s or other characters.

I’d like to modify a message with, say, a line of 10 or more repeated characters and change that line to be a
signature delimiter.

If this would be better done at the MTA (postfix) then that’s fine. I do need to only modify plain text
messages, however.

--

-- 
I think I found your marbles.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
Penguinfriend | 6 Oct 13:22 2015

Create a rule for utf8 subject

Hi

I wonder if anybody have a solution for the following example

:0
* ^Subject:.*PGPKEY
$DEFAULT

if the Subject line is coded like this will never be a hit

=?UTF-8?B?............=?=

How do I handle this so I will get a hit in the relevant case

Regards
@lbutlr | 5 Oct 04:45 2015

Changing the subject

I have some meals that are sent to a custom email address. I have no control over how the emails are formed
(they are from a remote device) but the part of the email that is important is in the body, so I tried this to
put the information in the more accessible subject:

VERBOSE=ON
:0
* ARG ?? ^^alert^^
{
    TRAP='mv "$LASTFOLDER" "${LASTFOLDER}:2,S"'
    SUBJECT=`formail -I ""`

    :fwh
    | formail -I"Subject: $SUBJECT”

    # Send an SMS alert
    INCLUDERC=$HOME/.sms_procmail

    :0
    .alerts/
}
VERBOSE=OFF

ARG = alert TO = kreme+alert <at> kreme.com FROM = device <at> remote.device
procmail: [35385] Sun Oct  4 20:35:40 2015
procmail: Match on "^^alert^^"
procmail: Assigning "TRAP=mv "$LASTFOLDER" "${LASTFOLDER}:2,S""
procmail: Executing "formail,-I,"
procmail: Assigning "SUBJECT=
Alert Text is here, and yes a blank line is part of the alert text"
procmail: Match on "| formail -I"Subject: $SUBJECT""
procmail: Extraneous filter-flag ignored

So, I am doing something wrong in the :fw, I guess. I did look up how to do this, not trusting my memory, but that
matches what I found

procmail: Assigning "LASTFOLDER=INCLUDERC=/home/kreme/.sms_procmail"
procmail: Opening "INCLUDERC=/home/kreme/.sms_procmail"
procmail: Error while writing to "INCLUDERC=/home/kreme/.sms_procmail”

That seems odd.

procmail: Assigning "LASTFOLDER=.alerts/new/1444012540.35385_1.mail.covisp.net"
procmail: Notified comsat: "kreme <at> 0:/home/kreme/Maildir//.alerts/new/1444012540.35385_1.mail.covisp.net"
procmail: Assigning "EXITCODE=0"
procmail: Executing "mv,.alerts/new/1444012540.35385_1.mail.covisp.net,.alerts/new/1444012540.35385_1.mail.covisp.net:2,S"

I have other recipes that call the sms_procmail file and send messages properly.

What did I miss?

--

-- 
"Making music should not be left to the professionals." -  Michelle
Shocked

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

Gmane