Virtual Hosting with Postfix

Discussion in 'HOWTO-Related Questions' started by alexej, Apr 27, 2005.

  1. falko

    falko Super Moderator Howtoforge Staff

    adduser is the old command; you should use useradd now.
     
  2. davestroy

    davestroy New Member

    Problems with smtpd

    I have been able to open up port 25 and dovecot runs as expected. I think it is something else going wrong. This is to read in /var/log/mail.err after reloading postfix:

    Code:
    May 14 02:00:18 suse10064lamp postfix/smtpd[25290]: fatal: open database /etc/postfix/vmaps.db: Invalid argument 
    and in /var/logs/mail:

    Code:
    May 14 02:07:25 suse10064lamp postfix/smtpd[25307]: private/proxymap socket: wanted attribute: (list terminator)
    May 14 02:07:25 suse10064lamp postfix/smtpd[25307]: input attribute name: (end)
    May 14 02:07:25 suse10064lamp postfix/smtpd[25307]: dict_proxy_open: connect to map=unix:passwd.byname status=0 server_flags=0120
    May 14 02:07:25 suse10064lamp postfix/smtpd[25307]: dict_open: proxy:unix:passwd.byname
    May 14 02:07:25 suse10064lamp postfix/smtpd[25307]: dict_open: hash:/etc/aliases
    May 14 02:07:25 suse10064lamp postfix/smtpd[25307]: dict_open: hash:/etc/postfix/canonical
    May 14 02:07:25 suse10064lamp postfix/smtpd[25307]: dict_open: hash:/etc/postfix/valias
    May 14 02:07:25 suse10064lamp postfix/smtpd[25307]: fatal: open database /etc/postfix/vmaps.db: Invalid argument
    May 14 02:07:26 suse10064lamp postfix/master[24736]: warning: process /usr/lib/postfix/smtpd pid 25307 exit status 1
    May 14 02:07:26 suse10064lamp postfix/master[24736]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
    My main.cf looks like this (at the bottom)

    Code:
    readme_directory = /usr/share/doc/packages/postfix/README_FILES
    inet_protocols = all
    biff = no
    mail_spool_directory = /var/mail
    canonical_maps = hash:/etc/postfix/canonical
    virtual_maps = hash:/etc/postfix/virtual
    relocated_maps = hash:/etc/postfix/relocated
    transport_maps = hash:/etc/postfix/transport
    sender_canonical_maps = hash:/etc/postfix/sender_canonical
    masquerade_exceptions = root
    masquerade_classes = envelope_sender, header_sender, header_recipient
    myhostname = suse10064lamp.site
    program_directory = /usr/lib/postfix
    masquerade_domains = 
    mydestination = $myhostname, localhost.$mydomain
    defer_transports = 
    disable_dns_lookups = no
    mailbox_command = 
    mailbox_transport = 
    strict_8bitmime = no
    disable_mime_output_conversion = no
    smtpd_sender_restrictions = hash:/etc/postfix/access
    smtpd_client_restrictions = 
    smtpd_helo_required = no
    smtpd_helo_restrictions = 
    strict_rfc821_envelopes = no
    smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
    smtp_sasl_auth_enable = no
    smtpd_sasl_auth_enable = no
    #smtpd_sasl_local_domain =
    smtpd_use_tls = no
    smtp_use_tls = no
    alias_maps = hash:/etc/aliases
    mailbox_size_limit = 0
    message_size_limit = 10240000
    
    virtual_mailbox_domains = /etc/postfix/vhosts
    virtual_mailbox_base = /var/spool/vmail 
    virtual_mailbox_maps = hash:/etc/postfix/vmaps
    virtual_uid_maps = static:1000
    virtual_gid_maps = static:1000 
    virtual_alias_maps = hash:/etc/postfix/valias

    Can anyone tell something from this?

    / David
     
    Last edited: May 14, 2006
  3. davestroy

    davestroy New Member

    Problem less big

    The las errors had to do with some misconfiguration when i tried to use gid 1000 because that id is used by ftp on my server.

    Code:
    virtual_uid_maps = static:1000
    virtual_gid_maps = static:1000
    So I am able to use mailaccounts that I alias to some other mail. If I remove alias mails sent to accounts on my server are bounced saying that the user does not exist:

    Code:
    [HTML]<<< 550 <[email protected]>: Recipient address rejected: User unknown in local recipient table
    550 5.1.1 <[email protected]>... User unknown
    <<< 554 Error: no valid recipients
    Reporting-MTA: dns; mail.domain.com
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Did you follow this tutorial: http://www.howtoforge.com/linux_postfix_virtual_hosting to the letter? Because I don't use /etc/postfix/vmaps.db in that tutorial, so I guess you made some changes.
    However, run
    Code:
    postmap /etc/postfix/vmaps
    and restart Postfix to get rid of the /etc/postfix/vmaps.db error.
     
  5. DCLoppy

    DCLoppy New Member

    I too am trying to follow this tutorial but seem have made a basic error and would appreciate any pointers:

    Thhe configuration file stops loading at the lines

    24 auth_userdb = passwd-file /etc/dovecot/users
    25 auth_passdb = passwd-file /etc/dovecot/passwd

    message is "error in config file .....: Unknown setting: userdb

    Dovecot version is 1.0beta 3 running under FreeBSD 6.0

    Thanks
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Maybe you're missing a module for dovecot?
    What's the exact error message?
     
  7. DCLoppy

    DCLoppy New Member

    I solved ( or worked around) the problem I had earlier - see a few messages ago - by using a different format


    userdb passwd-file {
    args = /etc/dovecot/users
    }


    instead of the style used in the tutorial. Or maybe I changed something else and fixed another problem ??? Anyway everything is now working.
     

Share This Page