Professional Web Applications Themes

Email::Filter hello world - PERL Modules

Is this a good place to ask for help for Email::Filter? If not, where? I tried [url]http://perlmonks.org/?node_id=383056[/url] but noone really knows as of yet. Here's my query: I'm unable to get the simplest example to work with Email::Filter. This could be due to any number of non-Perl-related things, so if it's offtopic I apologize (and would love suggestions on where this question should be asked). First off, the code: #!/usr/bin/perl -w use strict; use Email::Filter; my $mail = Email::Filter->new; $mail->reject; The preceding code belongs to a user named 'embo' and is stored in the executable file /home/embo/bin/filt. Here is embo's ...

  1. #1

    Default Email::Filter hello world

    Is this a good place to ask for help for Email::Filter? If not, where?
    I tried [url]http://perlmonks.org/?node_id=383056[/url] but noone really knows as
    of yet. Here's my query:


    I'm unable to get the simplest example to work with Email::Filter.
    This could be due to any number of non-Perl-related things, so if it's
    offtopic I apologize (and would love suggestions on where this
    question should be asked).

    First off, the code:

    #!/usr/bin/perl -w
    use strict;
    use Email::Filter;
    my $mail = Email::Filter->new;
    $mail->reject;

    The preceding code belongs to a user named 'embo' and is stored in the
    executable file /home/embo/bin/filt. Here is embo's ~/.procmailrc:

    MAILDIR=$HOME/Mail
    LOGFILE=$MAILDIR/from
    LOGABSTRACT=all
    VERBOSE=off

    ##### backup every incoming email
    :0 c
    backup

    ##### filter with Mail::Audit
    :0fw
    | /home/embo/bin/filt

    When I try to send a test email from adamm to embo on the same system
    using date | mail embo, here's what I see in /home/embo/Mail/from...

    procmail: Program failure (100) of "/home/embo/bin/filt"
    procmail: Rescue of unfiltered data succeeded
    From [email]adammlocalhost.loca[/email]ldomain Sat Aug 14 21:30:22 2004
    Folder: /var/mail/embo 658

    I would expect that email to bounce back to adamm, but adamm receives
    no bounce. embo still receives the email from adamm in his mail spool.
    Anyone have any idea what I'm doing wrong? The pod for Email::Filter
    is pretty weak in terms of implementation. I also tried a ~/.forward
    file containing only |/home/embo/bin/filt; no luck there.

    In return for help with Email::Filter, I offer the following (all
    mentioned software will be Free, as in speech):
    * doentation, including:
    + custom-made Email::Filter "Hello World" tutorial hosted at
    [url]http://adammonsen.com/tut/[/url]
    + POD to add to Email::Filter
    * email vacation autoresponder software
    Adam Monsen Guest

  2. #2

    Default Re: Email::Filter hello world

    Adam Monsen <haircut> wrote:
    > I'm unable to get the simplest example to work with Email::Filter.
    > First off, the code:
    > #!/usr/bin/perl -w
    > use strict;
    > use Email::Filter;
    > my $mail = Email::Filter->new;
    > $mail->reject;
    Running this as a forwarding filter will cause the MTA to reject the
    inbound email ($mail->reject exits with status 100).
    > The preceding code belongs to a user named 'embo' and is stored in the
    > executable file /home/embo/bin/filt. Here is embo's ~/.procmailrc:
    [...]
    > ##### filter with Mail::Audit
    > :0fw
    > | /home/embo/bin/filt
    OK, so you're telling procmail to use your program as a filter, i.e. the
    program's output will be used by procmail to replace the original input.
    > When I try to send a test email from adamm to embo on the same system
    > using date | mail embo, here's what I see in /home/embo/Mail/from...
    > procmail: Program failure (100) of "/home/embo/bin/filt"
    > procmail: Rescue of unfiltered data succeeded
    > From [email]adammlocalhost.loca[/email]ldomain Sat Aug 14 21:30:22 2004
    > Folder: /var/mail/embo 658
    Yes that's expected. Procmail has fed the email to your filter ("f"). Your
    filter has exited with an error status ($mail->reject). Procmail figures
    that your filter has barfed somewhere, so it abandons the result and
    continues as if your program had never been run in the first place ("w").
    > I would expect that email to bounce back to adamm, but adamm receives
    > no bounce. embo still receives the email from adamm in his mail spool.
    As per my description, the observed behavious is indeed what I would
    have expected to happen.
    > Anyone have any idea what I'm doing wrong?
    Don't set up your program as a procmail filter. You should be able to
    reject messages like this [untested]:

    :0 h
    * ^Subject: bounceme
    EXITCODE=100
    > The pod for Email::Filter
    > is pretty weak in terms of implementation.
    Seems fine to me - I guess it depends on where you're coming from (if
    you're conversant with a subject then you don't need many pointers...)
    > I also tried a ~/.forward
    > file containing only |/home/embo/bin/filt; no luck there.
    I would have expected that to have "worked" in so far that all emails
    should have been bounced to the sender.
    > In return for help with Email::Filter, I offer the following [...]
    > * email vacation autoresponder software
    Since you're using procmail, why not use procmail's autoresponder
    software. Alternatively, why not ditch procmail entirely and use
    Email::Filter on its one?

    use Email::Filter;
    my $mail = Email::Filter->new(emegency => '~/emergency_mbox');
    $mail->reject ('Go away!') if $mail->from =~ /\badamm\localhost\b/;
    $mail->accept ();

    Chris
    chris-usenet@roaima.co.uk Guest

Similar Threads

  1. #40499 [NEW]: filter sapi does not register any highlightning filter
    By php at henke37 dot cjb dot net in forum PHP Bugs
    Replies: 0
    Last Post: February 15th, 06:31 PM
  2. Connenting email form to an email account
    By evaughn in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: February 15th, 04:00 AM
  3. Replies: 3
    Last Post: September 12th, 04:18 PM
  4. Group email doesn't send because of bad email
    By hecsan in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: July 11th, 08:43 PM
  5. Replies: 2
    Last Post: June 16th, 07:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139