Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#7 Add option -O filename to save message

closed-accepted
nobody
None
5
2002-12-13
2002-12-08
David Saez
No

Add -O filename option which activates passthrough mode and instead of
writing a copy of the input mail to the standard output with an X-Bogosity header
does the same but the message is wrtitten to 'filename'

This patch is to allow use of bogofilter in exim MTA without the need to
reinject the message back to Exim. (because exim pipe transport does
not support redirection).

Now you can use bogofilter with exim in passtrough mode with a pipe
transport (that will substitute the appendfile transport used to deliver
messages to user mailboxes). It assumes that messages are stored
directly by Exim (not using procmail, maildrop or similar) and that the
storage is of type maildir. A transport like that could be used:

bogo_deliver:
driver = pipe
command = /usr/local/bin/bogofilter -e -O FILENAME
prefix = ""
suffix = ""
return_output = true
user = exim
group = mail
delivery_date_add
envelope_to_add
return_path_add

where FILENAME has to be a unique filename inside the user mailbox 'new' directory, i.e
/var/spool/exim/mail/${domain}/${local_part}/new/${md5:$message_id.$tod_full}.$primary_hostname

Discussion

  • David Saez
    David Saez
    2002-12-08

     
    Attachments
  • Logged In: YES
    user_id=2788

    Patch merged with changes (see CVSWEB for details). Note you'll have to use -p:
    /usr/local/bin/bogofilter -e -p -O FILENAME

     
    • status: open --> closed-accepted
     
  • David Saez
    David Saez
    2002-12-13

    • status: closed-accepted --> open-accepted
     
  • David Saez
    David Saez
    2002-12-13

    Logged In: YES
    user_id=268278

    when -O option is used it automatically assumes and enables -p

    this second patch deletes the file before exit when errors are encountered

     
  • David Saez
    David Saez
    2002-12-13

    savetofile patch update

     
    Attachments
  • Logged In: YES
    user_id=2788

    2nd patch merged with changes, the cleanup stuff is now in a separate function in case it must be extended in the future.

    Thanks for the patch; please always offer patches against latest CVS if you can, I needed to merge the second part manually.

    Note I changed the -O option to not include -p, but print a warning to stderr if used without -p. I am opposed to play fallthrough tricks in switch() statements, they impair maintainability.

     
    • status: open-accepted --> closed-accepted