Subject: The mailing list for listmasters using Sympa
List archive
Re: [sympa-users] message reject with senders subject
- From: christopher pax <address@concealed>
- To: Thomas Berry <address@concealed>
- Cc: address@concealed
- Subject: Re: [sympa-users] message reject with senders subject
- Date: Thu, 14 Jun 2012 14:06:03 -0400
that was very useful thank you. :-)
On Thu, Jun 14, 2012 at 12:48 PM, Thomas Berry <address@concealed> wrote:
As far as I'm aware, there's no way to pass the subject of a message to a template. We also needed to do this, so I used Sympa's custom conditions capability:
Instead of true() smtp -> reject(tt2=autorsp), add something similar to the following; but, don't forget to put some kind of true() statement at the end to finish the message delivery process):
CustomCondition::msgreceipt([listname],[sender],[msg_header->subject],[msg_header->date]) smtp,smime,md5 -> reject
Also, keep in mind, the delivery of the auto-reply isn't handled by Sympa. You will need to make sure that Mail::Mailer is configured with the appropriate mail mechanism; sendmail is used in this example.
Here is msgreceipt.pm (to be placed in custom_conditions) in a nutshell:
#!/usr/bin/perl
package CustomCondition::msgreceipt;
use strict;
use Mail::Mailer;
sub verify
{
my $listname = shift or return FALSE;
my $sender = shift or return FALSE;
my $subject = shift;
my $date = shift;
my $message = "From: $sender\nSubject: $subject\nYour message to $listname has been received.\n";
my $mailer = Mail::Mailer->new('sendmail');
my $headers = {
From => $listname,
To => [$sender],
Subject => "Re: $subject",
};
$mailer->open($headers);
print {$mailer} $message;
$mailer->close();
return 0; # false for success
}
1;
#### END OF SCRIPT
On 06/14/2012 09:29 AM, christopher pax wrote:I am creating a sympa list where it send a auto response to the sender.
my scenario is:is_owner([listname],[sender]) smtp -> do_ittrue() smtp -> reject(tt2=autorsp)
my autorsp.tt2 is:From: address@concealedSubject: Re: [% subject %]
this is a example body message.
-------------
but [% subject %] does not filter to the senders subject, it appears blank.
I have tried this:[%|loc(subject)%](Subject of your mail : %1)[%END%]
and I have tried:[% original_msg.subject %]
both do not work.
please help. thanks.
-
[sympa-users] message reject with senders subject,
christopher pax, 06/14/2012
-
Re: [sympa-users] message reject with senders subject,
Thomas Berry, 06/14/2012
- Re: [sympa-users] message reject with senders subject, christopher pax, 06/14/2012
-
Re: [sympa-users] message reject with senders subject,
Thomas Berry, 06/14/2012
Archive powered by MHonArc 2.6.19+.