# Postfix Setup - Mail Delivery Problems

## rob.schall

I am trying to setup a postfix server with amavis/spamassassin/mysql, and everything seemed to go pretty smooth (everything came online, etc). But the mail isn't being delivered. I get the following error:

 *Quote:*   

> Jun 15 15:26:18 [postfix/virtual] 0FDC98944A8: to=<mine@test.com>, relay=virtual, delay=0.03, delays=0.01/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "mine@test.com")
> 
> Jun 15 15:26:18 [postfix/cleanup] 156AB8944AC: message-id=<20080615202618.156AB8944AC@mail1.wsol.com>
> 
> Jun 15 15:26:18 [postfix/bounce] 0FDC98944A8: sender non-delivery notification: 156AB8944AC

 

This occurs even when I use postfixadmin to create the account (because it sends a test message to the account). I've noticed that the domain/email folder isn't created on the server, but I don't know if thats a cause or effect of this issue.

Currently, there aren't any actual domains pointed at this server (its in an offline state). I don't know if this would affect it either.

Whatever information is needed from me, I'd be more than happy to provide, but I'm in a bit of a tight spot, as my boss would like this server done yesterday.

Thanks in advance for any help,

Rob

----------

## nativemad

Hi, 

Just a guess... in main.cf, you have mydomain=test.com. Is this right? Change it to something like mydomain=local.test.com or so...

If you use the postfix own mda, then the maildir should get created automatically (as far as i remember).

Cheers.

----------

## elgato319

Which E-Mail server are you using?

Could you plz post your main.cf without comments?

Looks like postfix(or the mailserver) has a problem to determine if the user exists.

Which tutorial did you use?

----------

## kashani

Couple of notes

1. post the output of postconf -n 

2. any virtual domain should not be in mydestination= or Postfix will treat it as a local domain.

3. you need to change the ownership of whatever base mail dir you specified in your postfixadmin configuration and virtual_mailbox_base in your main.cf to be owned by postfix:postfix so that Postfix can write to it and create directories and maildirs.

kashani

----------

## xtz

 *nativemad wrote:*   

> Hi, 
> 
> Just a guess... in main.cf, you have mydomain=test.com. Is this right? Change it to something like mydomain=local.test.com or so...

 Why?

----------

## nativemad

 *xtz wrote:*   

>  *nativemad wrote:*   Hi, 
> 
> Just a guess... in main.cf, you have mydomain=test.com. Is this right? Change it to something like mydomain=local.test.com or so... Why?

 

Therefore!   :Wink: 

 *kashani wrote:*   

> 2. any virtual domain should not be in mydestination= or Postfix will treat it as a local domain.

 

I believe mydestination is commonly =$mydomain....  :Wink: 

----------

## xtz

Then, mydestination is what he has to change, not mydomain.

----------

## nativemad

 *xtz wrote:*   

> Then, mydestination is what he has to change, not mydomain.

 

No, its vice versa... at least in my setups...  :Wink: 

mydomain=local.test.com

mydestination=$mydomain

in main.cf there is an example like this:

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

Anyhow... a virtual domain shouldn't be listed in any of these my-variables!   :Razz: 

----------

## xtz

Apparently not. From /etc/postfix/main.cf:

```
# The mydomain parameter specifies the local internet domain name.

# The default is to use $myhostname minus the first component.

# $mydomain is used as a default value for many other configuration

# parameters.
```

From the same file:

```
# The myhostname parameter specifies the internet hostname of this

# mail system. The default is to use the fully-qualified domain name

# from gethostname(). $myhostname is used as a default value for many

# other configuration parameters.
```

So, there are these three in my config (changed the real values, of course  :Cool: ):

```
myhostname = mail.blabla.eu

mydomain = blabla.eu

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
```

----------

## kashani

on my server which is virtual postfix

myhostname= vmail.badapple.net

mydomain = badapple.net

mydestination = $myhostname, locahost, localhost.$mydomain

Remember *any* domain added to mydestination will be treated as local. In my case, and probably most others, I want badapple.net added if needed to random email sent from the host like those generated from a cron. I do not want badapple.net treated as local which is why I have not included mydomain within mydestination.

kashani

----------

## nativemad

 *kashani wrote:*   

> Remember *any* domain added to mydestination will be treated as local. In my case, and probably most others, I want badapple.net added if needed to random email sent from the host like those generated from a cron. I do not want badapple.net treated as local which is why I have not included mydomain within mydestination. 
> 
> 

 

This is exactly the point! If you want to have every real mail-user in mysql/ldap or whatever, instead of normally pam, then it should be virtual... otherwise, the first domain owns local system accounts!

 *Quote:*   

> NEVER list a virtual alias domain name as a mydestination domain!

 

This is form here http://www.postfix.org/VIRTUAL_README.html

----------

