contact.php is not working

Discussion in 'Installation/Configuration' started by golan, Jun 21, 2007.

  1. golan

    golan New Member

    I have a contact.php which i tested on the other website which is hosted by other company and it works fine. But when i am using it on the other website which i am hosting it by myself it is not working!
    Is it any configuration on my Apache servre which i need to do to make this page working?

    Your help is appreciated.


    The Contact file is:
    Error_Reporting(E_ALL & ~E_NOTICE);

    while ($request = current($_REQUEST)) {
    if (key($_REQUEST)!='recipient') {
    $pre_array=split ("&777&", $request);

    $subject="From ".$post_vars['your_name'][0] ;
    $headers= "From: ".$post_vars['your_email'][0] ."\n";
    $headers.='Content-type: text/html; charset=iso-8859-1';
    while ($mess = current($post_vars)) {
    if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {


    mail("[email protected]", $subject, "
    <title>Contact letter</title>
    </html>" , $headers);
    echo ("Your message was successfully sent!");

    resizeTo(300, 300);
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which lines get added to the mail log file when you send a email with your php script?
  3. golan

    golan New Member

    Hi Till,
    I dont get what do you mean, would you please explaine it a bit more?

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Have a look at your mail log file which i in the directoyr /var/log/ and post the line that got added to this file when you send a email with the above php script.
  5. golan

    golan New Member

    Hi Till,
    Here is the lines:

    Jun 21 14:38:24 localhost postfix/pickup[11260]: EF7B3BB0072: uid=48 from=<apache>
    Jun 21 14:38:25 localhost postfix/cleanup[13184]: EF7B3BB0072: message-id=<[email protected]>
    Jun 21 14:38:25 localhost postfix/qmgr[25099]: EF7B3BB0072: from=<[email protected]>, size=424, nrcpt=1 (queue active)
    Jun 21 14:38:26 localhost postfix/smtp[13186]: EF7B3BB0072: to=<[email protected]>,[]:25, delay=1.3, delays=0.08/0.2/0.75/0.27, dsn=2.0.0, status=sent (250 ok dirdel)
    Jun 21 14:38:26 localhost postfix/qmgr[25099]: EF7B3BB0072: removed
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, this means your script and server is working fine and the email has been sent to the yahoo account. I guess that yahoo has deleted your email as it was sent from the sender address "[email protected]". You should check that you have set a valid hostname for your server.
  7. golan

    golan New Member

    Hi Till,
    how can i check it?

  8. golan

    golan New Member

    In regard to this issue when i am sending to my email address at [email protected] it works prefect.

  9. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    hostname -f
    postconf -n
  10. golan

    golan New Member

    Output of hostname and hostname -f is: localhost.localdomain
    and output of postconf -n is:
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    broken_sasl_auth_clients = yes
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    debug_peer_level = 2
    home_mailbox = Maildir/
    html_directory = no
    inet_interfaces = all
    mail_owner = postfix
    mailbox_command =
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    mydestination = /etc/postfix/local-host-names
    mynetworks =
    newaliases_path = /usr/bin/newaliases.postfix
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
    sample_directory = /usr/share/doc/postfix-2.3.3/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtp_tls_note_starttls_offer = yes
    smtp_use_tls = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain =
    smtpd_sasl_security_options = noanonymous
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_auth_only = no
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    smtpd_use_tls = yes
    tls_random_source = dev:/dev/urandom
    unknown_local_recipient_reject_code = 550
  11. falko

    falko Super Moderator ISPConfig Developer

    You need to set a proper hostname in your Postfix configuration:
    postconf -e 'myorigin = my.hostname.tld'
    /etc/init.d/postfix restart
    If you are not sure what hostname to use, you can look up a hostname using the server's public IP address:
    dig -x
    where must be replaced with the server's real public IP address.
  12. golan

    golan New Member

    Dear Falko,
    Below is the result of the dig command.
    But i have a question. if i buy a domain name as and ask the registrar for name servers as and then how can i set my server with these addresses?


    ; <<>> DiG 9.3.3rc2 <<>> -x
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6698
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

    ; IN PTR


    ;; AUTHORITY SECTION: 44141 IN NS 44141 IN NS

    ;; ADDITIONAL SECTION: 21524 IN A 21525 IN A

    ;; Query time: 17 msec
    ;; SERVER:
    ;; WHEN: Tue Jun 26 15:05:56 2007
    ;; MSG SIZE rcvd: 171
  13. till

    till Super Moderator Staff Member ISPConfig Developer

  14. golan

    golan New Member

    Hi Till,
    I believe i need to explain my question a little more:
    I have a sever which i would like to use it as a web server and host websites.
    whenever i register a domain they asked me about the name servers which i dont have and instead i give them my web server ip.
    And it works but has problem as i described at my first post.
    So to resolve this issue which i explained at my first post do i need to have a name server?
    And i have a domain like which point to my web server ip address and if ask my registrar for the name servers such as and which points to my web server ip address:
    Now if i want to rigister a new domain and hosted on my server can i give this two name servers instead the web server ip address (which are same) to the registrar?

    Last edited: Jul 4, 2007
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess what you need is a technical domain. That means a domain that points to your server IP with 2 A-Records, e.g. ns1 and, but the dns for this domain is not hosted on your server.

    You can either achieve this by using managed DNS for one of your domains from your domain registrar or you use a domain from e.g. dyndns or noip to point to your server.

Share This Page