Postfix issues virtual_maps not valid

Discussion in 'Installation/Configuration' started by NETabuse, Feb 8, 2007.

  1. NETabuse

    NETabuse New Member

    Hi all,
    i setup using dapper isp perfect setup howto, now i followed it step by step, and the resulting setup for everything was fine, except for email. i spent a long time learning postfix configuration as best i could and from what i could tell the postfix version no longer supported the type of directives as outlined by the howto.
    what ispconfig produced was local-host-names file and virtusertable file. the latter seemed ok but local-host-names is listing all the domains plus localhost.localdomain, serverhost.localdomain, localhost, serverhost. Now from reading the virtual_domains section in postfix.org, the address classess implemented in postfix v 2.x no longer let you mix default local domains (all users receiving mail under the list of hosted domains) and the virtual domains.
    i changed the local-host-names file to eliminate the four domains then set virtual_alias_domains = /etc/postfix/local-host-names
    then i set virtual_alias_maps = /etc/postfix/virtusertable, everything is working (after i reset my main.cf and setup the sasl auth as per the howto again, leaving out tls for the minute).
    so is there a problem with the latest postfix versions configuration style and ispconfig?
    my versions
    ispconfig 2.2.8
    ubuntu dapper (6.06)
    postfix 2.2.10

    now everytime i or a domain admin sets a mail user up or adds aliases etc.. makes any change on email, i have to re-edit the local-host-names to remove the four host names for local delivery.

    ** my new working main.cf **
    Code:
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    
    myhostname = localhost
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = www.mydomain.com, localhost, localhost.localdomain, localhost
    relayhost = 
    
    virtual_alias_domains = /etc/postfix/local-host-names
    virtual_alias_maps = hash:/etc/postfix/virtusertable
    
    mynetworks = 127.0.0.0/8
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    
    #SASL config
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    
    any ideas on how to change my postfix to work with the extra domains listed in main.cf or on how to change ispconfig to not include them in the local-host-names file would be greatly appreciated.
     
    Last edited: Feb 8, 2007
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is working perfectly with all postfix releases, so do not change any of the files ISPConfig is writing or your setup wont work. You configured your postfix not as described in the perfect setup guide as virtual_alias_maps and virtual_alias_domains directives are not used in the setup.

    1) Remove these lines:

    virtual_alias_domains = /etc/postfix/local-host-names
    virtual_alias_maps = hash:/etc/postfix/virtusertable
    mydestination = www.mydomain.com, localhost, localhost.localdomain, localhost


    and add the following lines instead:

    virtual_maps = hash:/etc/postfix/virtusertable
    mydestination = /etc/postfix/local-host-names
     
  3. NETabuse

    NETabuse New Member

    Thanks for your post. fingers crossed we can solve this.
    What i think your missed in my post is that i setup postfix as suggested in the howto and it did not work, so i wiped postfix and resetup with my own config which is working just fine with the ispconfig setup, minus the hastle with the four lines at the start of local-host-names..

    Anyway, i set the main.cf as you suggested, putting
    mydestination = /etc/postfix/local-host-names
    and I allowed ispconfig to rewrite the local-host-names file again so it is in it's unaltered state. I then set
    virtual_maps = hash:/etc/postfix/virtusertable
    the resulting main.cf is below (not much different just your changes)
    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    myhostname = localhost
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = www.mydomain.com, localhost, localhost.localdomain, localhost
    mydestination = /etc/postfix/local-host-names
    relayhost =
    
    #virtual_alias_domains = /etc/postfix/local-host-names
    #virtual_alias_maps = hash:/etc/postfix/virtusertable
    virtual_maps = hash:/etc/postfix/virtusertable
    
    mynetworks = 127.0.0.0/8
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    
    #SASL config
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    
    
    now I reload postfix, and try send a mail to myself from gmail, it bounces with the following log messages. I also sent outgoing and that is working ok. (note I changed domain names and email address for privacy)

    Code:
    Feb  8 14:37:08 localhost postfix/smtpd[16241]: connect from ug-out-1314.google.com[66.249.92.172]
    Feb  8 14:37:08 localhost postfix/smtpd[16241]: C8E0A1178239: client=ug-out-1314.google.com[66.249.92.172]
    Feb  8 14:37:08 localhost postfix/cleanup[16246]: C8E0A1178239: message-id=<[email protected]>
    Feb  8 14:37:08 localhost postfix/qmgr[16212]: C8E0A1178239: from=<[email protected]>, size=1573, nrcpt=1 (queue active)
    Feb  8 14:37:08 localhost postfix/smtp[16248]: C8E0A1178239: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=0, status=bounced (mail for www.mydomain.com loops back to myself)
    Feb  8 14:37:08 localhost postfix/cleanup[16246]: D7EC5117823C: message-id=<20070208133708.D7EC5117823C@localhost>
    Feb  8 14:37:08 localhost postfix/qmgr[16212]: D7EC5117823C: from=<>, size=3322, nrcpt=1 (queue active)
    Feb  8 14:37:08 localhost postfix/qmgr[16212]: C8E0A1178239: removed
    Feb  8 14:37:10 localhost postfix/smtp[16248]: D7EC5117823C: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[64.233.183.27], delay=2, status=sent (250 2.0.0 OK 1170941656 q27si4979276nfc)
    Feb  8 14:37:10 localhost postfix/qmgr[16212]: D7EC5117823C: removed
    Feb  8 14:37:38 localhost postfix/smtpd[16241]: disconnect from ug-out-1314.google.com[66.249.92.172]
    

    Now as was happening when i originally setup postfix according to the howto, all incoming mail to the aliases is resulting in this "mail for www.mydomain.com loops back to myself"
    I cannot see how to fix this issue, from what I’ve read in the documentation it is unclear how to resolve it using the howto's version of main.cf.

    If you have any ideas on why this is, please let me know, much appreciated.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    I've setup this howto and it works perefctly. The loops back error is very easy to fix, just add the domain mentioned in the error message at the end of the file /etc/postfix/local-host-names and restart postfix.
     
  5. NETabuse

    NETabuse New Member

    Ok, the domain in the error message is already in local-host-names. This is the domain i setup for the server itself,
    is there perhaps a hostname for the server that it should point to to resolve as the final destination of the alias? or something?
     
  6. NETabuse

    NETabuse New Member

    ok gotit.. it was to do with the hostname settings for the server in he ispconfig settings (Management->server->settings)
    Thank you for the replies :) finally got a sense of how this system works.. but.. i'm confused about the virtual_maps directive. why defy the standard way it is outlined in the postifx.org documentation? as outlined here
    http://www.postfix.org/VIRTUAL_README.html#virtual_alias

    anyway. all is well, the howto directions are correct, just the idea of what to use in certain fields under server settings is a little hazy.
     

Share This Page