julio@cim.es | 5 Jan 04:05 2011
Picon

Re: Errror Parser.pm line 821

Hi!

Ok, but how i can ignore the warnings?
The warnings are in mimedefang or in CPAN MIME module?

Thanks.

> Content-Transfer-Encoding: ISO-8859-1
> 
> It's completely bogus.  That is not a legal value for
> Content-Transfer-Encoding, hence the warning messages.
> 
> You can ignore the warnings, but whichever software generated
> that message needs fixing ASAP; it's badly broken.

David F. Skoll | 8 Jan 18:20 2011

Re: calling system command

On Sat, 08 Jan 2011 09:14:55 -0800
pete <pete <at> nevill.uk.net> wrote:

> I would like to call a system command when a specific subject string
> is passed.

> if ($Subject =~ /\run ls\b/i) {
>     system("/bin/ls");
>     }

> This works the first time when I send a mail with "run ls" in the
> subject line but causes mimedefang to crash.

The problem is that your filter *must not* print anything to standard
output.  MIMEDefang uses standard output for communication between the
C milter and the Perl scanners; if you print anything to standard output,
MIMEDefang becomes completely confused.

Make sure you redirect standard output (and probably standard error, too)
for any commands you run from your filter.

Regards,

David.
kd6lvw | 9 Jan 01:55 2011
Picon

Re: calling system command

--- On Sat, 1/8/11, David F. Skoll <dfs <at> roaringpenguin.com> wrote:
> pete <pete <at> nevill.uk.net> wrote:
> 
> > I would like to call a system command when a specific subject string
> > is passed.
> 
> > if ($Subject =~ /\run ls\b/i) {
> >     system("/bin/ls");
> >     }
> 
> > This works the first time when I send a mail with "run ls" in the
> > subject line but causes mimedefang to crash.
> 
> The problem is that your filter *must not* print anything ...

Definently not good.  Look into sending the mail to a program instead (cf. sendmail's aliases database -
entries starting with "|").

If using the aliases database, you may want to end the command with an "||exit 0" just in case it fails - so a DSN
isn't sent back to the sender (unless you want errors to be reported).  There are some cases (e.g. spamtraps
feeding "|spamassassin -k") that shouldn't DNS back on errors.
pete | 9 Jan 02:12 2011
Picon

Re: calling system command


 Thanks to both responders.I understand now what the problems was. I 
 will look into redirecting using aliases but on my test rig I used the 
 following to get this working.

 if ($Subject =~ /\brun ls \b/i) {
         $cmd = "ls";
         $tmp = `$cmd`;
 }

 Pete.

 On Sat, 8 Jan 2011 16:55:47 -0800 (PST), kd6lvw <at> yahoo.com wrote:
> --- On Sat, 1/8/11, David F. Skoll <dfs <at> roaringpenguin.com> wrote:
>> pete <pete <at> nevill.uk.net> wrote:
>>
>> > I would like to call a system command when a specific subject 
>> string
>> > is passed.
>>
>> > if ($Subject =~ /\run ls\b/i) {
>> >     system("/bin/ls");
>> >     }
>>
>> > This works the first time when I send a mail with "run ls" in the
>> > subject line but causes mimedefang to crash.
>>
>> The problem is that your filter *must not* print anything ...
>
> Definently not good.  Look into sending the mail to a program instead
(Continue reading)

si | 10 Jan 19:37 2011
Picon

Access to $Sender from filter_end()

Guys,

like (I'm guessing) a lot of folks, I have a few domains where
action_rebuild() 'breaks' things.

Up until a few days ago, that wasn't really a biggie - I just pulled
'From' line out of the header via  $entity->head()->get('From'), and
rebuilt for all domains that didn't exhibit problems. 

I always knew that 'From' didn't necessarily have to match $Sender, but
since $Sender isn't available in filter_end() (where I call
action_rebuild() from), I just had to live with that. By and large,
there was a 1:1 mapping, so everyone was happy.

Sadly, this is no longer true, thanks to a horribly written piece of
software we seem to have inherited from a company we've just merged
with. Worse, the obvious solutions of 'rewrite the software so it works
properly' and 'throw the junk away' aren't options.

I believe all my problems would go away if I could access what was
actually in $Sender from where filter_end().

I'm desperately trying to avoid adding yet another external database [eg
store $Sender keyed by $MessageID in filter_sender(), and retrieve from
filter_end(), or something like that].

Have I missed a trick here?

