Old 31st January 2007, 23:23
Apollo Apollo is offline
Junior Member
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default php mail() broken all mail

After having some problems with ISPConfig mail, I reinstalled the lot on my dedicated server again today.

The server name is: apollo.danieldavies.co.uk
root@apollo:/# hostname   
I am following the guide line by line for Ubuntu 5.10, and everything worked really well. I pointed the DNS server for my domain, studio-e.co.uk at my dedicated server. danieldavies.co.uk DNS is managed elsewhere, so i created two a records, ns1.danieldavies.co.uk and ns2.danieldavies.co.uk both to apollo. I created one account for the site, studio-e.co.uk, web1_daniel. I added the IMAP account to Evolution and sent a couple of test mails which were received, and I replied to them. Squirrelmail worked well also, allowed me to send an recieve.

The problem came when I added a php contact form to my website. I have tried using both:
$from = "daniel@studio-e.co.uk";	
mail("$to", "$subject", "$msg", "$headers", "-f$from");


mail("$to", "$subject", "$msg", "$headers"");
I sent an email through both mail functions, and it did not work either time. I also can no longer send or recieve emails to daniel@studio-e.co.uk from external accounts such as hotmail/gmail. No error emails are received when sending, and I have this showing up in the log when I send from the php form. Here is the output I get from tail -f on /var/log/mail.log:

Jan 31 21:03:05 apollo sendmail[8672]: l0VL355k008672: Authentication-Warning: apollo.danieldavies.co.uk: www-data set sender to daniel@studio-e.co.uk using -f
Jan 31 21:03:05 apollo sendmail[8672]: l0VL355k008672: from=daniel@studio-e.co.uk, size=438, class=0, nrcpts=1, msgid=<200701312103.l0VL355k008672@apollo.danieldavies.co.uk>, relay=www-data@localhost
Jan 31 21:03:06 apollo sm-mta[8673]: l0VL365O008673: from=<daniel@studio-e.co.uk>, size=788, class=0, nrcpts=1, msgid=<200701312103.l0VL355k008672@apollo.danieldavies.co.uk>, proto=ESMTP, daemon=MSP-v4, relay=localhost []
Jan 31 21:03:06 apollo sendmail[8672]: l0VL355k008672: to=daniel@studio-e.co.uk, ctladdr=daniel@studio-e.co.uk (33/33), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30438, relay=[] [], dsn=2.0.0, stat=Sent (l0VL365O008673 Message accepted for delivery)
Jan 31 21:03:06 apollo sm-mta[8675]: l0VL365O008673: to=<daniel@studio-e.co.uk>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120788, relay=studio-e.co.uk. [], dsn=4.0.0, stat=Deferred: Connection refused by studio-e.co.uk.
And the tail output when I try using mail without the "-f$form"
Jan 31 21:05:56 apollo sendmail[8725]: l0VL5ufA008725: from=www-data, size=438, class=0, nrcpts=1, msgid=<200701312105.l0VL5ufA008725@apollo.danieldavies.co.uk>, relay=www-data@localhost
Jan 31 21:05:57 apollo sm-mta[8726]: l0VL5vWm008726: from=<www-data@apollo.danieldavies.co.uk>, size=681, class=0, nrcpts=1, msgid=<200701312105.l0VL5ufA008725@apollo.danieldavies.co.uk>, proto=ESMTP, daemon=MSP-v4, relay=localhost []
Jan 31 21:05:58 apollo sendmail[8725]: l0VL5ufA008725: to=daniel@studio-e.co.uk, ctladdr=www-data (33/33), delay=00:00:02, xdelay=00:00:01, mailer=relay, pri=30438, relay=[] [], dsn=2.0.0, stat=Sent (l0VL5vWm008726 Message accepted for delivery)
Jan 31 21:05:58 apollo sm-mta[8728]: l0VL5vWm008726: to=<daniel@studio-e.co.uk>, ctladdr=<www-data@apollo.danieldavies.co.uk> (33/33), delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=120681, relay=studio-e.co.uk. [], dsn=4.0.0, stat=Deferred: Connection refused by studio-e.co.uk.
As I said, this was working before I tried to use the PHP mail, so I am confident that all the is correct, and Maildir is selected in the settings > mail. You can view the phpinfo() here: http://www.studio-e.co.uk/info.php.

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
#delay_warning_time = 4h
myhostname = apollo.danieldavies.co.uk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = apollo.danieldavies.co.uk, dev.bytemark.co.uk, localhost.bytemark.co.uk, localhost
relayhost =
mynetworks =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = 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
smtpd_use_tls = yes
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
mailbox_command = 
home_mailbox = Maildir/

mydestination = /etc/postfix/local-host-names
virtual_maps = hash:/etc/postfix/virtusertable
daniel@www.studio-e.co.uk    web1_daniel
web1_daniel@www.studio-e.co.uk    web1_daniel
daniel@studio-e.co.uk    web1_daniel
web1_daniel@studio-e.co.uk    web1_daniel
I have a feeling that the failed mails from the form are staying in some kind of queue, which is preventing all future email getting through.

Firstly, can anyone suggest anyway to get the php mail() function working
Secondly, how can I clean out the queue, so all the failed emails are removed from the system

Thanks in advance to anyone who can give any assistance on this issue. If anymore info is needed please ask.
Reply With Quote
Sponsored Links
Old 31st January 2007, 23:28
Apollo Apollo is offline
Junior Member
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Oh, and I should mention, i can send emails through the php form if i send them to email address outside of of my server (ie hotmail.com emails)
Reply With Quote
Old 1st February 2007, 00:17
Apollo Apollo is offline
Junior Member
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Ok, please ignore me. Despite everything working just fine before using the php mail() form, and not after using it, postfix managed to disappear . I did apt-get install postfix (despite my bash history showing i did this during setup) and it installed it, and all working, including the form.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 10:29
Slightly Confused (DNS & Server Help) JohnnyBGoode Installation/Configuration 26 14th August 2007 10:54
Postfix reject connections gabrix Server Operation 27 25th January 2007 09:37
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 13:16
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs ebbay Installation/Configuration 9 4th March 2006 12:47

All times are GMT +2. The time now is 17:34.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.