# Weird stuff happening with SMTP



## dennylin93 (Sep 7, 2009)

Hi, I'm seeing something really bizarre right now, and I can't find the problem.

I'm trying to send mail to an account (username1@example.com), but I keep getting rejected. Here's the rejected message:

```
[-- Attachment #1: Notification --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.4K --]

This is the mail system at host sender.example.com.
  
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system
<username1@example.com>: unknown user: "username1"

[-- Attachment #2: Delivery report --]
[-- Type: message/delivery-status, Encoding: 7bit, Size: 0.3K --]

Reporting-MTA: dns; sender.example.com
X-Postfix-Queue-ID: F008E239425
X-Postfix-Sender: rfc822; dennylin93@sender.example.com
Arrival-Date: Mon,  7 Sep 2009 21:12:22 +0800 (CST)

Final-Recipient: rfc822; username1@example.com
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Postfix; unknown user: "username1"
```

I am certain that the user exists on the server.

Weird part is that when I use telnet, helo, MAIL FROM, RCPT TO, DATA, etc, the message it accepted for delivery. I can also send mail to another user on the same server (username2@example.com).

I'm using Mutt to send mails right now.

Can someone point me the right direction? Thanks.


----------



## DutchDaemon (Sep 7, 2009)

Anything interesting in the maillog of the receiving/rejecting mailserver?


----------



## dennylin93 (Sep 7, 2009)

I've traced the problem a bit now (temporarily removed procmail to get more detailed logs). I'm sending mail from sender.example.com to example.com, but Postfix isn't even sending out the mail. It's just looking for local users. There should be something wrong in /usr/local/etc/postfix/main.cf, so I'll take a look and see what I've missed.


----------



## DutchDaemon (Sep 7, 2009)

In that case, Postfix considers example.com as a local domain, so it will try to deliver to a local mailbox ( = email address -/- domain ) or to a virtusertable entry. You'll have to convince Postfix that example.com is not a local domain, whereas sender.example.com is.


----------



## dennylin93 (Sep 7, 2009)

I just found the reason (same reason as your post). In the configuration file, $mydomain was added to mydestination. I must've put it there for testing purposes (forgot to remove it later). I often make stupid mistakes :\.

Thanks for all the help.


----------

