Board logo

relaying of apache@localhost
linboogy - 12-3-2005 at 04:32 PM

Hello, I have a php script that will e-mail a user of notifications and it gets stuck in the server because it relays its self as apache@localhost and the tail -f -n100 /var/log/maillog shows that user unknown and kicks it back to the post master account. Any light that could be shed on this issue would be greatful. Thanks


brian - 12-3-2005 at 07:37 PM

That should have been fixed. I had written a patch to make sure apache got written in.

Do this:

# Fix Sendmail not having "apache" in the virtual user table
cd /etc/mail
/bin/cat virtusertable | grep "apache@" > /dev/null
if [ $? != 0 ]; then
/usr/bin/printf "apache@`hostname`tadmin" >> /etc/mail/virtusertable
/usr/sbin/makemap hash /etc/mail/virtusertable < virtusertable
fi

That has been tested, and that is what I had to do to make apache work for sending mail.

Other then that, not sure what to tell you!


linboogy - 12-3-2005 at 10:46 PM

Here is my mail log
Dec 3 17:45:50 www sendmail[2765]: jB3Mjo6Y002765: from=apache, size=327, class=0, nrcpts=1, msgid=<200512032245.jB3Mjo6Y002765@www.linboogy.com>, relay=apache@localhost
Dec 3 17:45:50 www sendmail[2765]: jB3Mjo6Y002765: to=ek@linboogy.com, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30327, relay=[127.0.0.1] [127.0.0.1], dsn=5.6.0, stat=Data format error
Dec 3 17:45:50 www sendmail[2765]: jB3Mjo6Y002765: jB3Mjo6Z002765: DSN: Data format error
Dec 3 17:45:50 www sendmail[2768]: jB3MjoE9002768: <apache@www.linboogy.com>... No such user here
Dec 3 17:45:50 www sendmail[2765]: jB3Mjo6Z002765: to=apache, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31351, relay=[127.0.0.1], dsn=5.3.0, stat=User unknown
Dec 3 17:45:50 www sendmail[2768]: jB3MjoE9002768: from=<>, size=1351, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Dec 3 17:45:50 www sendmail[2765]: jB3Mjo6Z002765: jB3Mjo6a002765: return to sender: User unknown
Dec 3 17:45:50 www sendmail[2768]: jB3MjoEB002768: from=<>, size=3900, class=0, nrcpts=1, msgid=<200512032245.jB3Mjo6a002765@www.linboogy.com>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Dec 3 17:45:50 www sendmail[2765]: jB3Mjo6a002765: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32375, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (jB3MjoEB002768 Message accepted for delivery)
Dec 3 17:45:50 www MailScanner[2379]: New Batch: Scanning 1 messages, 4337 bytes
Dec 3 17:45:57 www MailScanner[2379]: Virus and Content Scanning: Starting
Dec 3 17:45:58 www MailScanner[2379]: Uninfected: Delivered 1 messages
Dec 3 17:45:58 www sendmail[2783]: jB3MjoEB002768: SYSERR(root): header syntax error, line "MailScanner-Information: Please contact the postmaster for more information"
Dec 3 17:45:58 www sendmail[2783]: jB3MjoEB002768: SYSERR(root): header syntax error, line "MailScanner-From: "
Dec 3 17:45:58 www spamd[2758]: spamd: got connection over /home/av-spam/tmp/spamd.sock
Dec 3 17:45:58 www spamd[2758]: spamd: setuid to admin succeeded
Dec 3 17:45:58 www spamd[2758]: spamd: processing message <200512032245.jB3Mjo6a002765@www.linboogy.com> for admin:500
Dec 3 17:46:05 www spamd[2758]: spamd: clean message (-1.1/7.9) for admin:500 in 7.0 seconds, 4406 bytes.
Dec 3 17:46:05 www spamd[2758]: spamd: result: . -1 - ALL_TRUSTED,AWL scantime=7.0,size=4406,user=admin,uid=500,required_score=7.9,rhost=localhost,raddr=127.0.0.1,rport=/home/av-spam/tmp/spamd.sock,mid=<200512032245.j B3Mjo6a002765@www.linboogy.com>,autolearn=ham
Dec 3 17:46:05 www sendmail[2783]: jB3MjoEB002768: to=admin, delay=00:00:15, xdelay=00:00:07, mailer=local, pri=123900, dsn=2.0.0, stat=Sent
Dec 3 17:46:05 www spamd[2752]: prefork: child states: II


linboogy - 12-4-2005 at 03:27 PM

This cured the problem
I added apache@localhost to
/etc/mail/access


Thanks for your help


brian - 12-4-2005 at 07:58 PM

Thanks for the info, I will add that to my 2.6 CD ISO Image.


MasterK - 12-9-2005 at 08:14 PM

I had a cname in the dns causing problems.


brian - 12-14-2005 at 04:01 AM

Just another fix I had seen on the BQ Mailing list


echo "/usr/sbin/sendmail -t -i -f admin" >> /etc/php.d/sendmail.ini
/etc/rc.d/init.d/httpd restart


amaru - 4-26-2006 at 02:41 PM

I had to add the following to /etc/virtusertable :
apache@my.domain.name apache


sussexbob - 9-15-2006 at 08:25 AM

I had a problem when I installed Joomla (installed on the servers own domain) as it wanted to send out as apache@www.mydomain.tld. I tried all of the above with no luck.

Then I noticed in /etc/mail/virtusertable that vsites got installed with apache@www.myvsite.tld where the server domain didnt have this entry, so added apache@www.serverdomain.tld, but that didn't work either.

So I went and had a look at my trusty old 550 that runs Joomla and other scripts ok and noticed in /etc/mail/access that there were entries for relay by the first three octets of the server ip and the server domain.
such as:
# Cobalt Access Section Begin
nnn.nnn.nnn RELAY
myserverdomain.tld RELAY
# Cobalt Access Section End

I popped these in and all is now working. What do you think Brian?