need help parsing email per subdomain

  • mlecho

    mlecho - 2014-06-18

    i'd like to route all mail for two sub-domains to a script depending on which subdomain receives the mail.

    Everything works for, but not for stagingmeassages. i am getting a little confused on how to set up my and the maps for subdomain parsing. it's very likely that in all my research i've added perhaps too much to my

    myhostname =
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = $myhostname, /etc/postfix/domains 
    relayhost = 
    mynetworks = [::ffff:]/104 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    virtual_maps = hash:/etc/postfix/addresses
    alias_maps = hash:/etc/aliases
    inet_protocols = all


    rails_mailer_staging:   "|/var/www/vhosts/"
    rails_mailer:       "|/var/www/vhosts/"


    addresses       DOMAIN      rails_mailer    DOMAIN   rails_mailer_staging
  • Simon Hobson

    Simon Hobson - 2014-06-18

    This is not a general Postfix help forum - this is for the separate package Postfix Admin which configures/maintains virtual domains & mailboxes using Postfix (plus MySQL, optionally maildrop, and Courier or Dovecot).
    For Postfix help you should head over to and check out the Postfix mailing lists.

    Looking at your config, the two subdomains are almost identical except for the script called - perhaps if you tried changing the script for staging messages to match messages and see what happens - that would determine whether it's a "postfix issue" or a "script issue". I know it's the wrong script you'd be calling, but the test is to see if it gets called or if you still have the problem.
    Also, you might try turning on some debugging - I know how to turn on peer debugging, never needed to do it for "the other end" of the queue so can't help there.


Log in to post a comment.