Forum Moderators: phranque
I'm wondering if its because sendmail is only allowing relaying for messages from localhost - this is from the /etc/mail/access file:
localhost RELAY
theres a couple of other entries, both variations of localhost, nothing else.
The thing is, if the problem was relaying not being allowed for external from addresses, I'd expect to get a 'relaying not allowed' message, but the messages just sit in the queue.
sending messages from the command line when logged in as root works, I assume this is because the message comes from localhost and relaying is therefore permitted.
I'm a bit worried about opening up sendmail to allow relaying from anywhere, although the server is behind a firewall and only requests to port 80 are allowed through.
Does this sound like a relaying problem even though theres no error message in the maillog?
Perhaps my maillog isn't set up to log error messages by default, I'm not sure.
As you've probably gathered you can write what I know about sendmail on the back of a stamp, so any ideas for fixes would be much appreciated.
thanks
Just out of curiousity is sendmail running? you can probably run something like '/etc/init.d/sendmail status' to see if it's running, or cat the file '/var/run/sendmail.pid' and the second line should be how sendmail is running. It's probably something like '/usr/sbin/sendmail -bd -q1h' which means run as a daemon and send any queued messages after 1 hour. (that's messages that were queued because they couldn't be sent right away, kinda rare, actually). I guess this is probably not the problem if you can send mail from the command line, but it never hurts to check.
If you're sending mail from a CGI script, you may be able to check any error message or success message that you get back. I'm not sure if you're calling sendmail directly or using a perl module or something to do it, but seeking more information from that may be useful.
Also, check out /var/log/maillog and see if there are any telltale messages in there.
Hope it helps.
-Andy
Sorry, I realised today I missed out an important piece of information in my first post - the webserver in question is in a different physical location and on a different network than the domain that the site feedback emails need to go to, therefore I need to relay them, they're not going to the local domain.
Sendmail is definitely running, the maillog just tells me that the messages are being queued, and that sendmail is attempting to use localhost.localdomain as the relay to send them on(its a redhat linux 7.2 machine).
The emails are generated and sent by a jsp via the JavaMail package. The annoying thing is, I've set this up before in exactly the same way (same version of linux, not 100% sure its the same version of sendmail) and last time it worked straight out of the box. The only difference was that the webserver was on the same network as the mailserver it was sending the emails to. As far as the jsp page is concerned, the emails are generated and sent off to sendmail with no problems.