PDA

View Full Version : Postfix-unable to send mail through PHP


wesleyjones
28th September 2006, 21:11
I am running ISPConfig on Centos 4.3.

I can log into the server with Squirrelmail and send a message out. Although the from name is wesley@example.com instead of wesley@3scrapateers.com.

I can connect to the server with a POP3 client and send mail as well.

The problem I am having is sending mail from our vbulletin website through PHP.

My most recent mail log is over 25 MB in size and growing! I have not changed my mx record to point to the new server yet as I wanted to get the bugs out first.

My php.ini file contains this statement >>
sendmail_path = /usr/sbin/sendmail -t -i

I didn't want to just start editing files trying to fix the problem for fear of messing up ISPConfig.

Does anyone have any ideas of where to start?

Thanks,

Wesley Jones

till
29th September 2006, 11:46
I can log into the server with Squirrelmail and send a message out. Although the from name is wesley@example.com instead of wesley@3scrapateers.com.

Have you tried to change this in squirrelmail in the account settings?

The problem I am having is sending mail from our vbulletin website through PHP.

Do you send email in vbulleting trough smtp or directly through PHP?

My most recent mail log is over 25 MB in size and growing! I have not changed my mx record to point to the new server yet as I wanted to get the bugs out first.

Please post an excerpt of the mail.log

My php.ini file contains this statement >>
sendmail_path = /usr/sbin/sendmail -t -i

Thats ok. Does the file /usr/sbin/sendmail exists?

gilas
29th September 2006, 15:45
Hi folks :-)
i had a similar problem, so that I post this message in hope to be helpful.
Infact I have a third-level domain, I can't have any second level domain.
So that i.e. my domain is:

example.domain.com

it happens that at each reboot and at each new site creation (or, I suppose after ispconfig restart) that the file /etc/postfix/local-host-names contains inside this string:
<... domain ...>
<... domain ...>
domain.com

but domain.com is not my domain

then, if PHP attempts to send an email postfix thinks to send mail toward itself.

This is very annoying becaus at each modification (new site defined, system restart) I must to modify manually the file 'local-host-names' ad comment the string domain.com.

Note: I can't have a second-level domain because our edu organization cannot have more than one.

Could anyone help me please?!? Thank you very much!

