Postfix and Virual Domains using ISPConfig on Ubuntu

Discussion in 'Installation/Configuration' started by Guta, Nov 15, 2008.

  1. Guta

    Guta New Member

    Hi all,

    I have a Linode box (for those that don't know it, it's a VPS). I installed Ubuntu 8 and ISPConfig 2 using the tutorials on howtoforge.

    I'm using Postfix to handle my emails. I have set with ISPConfig 6 different domains. Each domain has a user and an email address configured. But for some reason, when sending emails directly to any of those domains, all emails are redirected to the first domain I set with ISPConfig.

    It seems to me that there's a problem with virtual users and domains... but i'm knew to Linux so...

    Here are my Postfix config files:

    MAIN.CF
    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
    
    readme_directory = no
    
    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    myhostname = server1.guta.fr
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = server1.guta.fr, localhost.guta.fr, , localhost.localdomain, localhost
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    
    virtual_maps = hash:/etc/postfix/virtusertable
    mydestination = /etc/postfix/local-host-names
    

    VIRTUSERTABLE
    Code:
    ###################################
    #
    # ISPConfig virtusertable Configuration File
    #         Version 1.0
    #
    ###################################
    [email protected]    web1_guta
    [email protected]    web1_guta
    @www.guta.fr    web1_guta
    [email protected]    web1_guta
    [email protected]    web1_guta
    @guta.fr    web1_guta
    [email protected]    web1_guta
    [email protected]    web1_guta
    @server1.guta.fr    web1_guta
    [email protected]    web2_thomas
    [email protected]    web2_thomas
    @www.thomasbernier.com    web2_thomas
    [email protected]    web2_thomas
    [email protected]    web2_thomas
    @thomasbernier.com    web2_thomas
    [email protected]    web3_mystreaminglinks
    [email protected]    web3_mystreaminglinks
    @www.mystreaminglinks.com    web3_mystreaminglinks
    [email protected]    web3_mystreaminglinks
    [email protected]    web3_mystreaminglinks
    @mystreaminglinks.com    web3_mystreaminglinks
    [email protected]    web5_mjthenoz
    [email protected]    web5_mjthenoz
    @www.lerepitenchante.fr    web5_mjthenoz
    [email protected]    web5_mjthenoz
    [email protected]    web5_mjthenoz
    @lerepitenchante.fr    web5_mjthenoz
    [email protected]    web6_admin
    [email protected]    web6_admin
    @www.bernierconsulting.com    web6_admin
    [email protected]    web6_admin
    [email protected]    web6_admin
    @bernierconsulting.com    web6_admin
    #### MAKE MANUAL ENTRIES BELOW THIS LINE! ####
    
    LOCAL-HOST-NAMES
    Code:
    ###################################
    #
    # ISPConfig local-host-names Configuration File
    #         Version 1.0
    #
    ###################################
    localhost
    server1.guta.fr
    localhost.server1.guta.fr
    localhost.guta.fr
    localhost.localdomain
    www.guta.fr
    www.thomasbernier.com
    www.mystreaminglinks.com
    www.lerepitenchante.fr
    www.bernierconsulting.com
    guta.fr
    thomasbernier.com
    mystreaminglinks.com
    lerepitenchante.fr
    bernierconsulting.com
    #### MAKE MANUAL ENTRIES BELOW THIS LINE! ####
    

    Ok that's for the config files. Now the mail logs:

    Code:
    Nov 15 11:53:26 server1 postfix/cleanup[16439]: BC56E105D6: message-id=<[email protected]>
    Nov 15 11:53:26 server1 postfix/local[16457]: 4EFA8FFC0: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=2.5, delays=0.26/0/0/2.3, dsn=2.0.0, status=sent (forwarded as BC56E105D6)
    Nov 15 11:53:26 server1 postfix/qmgr[16368]: BC56E105D6: from=<[email protected]>, size=2235, nrcpt=1 (queue active)
    Nov 15 11:53:26 server1 postfix/qmgr[16368]: 4EFA8FFC0: removed
    Nov 15 11:53:28 server1 postfix/smtp[16472]: BC56E105D6: to=<[email protected]>, orig_to=<[email protected]>, relay=gmail-smtp-in.l.google.com[209.85.217.181]:25, delay=1.6, delays=0/0/0.08/1.5, dsn=2.0.0, status=sent (250 2.0.0 OK 1226768008 6si4623215gxk.87)
    Nov 15 11:53:28 server1 postfix/qmgr[16368]: BC56E105D6: removed
    Nov 15 11:53:54 server1 postfix/smtpd[16434]: disconnect from wa-out-1112.google.com[209.85.146.178]
    
    The log above is for a mail I sent to [email protected]. On the log we can see that postfix assumes this email address is to [email protected] and then uses the configuration for the user web1_guta instead of using the one for web6_admin. I don't know if this is normal or not, but the thing is that it doesn't work properly.

    Well that's all folks, if you need anymore info to go through this issue let me know.

    Thanks!
     
  2. _X_

    _X_ New Member

    is catchAll-Email: option enabled for web1_guta?

    did mail to [email protected] arrived at jeane mailbox?
     
  3. Guta

    Guta New Member

    catAll is enabled on web1_guta but also for web6_admin (the user using [email protected]).

    It didn't.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig 2 does not support virtual mail users. You must configure your server as described in the perfect setup guides listed on ispconfig.org
     
  5. Guta

    Guta New Member

    I followed the setup tutorial on ispconfig.org, but there's still something wrong.

    For the user web5_mjthenoz, the emails sent using the form on the website are properly redirected to that user's external email address.

    When using the form on web6_admin's website the email isn't redirected to the email I set on the .forward file. It's instead forwarded to the email set to web1_guta.

    Any help?
     
  6. Guta

    Guta New Member

    I think I found the problem!

    My hostname is server1.guta.fr. One of the sites I added using ISPConfig is guta.fr.

    guta.fr was set with the catchAll option. Since all incoming emails are seen by postfix as being to "USERNAME"@server1.guta.fr it triggered the catchAll option on web1_guta.

    So ithe problem is a conflict between my hostname and one of my domains on it. What do you guys think? Could that be the issue? If so, how can I change my hostname so I can put back the catchAll option on web1_guta?

    Thanks!
     
  7. falko

    falko Super Moderator ISPConfig Developer

  8. Guta

    Guta New Member

    Thanks Falko! But one last question: won't it be a problem if $mydomain isn't the same as my hostname? Or can it be anything I want?

    And just to be sure, $mydomain is set on the myhostname parameter, right?
     
    Last edited: Nov 16, 2008
  9. falko

    falko Super Moderator ISPConfig Developer

    You can use $mydomain in myhostname, e.g.:
    mydomain = somedomain.com
    myhostname = server1.$mydomain
     

Share This Page