Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I configured sendmail to send mail with a Gmail smtp relay, following the instructions in this article.

But when I try to send mail, it gets rejected. The error message is:

The original message was received at Wed, 22 Aug 2012 13:24:35 +0800 from root@localhost
----- The following addresses had permanent fatal errors -----
 user@example.com
     (reason: 553 5.1.8 <user@example.com>... Domain of sender address root@[mymachinename] does not exist)
     (expanded from: user@example.com)

----- Transcript of session follows -----
 ... while talking to [127.0.0.1]:
  >>> DATA
  <<< 553 5.1.8 <user@example.com>... Domain of sender address root@[mymachinename] does not exist
  550 5.1.1 user@example.com... User unknown
 <<< 503 5.0.0 Need RCPT (recipient)

I think it is related to DNS, but I don't know what to do with it.

share|improve this question
    
Just FYI, your machine name is not particularly identifying information, especially without a domain attached to it. –  HopelessN00b Aug 22 '12 at 5:38
    
Is there any specific reason that obliges you to send mail via Gmail and not directly? You can send mail directly (provided you configure sendmail properly) and receive mail at Google Apps for your users. –  adamo Aug 22 '12 at 10:08

1 Answer 1

OK, I see what's going on.

You're way off track.

  1. Don't run as root.
  2. It looks like your sendmail config is set to authenticate against the Gmail relay as root@[yourmachinename]. This is not going to work.
  3. You're actually trying to send to user@example.com - don't do that. This is an example that you're supposed to replace with the address you actually want to send an email to.
  4. See the part of the log that says while talking to [127.0.0.1]? This is the loopback address, meaning sendmail is talking to your machine, and your machine is reporting its DNS name as gckj001, which it's not. Well, not if you want to be able to send mail, at least.

So actually, this is kind of a DNS error, in that your machine is not a domain, and you're trying to treat it as one. You need to go back to the section titled Configure sendmail in the article you linked and actually configure it... well, properly.

As to how to do that, you really need to do more reading, probably on the basic concepts behind SMTP and mail relays (maybe DNS too, while you're at it). I honestly wouldn't know where to begin.

share|improve this answer
    
OK,I re-read the section in that article, which has nothing to do with dns. My problem is :since I have configure the gmail relay server, sendmail shoud directly send mail to the server ,and the server handles the remaining work. Isn it? why it get localhost involved to send the mail? –  larmbr Aug 22 '12 at 5:42
    
@larmbr localhost is your machine. And no, you haven't configured send mail to send the Gmail relay. You haven't even configured it to send mail anywhere beyond itself. ...like I said, you really need to work on understanding the underlying concepts here before you're ever going to get this figured out. This is a site for professional SAs, so basic education on these fundamental concepts is not really in scope here. –  HopelessN00b Aug 22 '12 at 5:47
    
I made it work. I just modified the item in hosts ** 127.0.0.1 mymachine. mymachine** to **127.0.0.1 mymachine.local mymachine ** . What make the difference by this notation? –  larmbr Aug 22 '12 at 7:25
    
mymachine.local would be a valid FQDN, (I guess) and mymachine. isn't. –  HopelessN00b Aug 22 '12 at 7:31
    
thanks. I checked the log. I think sendmail on my machine acts as the first mta, which relays my mail to smtp.gmail.com, the second mta, and it do all the dirty work. –  larmbr Aug 22 '12 at 7:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.