[Mimedefang] Writing to an MBOX file

Cormack, Ken ken.cormack at roadway.com
Tue Mar 21 09:17:22 EST 2006


> I'd use add_recipient() and let sendmail/procmail worry about
> the details of the file format and locking.  You might have to
> add a dummy user to own the mailbox, though.

That is exactly what we've done recently.  In sub filter_end()...

    # WHEN A MESSAGE IS SENT TO THE SPECIFIED
    # RECIPIENT, ALSO COPY A LOCAL ON-DISK MAILBOX
    foreach $recip(@Recipients) {
        if ($recip =~ /SomeTestAccount\@yahoo\.com/i) {
            add_recipient ('debug at localhost');
            last;
        }
    }

You need to first create a local user account "debug", on the mimedefang
server.  Whenever an email is sent to an external test account, a copy is
also sent to the local user's mailbox.

Ken




More information about the MIMEDefang mailing list