Professional Web Applications Themes

Perl script vs. fetchmail & procmail - PERL Beginners

Shawn Milochik <ShawnLinurati.net> wrote in message news:<pan.2003.08.19.22.42.33.43107.16205Linurati .net>... > Here's the project: > I want to download my mail, and optionally do zero or more > of the following: > > 1. Forward certain messages to another e-mail address. > 2. Send a particular auto-response, depending upon sender. > 3. E-mail a list of all e-mail senders/subjects to another e-mail address. > > Then, I want to filter all messages through a Bayesian filter, probably > Spamassassin, then place the good messages back into my original > e-mail account, except in another box, such as "unread" instead of > back ...

  1. #1

    Default Re: Perl script vs. fetchmail & procmail

    Shawn Milochik <ShawnLinurati.net> wrote in message news:<pan.2003.08.19.22.42.33.43107.16205Linurati .net>...
    > Here's the project:
    > I want to download my mail, and optionally do zero or more
    > of the following:
    >
    > 1. Forward certain messages to another e-mail address.
    > 2. Send a particular auto-response, depending upon sender.
    > 3. E-mail a list of all e-mail senders/subjects to another e-mail address.
    >
    > Then, I want to filter all messages through a Bayesian filter, probably
    > Spamassassin, then place the good messages back into my original
    > e-mail account, except in another box, such as "unread" instead of
    > back into the inbox, and spam into another box, such as "spam"
    Okay, so far the only thing you need to do is read the doentation
    for spammassassin. There's a few ways to do it. I personally use
    MH-mail, procmail, postfix, and fetchmail. Fetchmail picks up the
    mail, forwards it to the SMTP server on the box, checks for viruses
    (yes, you CAN check mail for viruses on Linux - not that it would harm
    anything - but my wife enjoys Windows, so I have to keep her safe and
    get her mail - then she grabs the mail off my system ... where was I
    .... oh, ya), then it goes through procmail, which has a "recipe" to
    filter it using spamassassin (to pick up "stray" spam - read on). So
    far, the only thing Perl is spamassassin.
    >
    > I do not want to use any of the user mail functionality of my
    > Linux server -- I just want to use my pop3/smtp e-mail account, and
    > I want everything to be put back into my pop3/smtp e-mail account
    > after it's been filtered, so that I can check it with webmail.
    Well, this again is not Perl, but you can set fetchmail NOT to mark
    messages as being read when you get them. Not exactly what you
    wanted, but to send mail BACK to your webmail account seems redundent
    - but that's my opinion and the fact that I'm spoilled by my ISP
    (which does use spamassassin). However, if you want to 'roll your
    own' solution, there are several Perl modules to aid you in this task.
    Check [url]http://search.cpan.org/[/url]

    Just a side note: if you are responsible about testing, you're going
    to need to set up a mail server anyway. I can speak from experience
    that it's a bad idea to use a script (or fetchmail for that matter)
    and not test it in a controled environment first. You end up lossing
    mail if you don't test first ;)
    >
    > So the question is, should I use a hobbled together combination of
    > fetchmail, procmail, and sendmail (hereafter referred to as "FPS"),
    > or a Perl script?
    IMHO, use the tools on your system. They are proven, maintained, and
    work. That's not a reflection of any Perl scripts you may find/write
    - but why re-invent the wheel? Unless that what's you want to do. I
    mean, why write say, a web server in Perl, unless you think you can do
    better than Apache -or- want the experience. HOWEVER, I'd ditch
    sendmail and start using postfix ... but here again, not Perl and just
    my opinion.

    If you decide to 'roll your own', you're going to have a monumental
    task ahead of you.

    HTH

    Jim
    James Willmore Guest

  2. #2

    Default Re: Perl script vs. fetchmail & procmail

    Shawn Milochik <ShawnLinurati.net> wrote in message news:<pan.2003.08.19.22.42.33.43107.16205Linurati .net>...
    > Here's the project:
    > I want to download my mail, and optionally do zero or more
    > of the following:
    >
    > 1. Forward certain messages to another e-mail address.
    > 2. Send a particular auto-response, depending upon sender.
    > 3. E-mail a list of all e-mail senders/subjects to another e-mail address.
    >
    > Then, I want to filter all messages through a Bayesian filter, probably
    > Spamassassin, then place the good messages back into my original
    > e-mail account, except in another box, such as "unread" instead of
    > back into the inbox, and spam into another box, such as "spam"
    Okay, so far the only thing you need to do is read the doentation
    for spammassassin. There's a few ways to do it. I personally use
    MH-mail, procmail, postfix, and fetchmail. Fetchmail picks up the
    mail, forwards it to the SMTP server on the box, checks for viruses
    (yes, you CAN check mail for viruses on Linux - not that it would harm
    anything - but my wife enjoys Windows, so I have to keep her safe and
    get her mail - then she grabs the mail off my system ... where was I
    .... oh, ya), then it goes through procmail, which has a "recipe" to
    filter it using spamassassin (to pick up "stray" spam - read on). So
    far, the only thing Perl is spamassassin.
    >
    > I do not want to use any of the user mail functionality of my
    > Linux server -- I just want to use my pop3/smtp e-mail account, and
    > I want everything to be put back into my pop3/smtp e-mail account
    > after it's been filtered, so that I can check it with webmail.
    Well, this again is not Perl, but you can set fetchmail NOT to mark
    messages as being read when you get them. Not exactly what you
    wanted, but to send mail BACK to your webmail account seems redundent
    - but that's my opinion and the fact that I'm spoilled by my ISP
    (which does use spamassassin). However, if you want to 'roll your
    own' solution, there are several Perl modules to aid you in this task.
    Check [url]http://search.cpan.org/[/url]

    Just a side note: if you are responsible about testing, you're going
    to need to set up a mail server anyway. I can speak from experience
    that it's a bad idea to use a script (or fetchmail for that matter)
    and not test it in a controled environment first. You end up lossing
    mail if you don't test first ;)
    >
    > So the question is, should I use a hobbled together combination of
    > fetchmail, procmail, and sendmail (hereafter referred to as "FPS"),
    > or a Perl script?
    IMHO, use the tools on your system. They are proven, maintained, and
    work. That's not a reflection of any Perl scripts you may find/write
    - but why re-invent the wheel? Unless that what's you want to do. I
    mean, why write say, a web server in Perl, unless you think you can do
    better than Apache -or- want the experience. HOWEVER, I'd ditch
    sendmail and start using postfix ... but here again, not Perl and just
    my opinion.

    If you decide to 'roll your own', you're going to have a monumental
    task ahead of you.

    HTH

    Jim
    James Willmore Guest

  3. #3

    Default Re: Perl script vs. fetchmail & procmail

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Shawn Milochik <ShawnLinurati.net> wrote in
    news:pan.2003.08.19.22.42.33.43107.16205Linurati. net:
    > I think I've learned enough to get started on this task I've set
    > for myself. The only thing I haven't decided is: How?
    >
    > For all the reasons open source produces high-quality results, I'd
    > like to get input from some of you first.
    >
    > Here's the project:
    > I want to download my mail, and optionally do zero or more
    > of the following:
    >
    > 1. Forward certain messages to another e-mail address.
    > 2. Send a particular auto-response, depending upon sender.
    > 3. E-mail a list of all e-mail senders/subjects to another e-mail
    > address.
    >
    > Then, I want to filter all messages through a Bayesian filter,
    > probably Spamassassin, then place the good messages back into my
    > original e-mail account, except in another box, such as "unread"
    > instead of back into the inbox, and spam into another box, such as
    > "spam".
    >
    > I do not want to use any of the user mail functionality of my
    > Linux server -- I just want to use my pop3/smtp e-mail account, and
    > I want everything to be put back into my pop3/smtp e-mail account
    > after it's been filtered, so that I can check it with webmail.
    >
    > So the question is, should I use a hobbled together combination of
    > fetchmail, procmail, and sendmail (hereafter referred to as "FPS"),
    > or a Perl script?
    Both.

    I personally feel that procmail is a pain in the butt for filtering and
    sorting and (re)distributing email. Yes, you can do it, and it has
    powerful mechanisms for doing so, but it's a pain to write and maintain,
    and sometimes you have to jump through hoops to get things done.

    Currently, my email filtering needs are modest. But when I had more
    complex needs, I used a combination of sendmail, fetchmail, and a perl
    script to do the complex stuff in between. Fetchmail does what it does
    very well and very simply; you're not going to duplicate that easily with
    something homegrown. Ditto sendmail (except maybe for the "simple"
    part); that's a wheel that doesn't need reinventing.

    But in between the two, you can use a perl program that uses Mail::Audit
    to sort, filter, file, log, fold, spindle, mutilate.

    See Simon Cozens' article at
    [url]http://www.perl.com/pub/a/2001/07/17/mailfiltering.html[/url] for more info.

    - --
    Eric
    $_ = reverse sort $ /. r , qw p ekca lre uJ reh
    ts p , map $ _. $ " , qw e p h tona e and print

    -----BEGIN PGP SIGNATURE-----
    Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

    iQA/AwUBP0SWDmPeouIeTNHoEQJ3NQCdE7Tb/UdX3p/vkk0imP7OpHpW0WMAn1h4
    ueIqxeGbeOXM+bZnlfTocmsu
    =OY10
    -----END PGP SIGNATURE-----
    Eric J. Roode Guest

Similar Threads

  1. RFC on first perl script
    By drowl@23.me.uk in forum PERL Beginners
    Replies: 11
    Last Post: November 7th, 02:28 PM
  2. Control a non-perl image viewer from perl script
    By Harry Putnam in forum PERL Beginners
    Replies: 1
    Last Post: October 31st, 10:28 PM
  3. ProcMail with Perl and MailAudit
    By Pablo Fischer in forum PERL Beginners
    Replies: 0
    Last Post: August 31st, 01:21 AM
  4. Execute shell script from a perl script
    By kderaedt in forum Perl / CGI
    Replies: 3
    Last Post: June 26th, 08:26 PM
  5. sendmail/fetchmail/procmail/mutt from source
    By Nico Kadel-Garcia in forum Linux Setup, Configuration & Administration
    Replies: 1
    Last Post: June 26th, 03:11 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