[Mimedefang] How to save certain emails on the server, with delivery

Stefan Schoeman stefan at internext.co.za
Sun Nov 16 12:20:07 EST 2003


Hi Jason,

I'm not a perl expert and I normally get people laughing at the perl I
produce (anyone remember my funny regex's?), but but I invoke procmail
through a shell script that I pass the INPUTMSG file location and the
mailbox name that I want it delivered to.

My script looks as follows (it's called maildump.sh):

----------------------------
#!/bin/bash

/usr/bin/procmail -d $2 < $1
----------------------------

And I call it from mimdefang-filter like this :

      my @filecatparams = ("/maildump.sh", "$CWD/INPUTMSG","spamtrap");
      system(@filecatparams);

This seems to deliver the particular message to /var/spool/mail/spamtrap
in the proper mail format, although it seems to mess with the date (it's
not corrected for my timezone).

There's probably a much simpler and better way directly from perl, but
being more comfortable with the shell than perl, this works for me. If
anyone can show me how to do this directly from perl, that would be great.
I don't know how to tell perl to take the INPUTMSG file as standard input
to procmail, therfore the system() call to the script.

Stefan

> Hi
>
> I'd like to be able to save certain incoming emails to disk on the mail
> server while still delivering it normally.  I have a
> sendmail/mimedefang/spamassassin gateway (no local delivery) and for
> emails with a certain spamassassin score, I'd like to store them
> temporarily for analysis.
>
> I need to be able to save it mbox-style, not split into pieces like
> quarantining does.
>
> Any ideas?  It sounds like a job for a second milter, i.e. pipe the
> email through another filter *after* mimedefang has added the spam score
> header.
> But I have no idea how to go about doing that.
>
> --
> Jason



More information about the MIMEDefang mailing list