Autoresponder for entire domain

Discussion in 'HOWTO-Related Questions' started by mooseman, Mar 12, 2015.

  1. mooseman

    mooseman Member

    Hi,

    I would like to setup an autoresponder for an entire domain.

    I've tried with a catch all but only messages specifically sent to the catch all mailbox receive an auto-response, other catch all mail does not receive an auto-response.
    Should this be done in a script in the main.cf file?

    Any advice would be appreciated.
     
  2. sjau

    sjau Local Meanie Moderator

    you could write a sieve custom rule to provide that functionality.
     
  3. mooseman

    mooseman Member

    any chance you can point me in the right direction on to creating a sieve custom rule?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. sjau

    sjau Local Meanie Moderator

    Hmmm, pondering further on it, I think sieve isn't probably the way to go... it would be simple for all incoming mail.... but not just for one domain.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

  7. sjau

    sjau Local Meanie Moderator

    actually, I think it's easy. Add

    always_bcc to the postfix main.cf

    That will cause that of every email passing through the server a copy will be sent to the specified address.

    Aftwares for that email addres, make a custom filter like:

    Code:
    ### BEGINN CUSTOM FILTERS
    if anyof    (header :regex    ["Delivered-To"]    [".*domain.tld"],
                header :regex    ["To"]                [".*domain.tld"]
    ){
        vacation  :days 1
        :addresses ["[email protected]"]
        "add
    your
    autoresponder
    text";
    
    }
    # Delete email from the bcc account
    discard;
    
    ### END CUSTOM FILTERS
    
     
  8. sjau

    sjau Local Meanie Moderator

    the one issue I see is when the recipient for domain.tld is in bcc... then it probably won't work.

    Any maybe also add a regex for CC field
     
  9. mooseman

    mooseman Member

    Wow, that always_bcc seems to be a dangerous feature, is it possible to use always_bcc for a single domain?
     
    Last edited: Mar 17, 2015
  10. mooseman

    mooseman Member

    First off, thanks for all your input.

    I setup a catchall address, and then I installed avelsieve with dovecot-managesieved but it only auto-responds if email is sent directly to the catchall address. any other address that is redirected to the catch-all does not trigger the auto-responder.
    This is what I did so far:

    1. Installed avelsieve from here: http://code.uoa.gr/p/avelsieve/download.php (added source, then installed ubuntu package)
    2. Followed this howto to get filters setup in squirrelmail: https://github.com/cmjnisse/sogo-ispconfig/wiki/Use-manage-sieve-protocol
    3. and then fixed the imapflags error with this article: http://comments.gmane.org/gmane.mail.squirrelmail.plugins/16444

    I haven't tried the always_bcc option in main.cf, I'd like to see if that can be done to one domain only, ISPconfig server is hosting multiple domains.

    Thanks,
     
    Last edited: Mar 17, 2015
  11. sjau

    sjau Local Meanie Moderator

    Why dangerous?
    Not, can't use always_bcc for a single domain - since it's "always"
     

Share This Page