Can not send mails to server

Discussion in 'Installation/Configuration' started by heinerlamprecht, Sep 23, 2007.

  1. heinerlamprecht

    heinerlamprecht New Member


    I'm still testing out my new server and now noticed, that I can not send mails to an emailadress configured with ISPConfig. I allways get the messages "User unknown in local recipient table".

    Does anybody have an idea how to solve or where to look at?


  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you create a co-domain for the website with empty hostname field?
  3. heinerlamprecht

    heinerlamprecht New Member

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    This looks fine.Please post the content of /etc/postfix/, comments stripped.
  5. heinerlamprecht

    heinerlamprecht New Member

    Here it is:

    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/lib/postfix
    mail_owner = postfix
    unknown_local_recipient_reject_code = 550
    debug_peer_level = 2
    debugger_command =
             xxgdb $daemon_directory/$process_name $process_id & sleep 5
    sendmail_path = /usr/sbin/sendmail
    newaliases_path = /usr/bin/newaliases
    mailq_path = /usr/bin/mailq
    setgid_group = maildrop
    html_directory = /usr/share/doc/packages/postfix/html
    manpage_directory = /usr/share/man
    sample_directory = /usr/share/doc/packages/postfix/samples
    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_alias_domains = 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 = 88-198-66-74.$mydomain
    program_directory = /usr/lib/postfix
    inet_interfaces = all
    masquerade_domains =
    defer_transports =
    mynetworks_style = subnet
    disable_dns_lookups = no
    relayhost =
    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_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtp_sasl_auth_enable = no
    smtpd_sasl_auth_enable = yes
    smtpd_use_tls = yes
    smtp_use_tls = yes
    alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    mailbox_size_limit = 0
    message_size_limit = 10240000
    mydomain =
    mynetworks =
    smtpd_sasl_local_domain =
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_tls_auth_only = no
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    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
    mydestination = /etc/postfix/local-host-names
    virtual_alias_maps = hash:/etc/postfix/virtusertable
    virtual_maps = $virtual_alias_maps
  6. heinerlamprecht

    heinerlamprecht New Member

    One step further ...

    Okay, when I make a

    postmap virtusertable
    rcpostfix reload
    I get an other error:

    <[email protected]> (expanded from <[email protected]>): Host or domain name not found. Name service error for type=AAAA: Host found but no data record of requested type
    Firstly, it seems that virtusertable.db is not compiled correctly by ISPConfig. And there seems to be some DNS problem.

    Any idea where to screw next?

  7. heinerlamprecht

    heinerlamprecht New Member

    The DNS problem is solved now, I had to add the servername to $mydestination in /etc/postfix/

    Will ISPConfig overwrite this setting?

    And how can I ensure, ISPConfig will properly create the hash files in /etc/postfix/? I don't want to do this on my own, whenever someone changes the mailconfiguration.


  8. heinerlamprecht

    heinerlamprecht New Member

    I've checked /home/admispconfig/ispconfig/ispconfig.log, and it reports a problem:

    23.09.2007 - 20:55:46 => WARN - /root/ispconfig/scripts/lib/classes/ispconfig_postfix.lib.php, Line 289: WARNING: could not postmap hash:/etc/postfix/virtusertable
    When I call postmap manually on /etc/postfix/virtusertable, I don't get any problems. So, why can't this be called by ISPConfig?

  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Do not add this to mydestination. You should add it at the end of /etc/postfix/local-host-names.
  10. heinerlamprecht

    heinerlamprecht New Member

    Okay, I moved it to local-host-names.

    But the main problem remains. When the mailconfiguration is changed in ISPConfig, the virtusertable is messed up. ISPConfig can not call postmap. But why not? virtusertable.db has exactly the same rights as virtusertable. The interesting thing is, that both files are changed. Some programm is updating virtusertable.db.

    I removed the line causing the warning. virtusertable.db is still updated. What is going on here?


    24.09.2007 - 20:50:10 => INFO - Signalfile Set: insert
    24.09.2007 - 20:50:20 => INFO - USER:
    24.09.2007 - 20:50:21 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 661: cp -fr /root/ispconfig/isp/user_standard_index.html_de /srv/www/web4/user/web4_bla/web/index.html
    24.09.2007 - 20:50:21 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 717: setquota -u web4_bla 0 0 0 0 -a &> /dev/null
    24.09.2007 - 20:50:21 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 718: setquota -T -u web4_bla 604800 604800 -a &> /dev/null
    24.09.2007 - 20:50:21 => INFO - /root/ispconfig/scripts/lib/classes/ispconfig_procmail.lib.php, Line 57: cp -f /root/ispconfig/isp/conf/forward.master /srv/www/web4/user/web4_bla/.forward
    24.09.2007 - 20:50:21 => INFO - maildirmake /srv/www/web4/user/web4_bla/Maildir &> /dev/null, Line 106: maildirmake /srv/www/web4/user/web4_bla/Maildir &> /dev/null
    24.09.2007 - 20:50:21 => INFO - /root/ispconfig/scripts/lib/classes/ispconfig_postfix.lib.php, Line 137: cp -fr /etc/postfix/local-host-names /etc/postfix/local-host-names~
    24.09.2007 - 20:50:21 => INFO - /root/ispconfig/scripts/lib/classes/ispconfig_postfix.lib.php, Line 284: cp -fr /etc/postfix/virtusertable /etc/postfix/virtusertable~
    24.09.2007 - 20:50:22 => WARN - /root/ispconfig/scripts/lib/classes/ispconfig_postfix.lib.php, Line 289: WARNING: could not postmap hash:/etc/postfix/virtusertable
    24.09.2007 - 20:50:22 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 1230: cp -fr /etc/apache2/vhosts/Vhosts_ispconfig.conf /etc/apache2/vhosts/Vhosts_ispconfig.conf~
    24.09.2007 - 20:50:22 => INFO - HTTPD_SYNTAX_CHECK: suexec
    24.09.2007 - 20:50:22 => INFO - /root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php, Line 706: /etc/init.d/postfix stop &> /dev/null
    24.09.2007 - 20:50:23 => INFO - /root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php, Line 706: /etc/init.d/postfix start &> /dev/null
    24.09.2007 - 20:50:23 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 1891: cp -fr /etc/proftpd_ispconfig.conf /etc/proftpd_ispconfig.conf~
    Sep 24 19:20:54 88-198-66-74 postfix/anvil[29633]: statistics: max connection count 1 for (smtp: at Sep 24 19:17:34
    Sep 24 19:20:54 88-198-66-74 postfix/anvil[29633]: statistics: max cache size 1 at Sep 24 19:17:34
    Sep 24 20:50:21 88-198-66-74 postfix/postmap[31202]: fatal: open database /etc/postfix/virtusertable.db: No such file or directory
    Sep 24 20:50:22 88-198-66-74 postfix/master[12929]: terminating on signal 15
    Sep 24 20:50:23 88-198-66-74 postfix/postfix-script: starting the Postfix mail system
    Sep 24 20:50:23 88-198-66-74 postfix/master[31279]: daemon started -- version 2.3.2, configuration /etc/postfix
    Sep 24 20:53:26 88-198-66-74 postfix/smtpd[31361]: warning: database /etc/postfix/virtusertable.db is older than source file /etc/postfix/virtusertable
    Sep 24 20:53:26 88-198-66-74 postfix/smtpd[31361]: cannot load Certificate Authority data
    Sep 24 20:53:26 88-198-66-74 postfix/smtpd[31361]: warning: TLS library problem: 31361:error:02001002:system library:fopen:No such file or directory:bss_file.c:122:fopen('/etc/postfix/ssl/cacert.pem','r'):
    Sep 24 20:53:26 88-198-66-74 postfix/smtpd[31361]: warning: TLS library problem: 31361:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:125:
    Sep 24 20:53:26 88-198-66-74 postfix/smtpd[31361]: warning: TLS library problem: 31361:error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib:by_file.c:274:
    Sep 24 20:53:27 88-198-66-74 postfix/smtpd[31361]: connect from[]
    Sep 24 20:53:27 88-198-66-74 postfix/smtpd[31361]: NOQUEUE: reject: RCPT from[]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<>
    Sep 24 20:53:27 88-198-66-74 postfix/smtpd[31361]: disconnect from[]
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Which line is causing the warning?
  12. heinerlamprecht

    heinerlamprecht New Member

    Line 289:

    $mod->log->caselog("postmap hash:".$mod->system->server_conf["server_sendmail_virtuser_datei"], $this->FILE, __LINE__);
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    This line is correct. What is the content of the field "Virtuser Datei:" in ISPConfig under management > server > settings on the mail tab? Make sure that there are no spaches at the front before the file name.
  14. heinerlamprecht

    heinerlamprecht New Member

    Solved (hopefully ...)

    I checked the entry and there were no leading or trailing spaces. However, I realized, that the line in question should not have been called at all.

    The MTA type was set to Postfix (according to the webpage), as I run this. But the code causing the troubles is only supposed to be executed when using Sendmail. Line 43 of <tt>/root/ispconfig/scripts/lib/classes/ispconfig_postfix.lib.php</tt> is:

    if($go_info["server"]["postfix_config"] == 1){  // SENDMAIL-STYLE
    After I changed the style first to Sendmail and afterwards back to Postfix, everything goes well. Changes to the email configuration are written to the virtusertable, and postmap works without problems. And most importand: Mail are not rejected anymore ;)

    Could it be, that there is a problem in the installation? I don't remember I changed the MTA setting before.

    Thanks for your support,

  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Sendmail and postfix style works both with postfix and they both must execute the postmap command. It are just different config file layouts.
  16. jokn

    jokn New Member

    Any other suggestions for a solution?


    Have the exact same problem with my setup, as soon as the mailsystem is updated with a new address or a change the server stops accepting mail:

    Oct 4 13:14:18 suse postfix/postmap[19885]: fatal: open database /etc/postfix/virtusertable.db: No such file or directory

    I tried the last tip, changed MTA style, but I had no luck with that, same problem occurs every time I change something. If I run postmap manually and restart the server everything is fine again.

    Anyone find a solution yet or something else I could try?


  17. Elfchen

    Elfchen New Member

    what exactly did you change? please describe in detail. I have exactly the same problem shown here
  18. jokn

    jokn New Member


    Sorry to hear you have the same problem, it's a real pain. I had to upgrade postfix to the latest version via an rpm, only solution I've found so far.

    The problem with that is that it breaks TLS somehow, all mail except those who try to use authentication is delivered, and I've had to comment out everything having to do with TLS from When the server doesn't accept TLS everything is delivered again, even emails from domains that first try to use authentication.

    There's probably a solution for that somewhere but I'm new at this and spare time, reluctant admin of our web hotel so I haven't researched it more.

    Maybe I'll dig deeper when I move the whole thing to another dist somewhere in the future...

    Good Luck!


Share This Page