Forum Moderators: phranque

Message Too Old, No Replies

sendmail and relaying

messages not from localhost getting queued

         

ppg

9:28 pm on Jul 31, 2002 (gmt 0)

10+ Year Member



I have a problem with sendmail queueing and not sending emails, which are generated by a server-side script with parameters from a form.

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

amoore

10:37 pm on Jul 31, 2002 (gmt 0)

10+ Year Member



There are a lot of things that could be wrong, but I'm not too sure that it's about relaying. Is this sendmail running on the same machine as the webserver? If so, I would nearly rule out a relaying problem. After all, you have it set to allow relaying from localhost and you can send mail through it when it's not a CGI script.

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

ppg

10:31 am on Aug 1, 2002 (gmt 0)

10+ Year Member



Thanks 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.