Skip to Content.
Sympa Menu

en - Re: [sympa-users] Custom condition / auto-reply question

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Greg Foster <address@concealed>
  • To: "address@concealed" <address@concealed>
  • Subject: Re: [sympa-users] Custom condition / auto-reply question
  • Date: Wed, 8 Apr 2020 12:20:20 +0000

Is there anyone here who may have some insight into this issue I sent earlier?

Thanks!

---
Greg Foster
IT Services, Enterprise Systems Group
G20A Stright Hall
Indiana University of Pennsylvania
Indiana, PA 15701
724-357-2986

"There are 10 kinds of people: those who understand binary and those who
don't"

________________________________________
From: Greg Foster <address@concealed>
Sent: Wednesday, April 1, 2020 8:39 AM
To: address@concealed
Subject: Custom condition / auto-reply question

Hello everyone,

I have a need to provide the ability to generate an auto-reply to messages
sent to a particular list based on time of day/day of week, of which I have
working. In addition, I need to be able to forward a copy of the message
that meets the criteria passed to the custom condition to an email address
that is also a parameter passed to the customer condition.

I've been able to capture the message body of email messages that are plain
text, non-multipart messages. However, when I send a multipart message
(simple text message with an attachment), I'm not able to capture the body of
the message for forwarding.

I have the scenario setup such that is calls my custom condition twice. Once
with a parameter that passes [msg_body] and another time that passes
[msg_part->body]. It is my understanding that you need to check both of
these due to one containing the non-multipart message body and the other
containing the multipart message body. These are the last parameters passed
to my custom condition where I shift all the other parameters off and capture
the remaining (message body) data in a variable and process it based on
whether it's an array or not:

foreach my $part (@parts) {

$body .= ref $part eq "ARRAY" ? join " ", @{$part} : $part;

}

In the end, $body will be empty if the message body is multipart.

For debugging purposes, I even have my perl code dumping that contents of
those parameters to a file and any time I send a multipart message, the dump
file is empty.

So, some questions:

- Is my understanding of the [msg_body] and [msg_part->body] correct as far
as one containing the non-multipart message body and the other contain the
multipart message body?

- Is my code to process the body content passed to my custom condition
correct, or am I missing something?

- Is there an easier way to forward a copy of a list message to another user
using Sympa functions? Perhaps I'm over thinking this by trying to rebuild
the message to forward it to another user?

Any help is greatly appreciated.

Thanks!

---
Greg Foster
IT Services, Enterprise Systems Group
G20A Stright Hall
Indiana University of Pennsylvania
Indiana, PA 15701
724-357-2986

"There are 10 kinds of people: those who understand binary and those who
don't"



Archive powered by MHonArc 2.6.19+.

Top of Page