LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-12-2011, 10:01 AM   #1
DarkAge
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Rep: Reputation: 0
Sendmail with apache user does not work


I'm going crazy troubleshooting a weird issue.

I'm running a LAMP installation using CentOS. My domain has a MX record pointing to another mail server which i rent from my ISP.

All mails sent via sendmail from my domain to external accounts works fine. Receiving mails on email@mydomain.com from external accounts works fine.

Sending email to email@mydomain.com from mydomain.com does ONLY work for root user not for apache user.

Here is how i've tested:

ROOT User
command '/usr/sbin/sendmail -v email@mydomain.com < message.txt'
produces
Code:
email@mydomain.com... Connecting to [127.0.0.1] via relay...
220 mydomain.com ESMTP Sendmail 8.13.1/8.13.1; Mon, 12 Sep 2011 15:51:18 +0200
>>> EHLO localhost.localdomain
250-mydomain.com Hello ipXXX-XXX-132-248 [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@localhost.localdomain> SIZE=607 AUTH=root@localhost.localdomain
250 2.1.0 <root@localhost.localdomain>... Sender ok
>>> RCPT To:<email@mydomain.com>
>>> DATA
250 2.1.5 <email@mydomain.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 p8CDpI2h023664 Message accepted for delivery
email@mydomain.com... Sent (p8CDpI2h023664 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 mydomain.com closing connection
/var/log/maillog
Code:
Sep 12 15:58:36 ipXXX-XXX-132-248 sendmail[23786]: p8CDwamh023786: from=root, size=607, class=0, nrcpts=1, msgid=<201109121358.p8CDwamh023786@localhost.localdomain>, relay=root@localhost
Sep 12 15:58:36 ipXXX-XXX-132-248 sendmail[23787]: p8CDwaUb023787: from=<root@localhost.localdomain>, size=913, class=0, nrcpts=1, msgid=<201109121358.p8CDwamh023786@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=ipXXX-XXX-132-248 [127.0.0.1]
Sep 12 15:58:36 ipXXX-XXX-132-248 sendmail[23786]: p8CDwamh023786: to=email@mydomain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30607, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p8CDwaUb023787 Message accepted for delivery)
Sep 12 15:58:36 ipXXX-XXX-132-248 sendmail[23789]: p8CDwaUb023787: to=<email@mydomain.com>, delay=00:00:00, xdelay=00:00:00, mailer=smtp, pri=120913, relay=smtp.myisp.com. [217.116.215.3], dsn=2.0.0, stat=Sent (Ok: queued as ED95BB8B6D)
APACHE User
command '/usr/sbin/sendmail -v email@mydomain.com < message.txt'
produces
Code:
email@mydomain.com... Connecting to [127.0.0.1] via relay...
220 mydomain.com ESMTP Sendmail 8.13.1/8.13.1; Mon, 12 Sep 2011 15:53:17 +0200
>>> EHLO localhost.localdomain
250-mydomain.com Hello ipXXX-XXX-132-248 [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<apache@localhost.localdomain> SIZE=607 AUTH=apache@localhost.localdomain
250 2.1.0 <apache@localhost.localdomain>... Sender ok
>>> RCPT To:<email@mydomain.com>
>>> DATA
250 2.1.5 <email@mydomain.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 p8CDrH46023701 Message accepted for delivery
email@mydomain.com... Sent (p8CDrH46023701 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 mydomain.com closing connection
/var/log/maillog
Code:
Sep 12 15:56:23 ipXXX-XXX-132-248 sendmail[23741]: p8CDuNas023741: from=apache, size=607, class=0, nrcpts=1, msgid=<201109121356.p8CDuNas023741@localhost.localdomain>, relay=apache@localhost
Sep 12 15:56:23 ipXXX-XXX-132-248 sendmail[23742]: p8CDuNoA023742: from=<apache@localhost.localdomain>, size=919, class=0, nrcpts=1, msgid=<201109121356.p8CDuNas023741@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=ipXXX-XXX-132-248 [127.0.0.1]
Sep 12 15:56:23 ipXXX-XXX-132-248 sendmail[23741]: p8CDuNas023741: to=email@mydomain.com, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30607, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p8CDuNoA023742 Message accepted for delivery)
Sep 12 15:56:23 ipXXX-XXX-132-248 sendmail[23744]: p8CDuNoA023742: to=<email@mydomain.com>, delay=00:00:00, xdelay=00:00:00, mailer=smtp, pri=120919, relay=smtp.myisp.com. [217.116.215.3], dsn=2.0.0, stat=Sent (Ok: queued as 0EB03B81FE)
No errors in /var/log/messages and in both cases the message is queued and accepted for delivery according to the maillog.

The email sent when run by root is present in my inbox, the one sent from apache is not. If i send from apache user to an external account (say hotmail.com) it works fine.

Any ideas ?

Thanks in advance.

Last edited by DarkAge; 09-12-2011 at 10:02 AM.
 
Old 09-12-2011, 04:47 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

It could be a spam filter that does not like apache in the sender address, so it ends in the spam folder or gets deleted.
Check the logs in the receiving end if you can, or ask your ISP to do so, to see what happens to that email.

Regards
 
Old 09-13-2011, 08:58 AM   #3
DarkAge
LQ Newbie
 
Registered: Sep 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Hi,

It could be a spam filter that does not like apache in the sender address, so it ends in the spam folder or gets deleted.
Check the logs in the receiving end if you can, or ask your ISP to do so, to see what happens to that email.

Regards
I'll check with the ISP and report back.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache-the-program can't see directiories apache-the-user can see Dims Linux - Newbie 9 04-27-2009 12:24 PM
Running jsps in user home directory doesn't work (Apache Tomcat and mod_userdir) jimieee Linux - Networking 0 03-23-2005 10:12 AM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 05:30 AM
got ALSA to work in root, need help getting it to work in my user profile ic3 Slackware 2 11-28-2003 10:32 PM
Help with getting apache to work in User. BmxFace Linux - Software 4 11-14-2003 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration