On 10/21/2010 3:06 PM, John Watson wrote:
I am close to getting the always_bcc option working. I created an alias in the mysql alias table that has 'autoreply' mapped to '| /path/to/myscript'. I setup always_bcc to send messages to 'autoreply'. In the /var/log/maillog I can see that postfix is attempting to cc the message to my alias but rather than executing the command it is making an address of the form:

"| /path/to/[email protected] <mailto:[email protected]>" and then trying to send it on.

If this a mysql map in virtual_alias_maps, then it will not work. virtual_alias_maps MUST resolve to an address. To run a piped command, you MUST EITHER deliver to a domain listed in mydestination and then alias to command in alias_maps OR set up a transport in master.cf and point the address in transport_maps to the specified pipe transport.

See http://www.postfix.org/VIRTUAL_README.html under "Mailing Lists" or "Autoreplies" for examples.

Brian

I have looked at content filters and started to look at writing a custom MDA per http://blog.josephhall.com/2009/12/create-custom-mda-with-postfix-and-perl.html but I really want this always_bcc solution to work. Does anyone know how to make postfix execute the command rather than treat it as an address? I have seen examples that had "| /path/to/command" and it looked like it was supposed to just work but those examples weren't using mysql to store the account info.

 Thanks in advance.
 -John Watson.

On Wed, Oct 20, 2010 at 2:15 PM, mouss <[email protected] <mailto:[email protected]>> wrote:

     Le 20/10/2010 21:04, John Watson a écrit :


        Hello,

         I am using postfix in conjunction with squirrelmail to build
        a business application. One of the requirements that I have is
        that when an email is received in one of the postfix mail
        boxes an alert is generated. In our case we will be sending a
        standard message to another email but in general we might want
        to run arbitrary code when messages are received by postfix.

         It seems that some of the work that has been done with virus
        scanners uses a server hook to examine all the messages that
        pass through the server. Can anyone tell me what that is
        called or provide a pointer to more detail and is this the
        best way to solve a problem like this?



    you can do that
    - in your MDA (dovecot, maildrop, ...).
    - by specifying a script as an MDA for those mailboxes that you
    want...

    I personally prefer the "run the action later".
    - keep delivery as it is
    - have a script that does pop3 (or imap) periodically. this script
    can do anything you want

    the advantage is that
    - bugs in your script won't cause trouble to your delivery
    - if you're under heavy mail stream, you don't add yet more load
    on your server







Reply via email to