falko
1st October 2006, 00:48
Please post your /etc/postfix/local-host-names (please don't replace your real domain names).

wesleyjones
2nd October 2006, 23:40
Thanks till for the response....

I fixed the wesley@example.com by updating the account settings in squirrelmail. So that is solved.

I can manually send mail directly from the console using PUTTY.

I'm not sure if I'm sending mail through sendmail or through SMTP. I can post my php.ini file if that will help. In the meantime, I changed my ISPConfig settings to external mailserver and some of the forum emails are actually getting out, but not all of them.

All the guides suggest using postfix, although sendmail is also an option in the ISPConfig control panel. I don't care which one we use as long as I can get it to work.

The file /usr/sbin/sendmail does exist.

It appears that the mail was getting caught up in /var/spool/mail

Mailog excerpt:
Oct 2 15:26:41 130 postfix/smtp[20996]: 14BF1199802B: host mx1.rog.mail.yahoo.com[64.156.215.23] said: 451 mta110.rog.mail.scd.yahoo.com Resources temporarily unavailable. Please try again later. [#4.16.4:190]. (in reply to end of DATA command)
Oct 2 15:26:41 130 postfix/smtp[20996]: 14BF1199802B: to=<bond019@rogers.com>, relay=mx1.rog.mail.yahoo.com[67.28.113.16], delay=0, status=sent (250 ok dirdel)
Oct 2 15:26:41 130 postfix/qmgr[16655]: 14BF1199802B: removed
Oct 2 15:26:42 130 postfix/smtp[20992]: 93CFB199802A: to=<neissa@newwavecomm.net>, relay=razor.broadbandsupport.net[209.55.5.140], delay=2, status=bounced (host razor.broadbandsupport.net[209.55.5.140] said: 501 Sender domain must exist (in reply to MAIL FROM command))
Oct 2 15:26:42 130 postfix/cleanup[20991]: 5AF57199802C: message-id=<20061002202642.5AF57199802C@localhost.localdomain>
Oct 2 15:26:42 130 postfix/qmgr[16655]: 5AF57199802C: from=<>, size=3643, nrcpt=1 (queue active)
Oct 2 15:26:42 130 postfix/qmgr[16655]: 93CFB199802A: removed
Oct 2 15:26:42 130 postfix/local[20998]: 5AF57199802C: to=<root@localhost.localdomain>, orig_to=<apache@130.84.32.216.reverse.layeredtech.com>, relay=local, delay=0, status=sent (delivered to maildir)
Oct 2 15:26:42 130 postfix/qmgr[16655]: 5AF57199802C: removed
Oct 2 15:26:56 130 postfix/scache[20828]: statistics: start interval Oct 2 15:23:30
Oct 2 15:26:56 130 postfix/scache[20828]: statistics: domain lookup hits=0 miss=8 success=0%
Oct 2 15:26:56 130 postfix/scache[20828]: statistics: address lookup hits=0 miss=32 success=0%
Oct 2 15:26:56 130 postfix/scache[20828]: statistics: max simultaneous domains=1 addresses=4 connection=15
Oct 2 15:31:41 130 sendmail[21372]: k92KVeT6021372: from=apache, size=1433, class=0, nrcpts=1, msgid=<200610022039.4b74b5500949@www.3scrapateers.com>, relay=apache@localhost
Oct 2 15:31:41 130 postfix/smtpd[21375]: warning: cannot get certificate from file /etc/postfix/ssl/smtpd.crt
Oct 2 15:31:41 130 postfix/smtpd[21375]: warning: TLS library problem: 21375:error:02001002:system library:fopen:No such file or directory:bss_file.c:259:fopen('/etc/postfix/ssl/smtpd.crt','r'):
Oct 2 15:31:41 130 postfix/smtpd[21375]: warning: TLS library problem: 21375:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:261:
Oct 2 15:31:41 130 postfix/smtpd[21375]: warning: TLS library problem: 21375:error:140DC002:SSL routines:SSL_CTX_use_certificate_chain_file:system lib:ssl_rsa.c:758:
Oct 2 15:31:41 130 postfix/smtpd[21375]: cannot load RSA certificate and key data
Oct 2 15:31:41 130 postfix/smtpd[21375]: connect from localhost.localdomain[127.0.0.1]
Oct 2 15:31:41 130 postfix/smtpd[21375]: 599A0199802A: client=localhost.localdomain[127.0.0.1], sasl_sender=apache@130.84.32.216.reverse.layeredte ch.com
Oct 2 15:31:41 130 postfix/cleanup[21378]: 599A0199802A: message-id=<200610022039.4b74b5500949@www.3scrapateers.com>
Oct 2 15:31:41 130 sendmail[21372]: k92KVeT6021372: to=pabloyerica@comcast.net, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=31433, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 599A0199802A)
Oct 2 15:31:41 130 postfix/qmgr[16655]: 599A0199802A: from=<apache@130.84.32.216.reverse.layeredtech.com>, size=1848, nrcpt=1 (queue active)
Oct 2 15:31:41 130 postfix/smtpd[21375]: disconnect from localhost.localdomain[127.0.0.1]
Oct 2 15:31:42 130 sendmail[21383]: k92KVfJ2021383: from=apache, size=906, class=0, nrcpts=1, msgid=<200610022039.35ba0c303790@www.3scrapateers.com>, relay=apache@localhost
Oct 2 15:31:42 130 postfix/smtp[21381]: 599A0199802A: to=<pabloyerica@comcast.net>, relay=gateway-s.comcast.net[63.240.76.26], delay=1, status=bounced (host gateway-s.comcast.net[63.240.76.26] said: 550 [PERMFAIL] comcast.net requires valid sender domain (in reply to RCPT TO command))
Oct 2 15:31:42 130 postfix/cleanup[21378]: 321D7199802C: message-id=<20061002203142.321D7199802C@localhost.localdomain>
Oct 2 15:31:42 130 postfix/smtpd[21375]: connect from localhost.localdomain[127.0.0.1]
Oct 2 15:31:42 130 postfix/smtpd[21375]: 46D4D199802D: client=localhost.localdomain[127.0.0.1], sasl_sender=apache@130.84.32.216.reverse.layeredte ch.com
Oct 2 15:31:42 130 postfix/cleanup[21387]: 46D4D199802D: message-id=<200610022039.35ba0c303790@www.3scrapateers.com>
Oct 2 15:31:42 130 postfix/qmgr[16655]: 46D4D199802D: from=<apache@130.84.32.216.reverse.layeredtech.com>, size=1308, nrcpt=1 (queue active)
Oct 2 15:31:42 130 sendmail[21383]: k92KVfJ2021383: to=rinakroes@3scrapateers.com, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30906, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 46D4D199802D)
Oct 2 15:31:42 130 postfix/qmgr[16655]: 599A0199802A: removed
Oct 2 15:31:42 130 postfix/qmgr[16655]: 321D7199802C: from=<>, size=3911, nrcpt=1 (queue active)
Oct 2 15:31:42 130 postfix/smtp[21381]: 46D4D199802D: to=<rinakroes@3scrapateers.com>, relay=MAIL.3scrapateers.com[72.36.202.90], delay=0, status=sent (250 Queued (0.000 seconds))
Oct 2 15:31:42 130 postfix/qmgr[16655]: 46D4D199802D: removed
Oct 2 15:31:43 130 postfix/local[21388]: 321D7199802C: to=<root@localhost.localdomain>, orig_to=<apache@130.84.32.216.reverse.layeredtech.com>, relay=local, delay=1, status=sent (delivered to maildir)
Oct 2 15:31:43 130 postfix/qmgr[16655]: 321D7199802C: removed
Oct 2 15:31:43 130 postfix/smtpd[21375]: disconnect from localhost.localdomain[127.0.0.1]

gilas
3rd October 2006, 11:36
I checked my configuration and discovered that my colleague created a site using a second-leval domain so that nothing worked correctly.

Thank you very much for all

falko
3rd October 2006, 19:32
Oct 2 15:31:42 130 postfix/smtp[21381]: 599A0199802A: to=<pabloyerica@comcast.net>, relay=gateway-s.comcast.net[63.240.76.26], delay=1, status=bounced (host gateway-s.comcast.net[63.240.76.26] said: 550 [PERMFAIL] comcast.net requires valid sender domain (in reply to RCPT TO command))

You're sending from localhost or localhost.localdomain, but you need a real domain, otherwise lots of other servers will refuse to accept emails from you.

wesleyjones
3rd October 2006, 19:39
Our domain is 3scrapateers.com. Where do I change the settings?

falko
4th October 2006, 18:41
You can specify the sender address in additional headers that you pass to PHP's mail() function. Have a look here: http://de.php.net/manual/en/function.mail.php