Re: Bloody sendmail
by pfaut (Priest) on Dec 31, 2002 at 15:40 UTC
|
If perl indicates that everything went well, I would next look at your sendmail logs. They should be in /var/log/mail or /var/log/messages.
---
print map { my ($m)=1<<hex($_)&11?' ':'';
$m.=substr('AHJPacehklnorstu',hex($_),1) }
split //,'2fde0abe76c36c914586c';
| [reply] [d/l] |
|
|
you're faster than me. I just thought of that and dug out the mail logs. I am getting an error there a connection refused by localhost.(my dns) I think that means I have to go in and add that to my sendmail relaying list . . if that doesn't work I'm still lost.
| [reply] |
Re: (nrd) Bloody sendmail
by newrisedesigns (Curate) on Dec 31, 2002 at 15:45 UTC
|
This may not help, but it's from experience...
How long did you wait to check your mail? It may not have gone through. I ended up getting fifteen "test" emails because my company's ISP was lagging that day. :(
Do as pfaut says, check the sendmail logs first, then ask your ISP if they're having problems.
John J Reiser
newrisedesigns.com
| [reply] |
|
|
I've given them days so it's not that. this is the error in mail log.
Dec 31 10:46:35 finn sendmail12925: gBVFkYsF012925: to=<anders@localhost>,<afinn@purdue.edu>, ctladdr=anders@finn.ws (500/100), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=60558, relay=localhost.nycap.rr.com. 127.0.0.1, dsn=4.0.0
, stat=Deferred: Connection refused by localhost.nycap.rr.com.
any ideas?
| [reply] |
|
|
Your local sendmail probably thinks that 'localhost.nycap.rr.com' is not local, and is denying a relay.
Make sure your /etc/hosts file has both 'localhost' and 'localhost.nycap.rr.com' entries, both defined as '127.0.0.1'.
Doug
| [reply] |
|
|
'Connection refused' is a TCP/IP error, not a sendmail error. It means you are attempting to connect to a port where there is no server running. Make sure that there is actually a sendmail daemon running on whatever localhost.nycap.rr.com translates to (probably the machine you are running your script on) and that it is running in server mode.
If this were a relaying problem, he'd be getting something like 'relay denied', not 'connection refused'. He hasn't even established a connection to sendmail. Relaying has not yet come into play here.
How are you sending the mail? Are you piping to sendmail or mail? Are you using modules? Your original note was light on details.
---
print map { my ($m)=1<<hex($_)&11?' ':'';
$m.=substr('AHJPacehklnorstu',hex($_),1) }
split //,'2fde0abe76c36c914586c';
| [reply] [d/l] |
|
|
|
|
Edit the file /etc/mail/access and add
localhost.nycap.rr.com RELAY
Restart sendmail - it should now allow relaying from this host.
Michael
| [reply] [d/l] |
Re: Bloody sendmail
by tachyon (Chancellor) on Jan 01, 2003 at 04:57 UTC
|
It would really help if you posted code. When you say you have a linux server set up does this mean you have full shell access to a real server, a virtual server or what?
I am a bit concerned about your understanding of how mail works. IMAP stands for Internet Message Access Protocol. It is a method of *accessing* electronic mail or bulletin board messages that are kept on a mail server. It is an *access protocol* and has nothing to do with sending mail from your server. So to is POP3 an access protocol.
Sendmail is a MTA (Mail Transfer Agent) that can send mail to a mail server where client software can pick it up via POP3 or IMAP or blah. Mail is sent by SMTP (Simple Message Transport Protocol) on port 25. POP3 and IMAP are simply methods of accessing mail sent by SMTP - OK?
In the old days you could send mail to a server running an MTA and that server would typically RELAY it for you to its destination. With the advent of SPAM most servers now refuse to RELAY by default. This typically means they will not send mail that does not come from the local network (or even send any mail at all). You typically need to enable relaying. The /etc/hosts file and DNS works hand in hand with MTA's. Your MTA consult's these to determine what is and is not local, who can relay etc. These need to be right or your MTA will have issues.
I would try some basic debugging. You should be able to telnet into the MTA on port 25:
[root@www root]# telnet localhost 25
# you should see a response like
Trying 209.x.x.x...
Connected to localhost.
Escape character is '^]'.
220 www.foo.bar.com ESMTP Sendmail 8.11.6/8.11.6; Tue, 31 Dec 2002 22:
+43:55 -0600
# type this
helo localhost
250 www.foo.bar.com Hello www.foo.bar.com[209.x.x.x], pleased to meet
+you
# type quit to logout
quit
221 2.0.0 www.foo.bar.com closing connection
Connection closed by foreign host.
[root@www root]#
This proves one way or another if you have a functioning mailserver running. If you do you should then be able to send a sendmail message on the command line. Type this:
$ sendmail -t
To: me@mysite.com
Subject: Sendmail
That worked
.
$
That should send an email to me@mysite. You end the message with a . on a line by itself. If a . does not work to terminate the message then you have the QMAIL SENDMAIL WRAPPER and will need to use Ctl+D
If this works then you are probably down to a permissions problem or a syntax issue with your script so post the code.
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
| [reply] [d/l] [select] |
|
|
Ok, the basics. I have a linux box server in my basement. Unfortuantly, since yesterday, I have moved 800 miles away. Yet, I have full shell access and can do just about anything that could be done on the prompt of the server. (ie. I am the system admin) Running RHLinux Psyche. The server is running Sendmail 10. I'm familar with the protocol and what it all means along with the basics of how MTA works. My problem is this, I can't figure out why, it's trying to send things from localhost.nycap.rr.com. It shouldn't even KNOW that dns as far as I know. The server should think it's domain is finn.ws and that nycap.rr.com is just a hop. Unless of course it's going out and trying to determine it's dns from the routers. . . I can't "allow" localhost.nycap.rr.com because that just simply doesn't exist (nycap.rr.com is the New York Capital Area Roadrunner domain) localhost would just not fit there. At this point what I really think my problem may be is that it's trying to send from that dns instead of my domain. . I have no idea why it would do this nor why other trials with languages like PHP would do the same. .
Furthermore. the mail server is functional. I DO send mail from inside my domain and outside with this server using client side applications like IE and Netscape on machines from on internal networks to Chili. . .
I hope that clears up any ambiguity with my previous messages. I didn't add any code here as I've gotten the same results with PHP, Perl and am not getting any errors on that side. The only place I find errors is in my maillog files. (I don't even have any mail sitting in que). The maillog errors are c/p'd above.
Thanks for all your advice so far. I have found things that were wrong from your advice unforunatly they had nothing to do with this problem.
I'm frightened by what I see, but somehow I know that there is much more to come.
| [reply] |
|
|
Hi, I asked you to do a couple of simple diagnostic things and report the results. From what you have said in this post it appears you have not done them. Here it is in a nutshell. Your configuration is broken - it does not work. You don't know why. I have suggested you do some things which you appear not to have done. It therefore appears to me that I am wasting my time.
I would suggest the easiest way for you to learn what you need and get your system working will be to install qmail (2nd most popular MTA after sendmail and much more secure and easy to configure). Life With Qmail will show you how.
Your name resolution is almost certainly screwed. Name resolution comes from either /etc/hosts or DNS. The order is set in /etc/nsswitch.conf . You can test the results with nslookup or dig. This is a very good tutorial on BIND and DNS applicable to Redhat
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
| [reply] |
|
|
|
|
Hi, I didn't need the diagonistics you suggested as I have all the answers I need. If you read my complete message you would be able to see that the config file is not broken as I am able to use the sendmail MTA quite completely. I could probably make it work by opening up to the whole nycap.rr.com domain, however, I don't wish to open up a hole like that.
Furthermore, I know all about qmail and have decided it's not what I want. I have three years of sendmail under my belt and no wish to convert now to a product I do not think is sendmail's equal. Also, why would I take down a system that is running perfectly in all but ONE case and replace it with an untested one? I shall have to check with nsswitch as my etc/hosts is also correct.
Finally, I would be nice if you didn't portray an image of superiority to people who post. It comes off as being arrogant and ignorant of what other people are doing. I do take what you have to say to heart and have checked those things but have done so in the past. If the whole thread was read, your questions would have been answered before you asked them.
I'm frightened by what I see, but somehow I know that there is much more to come.
| [reply] |
Re: Bloody sendmail
by hawtin (Prior) on Jan 01, 2003 at 09:26 UTC
|
I used to have a Perl script that prepared a sendmail
configuration from a raw description of the users, domains
and relay rules. Since this (or rather last year) year
represents the 10th aniversary of hitting sendmail in a
effort to keep it working for me I decided to switch to
exim. So far it is working well, and you
can write rewrite rules in Perl.
It sure is easier than sendmail
| [reply] |