4

UPDATE 10/21/2010 5p: Ok, so sending mail does work, but not sending mail to tom@wtw3.com from this box does not. The A record for wtw3.com points to the development box, but the MX records resolve to Google's servers. Is this causing the issue? How do I tell? (Verbose mail output below)

[root@dev ~]# mail -v tom@wtw3.com
Subject: Test
Test
Cc: 
tom@wtw3.com... Connecting to [127.0.0.1] via relay...
220 dev.tridiumtech.com ESMTP Sendmail 8.13.8/8.13.8; Thu, 21 Oct 2010 17:02:05 -0400
>>> EHLO dev.tridiumtech.com
250-dev.tridiumtech.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@dev.tridiumtech.com> SIZE=37
250 2.1.0 <root@dev.tridiumtech.com>... Sender ok
>>> RCPT To:<tom@dev.tridiumtech.com>
>>> DATA
550 5.1.1 <tom@dev.tridiumtech.com>... User unknown
503 5.0.0 Need RCPT (recipient)
>>> RSET
250 2.0.0 Reset state
>>> RSET
250 2.0.0 Reset state
root... Using cached ESMTP connection to [127.0.0.1] via relay...
>>> MAIL From:<> SIZE=1061
250 2.1.0 <>... Sender ok
>>> RCPT To:<root@dev.tridiumtech.com>
>>> DATA
250 2.1.5 <root@dev.tridiumtech.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o9LL25mA024437 Message accepted for delivery
root... Sent (o9LL25mA024437 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 dev.tridiumtech.com closing connection

ORIGINAL QUESTION:

I am having problems when sending mail OUT from my development server.

Unless I send mail TO a user that begins with a username that exists on my box, the mail will reject and say "User unknown".

For instance, I have a user on my dev box called "twilson". Therefore, I can send email to any address that begins with "twilson", such as twilson@blahblah.com, and it will send without any issue.

But, I do not have a user "tom" on my box, so when I go to send email to tom@blahblah.com it will reject saying:

Oct 21 10:07:49 dev sendmail[19638]: o9LE7mcV019638: < tom@localhost >... User unknown

It actually takes whatever the username of the emailing address I am sending TO is and places it on the local hostname.

Why is it doing this??? How can I correct the configuration so that I can send OUT to ANYONE?

Thanks, Tom

Additional Info:

ADDRESS TEST RESULT:

> > 3,0 fred@teaparty.net
canonify           input: fred @ teaparty . net
Canonify2          input: fred < @ teaparty . net >
Canonify2        returns: fred < @ teaparty . net . >
canonify         returns: fred < @ teaparty . net . >
parse              input: fred < @ teaparty . net . >
Parse0             input: fred < @ teaparty . net . >
Parse0           returns: fred < @ teaparty . net . >
ParseLocal         input: fred < @ teaparty . net . >
ParseLocal       returns: fred < @ teaparty . net . >
Parse1             input: fred < @ teaparty . net . >
Mailertable        input: < teaparty . net > fred < @ teaparty . net . >
Mailertable        input: teaparty . < net > fred < @ teaparty . net . >
Mailertable      returns: fred < @ teaparty . net . >
Mailertable      returns: fred < @ teaparty . net . >
MailerToTriple     input: < > fred < @ teaparty . net . >
MailerToTriple   returns: fred < @ teaparty . net . >
Parse1           returns: $# esmtp $@ teaparty . net . $: fred < @ teaparty . net . >
parse            returns: $# esmtp $@ teaparty . net . $: fred < @ teaparty . net . >

DNS TEST:

;; ANSWER SECTION:
teaparty.net.           3600    IN      MX      5 www.teaparty.net.
TomWilsonFL
  • 185
  • 1
  • 2
  • 8
  • 2
    Sendmail definitely shouldn't do that. What OS/distro are you using? Can you let us have the m4 from which the sendmail config was generated? – MadHatter Oct 21 '10 at 14:57
  • It would also be helpful to see the output of sendmail in address test mode. Could you bear to run "sendmail -bt -d0,11" , when you get the ">" prompt say "3,0 fred@teaparty.net" and paste the results of the whole thing in here? – MadHatter Oct 21 '10 at 14:59
  • Have you thought about switching to Postfix? – gravyface Oct 21 '10 at 15:01
  • MH: It is CentOS release 5 (Final). I'm not sure what m4 is, sorry. I'm a sendmail rookie. I added the address test results to the question. Thanks. – TomWilsonFL Oct 21 '10 at 15:14
  • gravy: Not planning on switching when I know sendmail should work fine. This box is ancient. Don't need to put more packages on it. – TomWilsonFL Oct 21 '10 at 15:14
  • ok. line feeds would have been helpful, but that last line, "parse returns: $# esmtp $@ teaparty . net . $: fred < @ teaparty . net . >" indicates that sendmail wants to send the mail off your system. it's not trying to deliver it locally, as you'd feared. could you do "dig mx teaparty.net" and post the results of that? – MadHatter Oct 21 '10 at 15:18
  • Sorry, couldn't figure out how to get the line feeds to appear from the copy/paste and I had to run out the door. I added the dig result to the question. Thanks again for the help. – TomWilsonFL Oct 21 '10 at 17:49
  • How exactly are your trying to send email? From the command line, or some programs, etc? – Chris S Oct 21 '10 at 17:54
  • everything looks as if it's set up to send remotely. could you do a "mail -v reaper@teaparty.net" and send a test mail, pasting the complete output (with line feeds, preferably) here? – MadHatter Oct 21 '10 at 18:22
  • Chris S: Initially from PHP using the mail() function. But I also tested using the command line and got the same results. MadH: I will post the output in a second. – TomWilsonFL Oct 21 '10 at 18:55
  • @TomWilsonFL: m4 is used to create the final `sendmail.cf` file. Usually the m4 file is called `sendmail.mc` – knitti Oct 21 '10 at 19:15

2 Answers2

1

If this is a mail from you:

Date: Thu, 21 Oct 2010 14:56:03 -0400
From: root <root@dev.tridiumtech.com>
To: reaper@teaparty.net
Subject: Test

Test

which based on your profile I suspect it is, then whatever the problem on your system, it's not with sendmail. Your sendmail is configured fine as regards outbound email.

That said, clearly something doesn't work, or you wouldn't have posted. Would you care to edit your question, or open a new one, saying what you know (what you're trying to achieve, what you're doing, what's happening), rather than what you think might be the underlying cause?

MadHatter
  • 79,770
  • 20
  • 184
  • 232
  • Edited the question. I hope it makes sense. I'm over obscuring the hostname. If anyone is that desperate to break into my little dev box, let them try. There isn't anything great on it anyway. lol ;) – TomWilsonFL Oct 21 '10 at 21:05
  • 1
    What's in /etc/mail/sendmail.cw and/or /etc/mail/local-host-names ? – MadHatter Oct 21 '10 at 21:16
  • 1
    oh, and unless you're running split-site DNS (which you may be), the MX record for wtw3.com doesn't point to google; there is no MX record. i'd cut and paste some DNS output here, but cut-and-paste is really not well-supported in comments. – MadHatter Oct 21 '10 at 21:18
  • interesting; i got [madhatta@risby financial]$ dig mx wtw3.com ; <<>> DiG 9.6.2-P2-RedHat-9.6.2-5.P2.fc12 <<>> mx wtw3.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26544 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;wtw3.com. IN MX ;; ANSWER SECTION: wtw3.com. 1792 IN CNAME dev.tridiumtech.com. but now get what knitti does. propagation delay? – MadHatter Oct 22 '10 at 06:28
1

(You should post the contents of sendmail.mc if it exists. sendmail.cf is produced by m4 after reading it)

Run sendmail -bt (test mode). While in there, type $=w to inspect the contents of the variable. If the contents of the variable include wtw3.com, this means that your local box considers anything that is sent to anyuser@wtw3.com as mail that should be handled locally and therefore if the user does not exit, it complains. Try removing wtw3.com from /etc/mail/local-host-names if it is there

(BTW from what I understand the machine seems to be configured to believe that for every domain name the Kuser database should be checked for the LHS of the address before attempting to send email)

One quick hack to avoid this is to define the following in your sendmail.mc

define(LUSER_RELAY, `[one of the Google MX]')dnl

Include the [] brackets.

I do not know how you produce a sendmail.cf from a new sendmail.mc for your distribution. In Debian I run sendmailconfig.

A more appropriate configuration for your machine, would be to either use FEATURE(nullclient) or a variation of http://blog.postmaster.gr/2006/09/06/configuring-sendmail-for-your-unix-desktop/

adamo
  • 6,925
  • 3
  • 30
  • 58
  • > $=w dev.tridium-tech.com dev localhost.localdomain localhost [192.168.1.5] dev.tridiumtech.com Is what appears when I do "$=w". There are no entries in the local-host-names file. – TomWilsonFL Oct 21 '10 at 23:35
  • locate sendmail.mc and post its contents – adamo Oct 22 '10 at 05:40