Small error with mail script on my website

Discussion in 'Installation/Configuration' started by jorizzzz, Jun 9, 2008.

  1. jorizzzz

    jorizzzz New Member

    I've got a strange problem with a mail script on my website. This script is a contact form that emails me with questions from users. But since i've began using an external mail server, the emails aren't delivered any more. I've done the following things:

    - Deleted my old mail accounts on the server
    - Deleted the mx records
    - set the mailserver (domain -> options -> mailserver) to external

    If i'm checking my log files while sending an e-mail, it says that it deliveres it to [email protected] instead of [email protected] what i've entered in the mail form.. is the hostname of my server...

    Here is a piece of code of the mail form:

    mail("$ContactWebsiteNaam <$ContactEmail>","$ContactOnderwerp","$Body","$Hoofd");
    Where $ContactEmail is [email protected]

    How can i correct these problems? This is the message from my mail.log:

    Jun  9 18:06:37 YH-Linux01 postfix/local[29337]: AC67F1D005B: to=<[email protected]>, relay=local, delay=0.07, delays=0.03/0/0/0.04, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
    As you can see, it is not mailed to my domain but to the hostname of my server...
  2. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/postfix/ and /etc/hosts? What's the output of
    hostname -f
  3. jorizzzz

    jorizzzz New Member
    # 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
    # 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:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_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.
    message_size_limit = 20971520
    myhostname =
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination =,, localhost
    relayhost =
    mynetworks =
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    message_size_limit = 25000000
    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_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
    smtpd_helo_required = yes
    disable_vrfy_command = yes
    strict_rfc821_envelopes = yes
    maps_rbl_domains =
    smtpd_recipient_restrictions =
    Code:       localhost.localdomain           localhost      YH-Linux01
    I've hidden the actual IP address

    Output of hostname -f:
  4. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/postfix/local-host-names, /etc/mailname, and /etc/aliases?
  5. jorizzzz

    jorizzzz New Member

    and ofcourse the domains of my clients

    # Added by installer for initial user
    root:   fred
    clamav: root
  6. falko

    falko Super Moderator ISPConfig Developer

    The problem is that is listed in /etc/postfix/local-host-names. Did you set the Co-Domain to external mailserver as well in ISPConfig (go to Co-Domains, select, and then go to the Options tab)?
  7. jorizzzz

    jorizzzz New Member

    Yes it is set to external mailserver. The ispconfig messages aren't coming in as well... These are sent to the same e-mail address.

    What is the best option for this? Remove the entry in local-host-names?
  8. falko

    falko Super Moderator ISPConfig Developer

    On the Co-Domains tab, or only for the main domain of the site?

    No, because ISPConfig will overwrite your changes...

Share This Page