# why is sendmail doing this?

## gzaector

ok i set up sendmai and fetchmail using this 

https://forums.gentoo.org/viewtopic.php?t=23703&postdays=0&postorder=asc&start=0

now whenever i run fetchmail this happens

```

bash-2.05a$ fetchmail

1 message for gzaector at mail.attbi.com (869 octets).

reading message gzaector@mail.attbi.com:1 of 1 (869 octets) fetchmail: SMTP error: 550 5.1.1 <username@localhost>... User unknown

fetchmail: mail from FETCHMAIL-DAEMON@malkovich.attbi.com bounced to gzaector@yahoo.com

 flushed

```

and whoever sent me the email will get this 

```

Date:    Sun, 19 Jan 2003 15:46:53 -0500

From:   FETCHMAIL-DAEMON@attbi.com

To:   gzaector@yahoo.com

   

Some addresses were rejected by the MDA fetchmail forwards to.

Message/delivery-status

Reporting-MTA: dns; localhost

Final-Recipient: rfc822; username@localhost

Last-Attempt-Date: Sun, 19 Jan 2003 15:46:53 -0500 (EST)

Action: failed

Status: 5.1.1

Diagnostic-Code: 550 5.1.1 <username@localhost>... User unknown

Received: from web13004.mail.yahoo.com ([216.136.174.14])

          by rwcrgwc52.attbi.com

          (InterMail vM.4.01.03.37 201-229-121-137-20020806) with SMTP

          id 

<20030119204320.CVKV19728.rwcrgwc52.attbi.com@web13004.mail.yahoo.com>

          for <gzaector@attbi.com>; Sun, 19 Jan 2003 20:43:20 +0000

Message-ID: <20030119204307.793.qmail@web13004.mail.yahoo.com>

Received: from [*.*.*.*] by web13004.mail.yahoo.com via HTTP; 

Sun, 19 Jan 2003 12:43:07 PST

Date: Sun, 19 Jan 2003 12:43:07 -0800 (PST)

From: Gza Ector <gzaector@yahoo.com>

Subject: test

To: gzaector@attbi.com

MIME-Version: 1.0

Content-Type: text/plain; charset=us-ascii

```

what could be causing this?

-gza

<edit>

didnt mean to post the first errorLast edited by gzaector on Sun Jan 19, 2003 9:52 pm; edited 1 time in total

----------

## humillo

 *gzaector wrote:*   

> 
> 
> ```
> 
> bash-2.05a$ fetchmail
> ...

 

Looks like sendmail is not running on localhost, I havent played with sendmail on gentoo but I guess you should be able to start it with:

```
/etc/init.d/sendmail start
```

If that works, you can make it start automatically with:

```
rc-update add sendmail default
```

Good luck!

David

----------

## gzaector

oops, i didnt mean to post that first error in there, after about three times i realized i had to start sendmail, i better get rid of that fisrt error.... thanks

any help on the other ones?

----------

## humillo

My guess is that sendmail doesnt recognize localhost as a local domain, or it could be that username simply doesnt exist.

If username does exist, try adding localhost to /etc/mail/local-host-names and restart sendmail.

You can test email addresses on the server quickly with:

```
sendmail -bv username@localhost
```

Good luck!

----------

## gzaector

added localhost to /etc/mail/local-host-names

stll doesnt work

```

bash-2.05a# sendmail -bv username@localhost

username@localhost... User unknown

```

how can i get it to recognize this user?

----------

## ebrostig

Can you post the contents of your /etc/mail/sendmail.mc

Unless you have edited this file and then run it through the m4 macro processor prior to starting sendmail iy may not work correctly.

Here is the contents of mine:

```

divert(0)dnl

include(`/usr/share/sendmail-cf/m4/cf.m4')dnl

VERSIONID(`$Id: sendmail.mc,v 1.2 2002/07/04 04:55:29 g2boojum Exp $')dnl

OSTYPE(linux)dnl

DOMAIN(generic)dnl

FEATURE(`smrsh',`/usr/sbin/smrsh')dnl

FEATURE(`local_lmtp',`/usr/sbin/mail.local')dnl

FEATURE(accept_unresolvable_domains)dnl

MAILER(local)dnl

MAILER(smtp)dnl

define(`confDEF_USER_ID',``8:12'')dnl

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Cwlocalhost.localdomain

```

Then run the following comamnd after editing this file (that is if you have special ooptions that you need to configure) and run:

```

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

/etc/init.d/sendmail stop

/etc/init.d/sendmail start

```

I would believe this should take care of your problem.

Unless of course, you are trying to senbd mail to a user called 'username' on your local host?

Erik

----------

## gzaector

here is the sendmail.mc file.. i will try converting it, cause i dont think i did

```

bash-2.05a# cat /etc/mail/sendmail.mc 

divert(-1)

#

# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.

#       All rights reserved.

# Copyright (c) 1983 Eric P. Allman.  All rights reserved.

# Copyright (c) 1988, 1993

#       The Regents of the University of California.  All rights reserved.

#

# By using this file, you agree to the terms and conditions set

# forth in the LICENSE file which can be found at the top level of

# the sendmail distribution.

#

#

#

#  This is a generic configuration file for Linux.

#  It has support for local and SMTP mail only.  If you want to

#  customize it, copy it to a name appropriate for your environment

#  and do the modifications there.

#

divert(0)dnl

include(`/usr/share/sendmail-cf/m4/cf.m4')dnl

VERSIONID(`$Id: sendmail.mc,v 1.2 2002/07/04 04:55:29 g2boojum Exp $')dnl

OSTYPE(linux)dnl

DOMAIN(generic)dnl

define(`SMART_HOST',`mail.attbi.com')dnl

MASQUERADE_AS(attbi.com)dnl

FEATURE(`allmasquerade')dnl

FEATURE(`masquerade_envelope')dnl

FEATURE(`smrsh',`/usr/sbin/smrsh')dnl

FEATURE(`local_lmtp',`/usr/sbin/mail.local')dnl

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

MAILER(local)dnl

MAILER(smtp)dnl

Cwlocalhost.localdomain

```

----------

## gzaector

no success  :Sad: 

----------

## ebrostig

Just a quick Q: Are you really trying to send mail to a user called 'username'?

Erik

----------

## gzaector

hehe, no, its going to gzaector

----------

## gzaector

^bump^

----------

## kabutor

Just in case

/etc/resolv.conf 

try with adding

```

hostname whatever

order host, bind    <-

nameserver xxx.xxx..xxx.xxx your dns

```

And check the /etc/hosts 

127.0.0.1       localhost

----------

## rtn

 *gzaector wrote:*   

> added localhost to /etc/mail/local-host-names
> 
> stll doesnt work
> 
> ```
> ...

 

I think they meant you should send mail to gzaector@localhost, not 

username@localhost which doesn't exist...

--rtn

----------

## gzaector

how do i got about doing that? do i set it in a config somewhere?

----------

## pilla

Moving to Network & Security

----------

## Lord Funky Biscuit

If anyone really cares about this any more (probably no one, 'cos its a 6 month old topic, but anyway...) the solution is inside your ~/.fetchmailrc config file, there is a line: 

```
user 'username' there with password 'passwd' is 'username' here options fetchall
```

And in this line, the first instance of username must be replaced with your username 'there', ie on the mail server, and the second instance of username must be replaced with the 'here' username, ie the username on the current computer on which you are to receive the email.

I had the same problem, and had changed the first 'username' but not the second, hence fetchmail complaining about not being able to find username@localhost...

----------