Thanks

(Continue reading)

David F. Skoll | 10 Jan 19:46 2011

Re: Access to $Sender from filter_end()

On Mon, 10 Jan 2011 18:37:51 -0000
si <at> yacc.co.uk wrote:

> I always knew that 'From' didn't necessarily have to match $Sender,
> but since $Sender isn't available in filter_end()

$Sender is available in filter_end.  What makes you think it isn't?

Regards,

David.
Kevin A. McGrail | 10 Jan 20:05 2011

Re: Access to $Sender from filter_end()


> I'm desperately trying to avoid adding yet another external database [eg
> store $Sender keyed by $MessageID in filter_sender(), and retrieve from
> filter_end(), or something like that].
>
> Have I missed a trick here?
>

Yes, I think you have.

$Sender is a global variable and if you look WAY at the top of the man 
section, you'll note:

GLOBAL VARIABLES SET BY MIMEDEFANG.PL
        The  following  global variables are set by mimedefang.pl and 
are available for use in your filter. *All of these variables are always 
available to filter_begin, filter, filter_multipart and filter_end.*  In
        addition, some of them are available in filter_relay, 
filter_sender or filter_recipient.  If this is the case, it will be 
noted below.

David, it might help to clarify this better on each global variable 
definition even if it means regurgitating the information.  I've often 
forgotten which variables are where and had to remember that sentence.

Something like:

  $Sender
               The sender of the e-mail.  This variable is available in 
filter_begin, filter, filter_multipart and filter_end  as well as 
(Continue reading)

si | 11 Jan 11:32 2011
Picon

Re: Access to $Sender from filter_end()

Aaaah ... I guess I'm running a couple of revisions behind. My docs say:

  $Sender
              The sender of the e-mail.  This variable is set in
filter_sender
              and filter_recipient.

... Guess I know what I need to do next :)

Thanks.

Mup.

-----Original Message-----
From: Kevin A. McGrail [mailto:KMcGrail <at> PCCC.com] 
Sent: 10 January 2011 19:06
To: mimedefang <at> lists.roaringpenguin.com
Cc: Simon Standley
Subject: Re: [Mimedefang] Access to $Sender from filter_end()

> I'm desperately trying to avoid adding yet another external database
[eg
> store $Sender keyed by $MessageID in filter_sender(), and retrieve
from
> filter_end(), or something like that].
>
> Have I missed a trick here?
>

Yes, I think you have.
(Continue reading)

Kevin A. McGrail | 11 Jan 16:28 2011

Re: Access to $Sender from filter_end()

On 1/11/2011 5:32 AM, si <at> yacc.co.uk wrote:
> Aaaah ... I guess I'm running a couple of revisions behind. My docs say:
Your docs are correct.  The trick is that there is a note in the docs 
that says:

"GLOBAL VARIABLES SET BY MIMEDEFANG.PL The following global variables 
are set by mimedefang.pl and are available for use in your filter. 
****All of these variables are always available to filter_begin, filter, 
filter_multipart and filter_end.****"

Emphasis added by me and I was suggesting a small enhancements to the 
docs because while the note is efficient, it is confusing due to the 
length of the docs.  Overall though, I find MD to be very well documented.

Regards,
KAM
si | 11 Jan 16:39 2011
Picon

Re: Access to $Sender from filter_end()

Chances are, only problem here is fact that English isn't my first
language :)

Thanks for putting me straight and saving me a nightmare.

Mup.

-----Original Message-----
From: Kevin A. McGrail [mailto:KMcGrail <at> PCCC.com] 
Sent: 11 January 2011 15:28
To: mimedefang <at> lists.roaringpenguin.com
Cc: Simon Standley
Subject: Re: [Mimedefang] Access to $Sender from filter_end()

On 1/11/2011 5:32 AM, si <at> yacc.co.uk wrote:
> Aaaah ... I guess I'm running a couple of revisions behind. My docs
say:
Your docs are correct.  The trick is that there is a note in the docs 
that says:

"GLOBAL VARIABLES SET BY MIMEDEFANG.PL The following global variables 
are set by mimedefang.pl and are available for use in your filter. 
****All of these variables are always available to filter_begin, filter,

filter_multipart and filter_end.****"

Emphasis added by me and I was suggesting a small enhancements to the 
docs because while the note is efficient, it is confusing due to the 
length of the docs.  Overall though, I find MD to be very well
documented.
(Continue reading)


Gmane