[CentOS] sendmail & mail() in php

Alexander Dalloz ad+lists at uni-x.org
Wed Nov 9 17:22:26 UTC 2005


Am Mi, den 09.11.2005 schrieb hiep at ee.ucr.edu um 14:32:

> I tried to configure sendmail so that I can use mail() in php.  I don't
> host my email server, my ISP does.  I just want to configure sendmail so
> that it uses external email server (my ISP) to send mail.  When I executed
> mail(), i got no error report from php.  I checked /var/log/maillog and it
> indicated that the message was accepted for delivery.  However, it didn't
> delivery and indicated DSN: Service unavailable.

> Nov  8 14:09:03 jadenet sendmail[3278]: jA8J92aP003276:
> to=<hnguyen at jadesterling.com>, ctladdr=<apache at jadenet.jadesterling.com>
> (48/48), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120361,
> relay=mail.jadesterling.com. [216.144.3.38], dsn=5.0.0, stat=Service
> unavailable

That is a permantent failure DSN code. At this moment, testing the host
"mail.jadesterling.com", trying to send a mail with "MAIL
FROM:<apache at jadesterling.com>" and "RCPT TO:<hnguyen at jadesterling.com>"
was accepted (I did QUIT and did not really send a mail message). The
answer from the recipient host "Service unavailable" indicates that at
time you tried to relay through that smart host it did not act properly.
You said that is the MTA of your ISP (looks like a Windows® software) -
you should ask them about availability of that host. Before please read
through my comments on your sendmail.mc and change some settings. A
restart of the sendmail service is needed to make the changes active.

-- sendmail.mc --

> define(`SMART_HOST',`mail.jadesterling.com')dnl
[...]
> dnl # The following example makes mail from this host and any additional
> dnl # specified domains appear to be sent from mydomain.com
> dnl #
> MASQUERADE_AS(`jadesterling.com')dnl
> dnl #
> dnl # masquerade not just the headers, but the envelope as well
> dnl #
> dnl FEATURE(masquerade_envelope)dnl

It is advised to masquerade the envelope. So activate that feature.

> dnl #
> dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as
> well
> dnl #
> dnl FEATURE(masquerade_entire_domain)dnl

I suggest you activate that masquerading feature too, as your mail comes
from "jadenet.jadesterling.com" (I guess your hostname).

> dnl #
> dnl MASQUERADE_DOMAIN(localhost)dnl
> dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
> dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
> dnl MASQUERADE_DOMAIN(mydomain.lan)dnl

You need to fill class {M} - so set as much MASQUERADE_DOMAIN as you
need.

> FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl
> GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl

You have set content inside the genericstable and the flat
generics-domains file?

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu 0xB366A773
legal statement: http://www.uni-x.org/legal.html
Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.11-1.35_FC2smp 
Serendipity 18:10:26 up 11 days, 16:10, load average: 0.30, 0.22, 0.13 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.centos.org/pipermail/centos/attachments/20051109/46f07619/attachment.bin


More information about the CentOS mailing list