# Postfix, dsn=5.1.1, status=bounced (user unknown) [solved]

## Biffen

Hi,

Trying to configure postfix for the first time. My goal is to use postfix + dovecot +mysql +virtualdomains and postfixadmin for administration. Later I like ti use dspam for spam protection.

I tried this guide,

http://gentoo-wiki.com/HOWTO_Mail_Hosting_with_Postfix_and_Dovecot#SQL_Virtual_Users_Setup

but got stuck, not able to send mail to my virtual domains:

Jul 11 13:39:58 mail postfix/pipe[7758]: B057637622: to=<myuser@myvirtualdomain.com>, relay=dovecot, delay=0.07, delays=0.04/0.02/0/0.02, dsn=5.1.1, status=bounced (user unknown)

So... here is some questions:

1. Do I have to have access to real mx to get it to work, just for testing? Or is it possible to test postfix without resolve thru mx?

2. If I only have 1 domain and want it to be virtual in mysql, how do I configure mail.cf, mydomain, myhostname, mydestination?

- - -

If I try to use thunderbird to access imap to virtual accounts I can poll mailbox, create folders and when I try to send a mail to same user as connected it saves a copy in sent folder, but I get no mail in inbox, just the message shown (...status=bounced (user unknown)). If I configure the myvirtualdomain.com domain in mydomain and create myuser in system account, postfix sends mail to the system user account but I get errors in mail.log that I have samt domain in both system and virtual setup.  :Sad:  The goal is just to have 1 virtual domain, no system accounts. Help!  :Smile: 

I really need help with this, tnx!

If u need more information I will post it!Last edited by Biffen on Sun Jul 13, 2008 2:40 pm; edited 1 time in total

----------

## elgato319

You can always send e-mails locally via telnet.

In my config i have:

 *Quote:*   

> mydestination = localhost
> 
> myhostname = mydomain.com

 

i don't habe mydomain set anywhere.

my config is similar to the one in the wiki.

 *Quote:*   

> local_transport = virtual
> 
> virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf

 

----------

## Biffen

Hi!

Tnx for responding. Its this guide I used: (think I got wrong one in here before)

http://gentoo-wiki.com/Mail_server_using_Postfix_and_Dovecot

Yes, tried to use telnet to, got some errors with access denied to mysql_config_files so i changed group to postfix, seems to be right now, but gets user unknown anyway  :Sad: 

If I try to send mail with telnet then postfix seems to be able to read the mysqltables. If I misspelled user or domain it respons to it, but even with right adress I get user unknown when it tried to send to the localvirtualuser.

- - -

So, misspelled user I get this in telnet session output:

550 5.1.1 <wrongname@myvirtualdomain.com>: Recipient address rejected: User unknown in virtual mailbox table

And, misspelled domain I get this in mail.log:

Jul 11 22:33:11 mail postfix/smtp[11120]: 92BA02DF4D: to=<rightname@not_myvirtualdomain.com>, relay=none, delay=318, delays=318/0.02/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=not_myvirtualdomain.com type=A: Host not found)

- - -

If I understand this right it can read both the user and domaintable in mysql, but postfix fail to do it when it receives mail to my virtual users, right?

One more thing, is "relay=dovecot" in my error output related to my problems or ok?

Jul 11 22:27:08 mail postfix/pipe[11098]: B61332DF4D: to=<rightname@myvirtualdomain.com>, relay=dovecot, delay=32, delays=32/0.02/0/0.02, dsn=5.1.1, status=bounced (user unknown)

Any ideas?

----------

## Biffen

Hi!

Still having trouble with this, tried to point my mx correctly  to my server and done some tests sending mail and some test with postmap:

Test domainname exists:

postmap -q mydomain.com proxy:mysql:/etc/postfix/mysql_virtual_domain_maps.cf

mydomain.com

Test user exists:

postmap -q myuser@mydomain.com proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf

mydomain.com/myuser/Maildir/

Test alias_for_myuser exists:

postmap -q myuseralias@mydomain.com proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf

myuser@mydomain.com

- - -

I added -v -v to master smtpd , can see it finds all user,alias and domain data thou mysql:/etc/postfix/mysql_virtual... but when it then tries to send to the user it just output same error and bounce the mail to sender:

Jul 13 14:53:42 mail postfix/pipe[15506]: 4ED762B9A0: to=<myuser@mydomain.com>, relay=dovecot, delay=0.1, delays=0.07/0/0/0.02, dsn=5.1.1, status=bounced (user unknown)

Versions used:

postfix-2.5.2

dovecot-1.0.13-r1

Please, can any one help me pinpoint this, thanks.

----------

## steveb

Could it be that Dovecot is rejecting/bouncing the mail?

// SteveB

----------

## Biffen

 *steveb wrote:*   

> Could it be that Dovecot is rejecting/bouncing the mail?
> 
> // SteveB

 

You got a point, you have any tip how to check, configure it correctly? If I configure thunderbird to myaccount to connect to imap it works fine, it creates user_ maildir_directory and when I try to send a mail to myself (same user) it copy sent mail to sent folder but mail then bounce with user unknown error (same error message as always) Strange...  :Sad: 

Help please.

----------

## steveb

 *Biffen wrote:*   

> You got a point, you have any tip how to check, configure it correctly?

 To be honest: No

I am more familiar with Cyrus and Courier. Dovecot is not my field. Anyway... could you try to connect to Dovecot and read the mailbox. Does that work? Is the user known?

// SteveB

----------

## Biffen

 *steveb wrote:*   

>  *Biffen wrote:*   You got a point, you have any tip how to check, configure it correctly? To be honest: No
> 
> I am more familiar with Cyrus and Courier. Dovecot is not my field. Anyway... could you try to connect to Dovecot and read the mailbox. Does that work? Is the user known?
> 
> // SteveB

 

You know what, I found it! Tnx, for your question about dovecot maybe the problem, it was, I had configure wrong. Anyway, I could connect to mailbox before to and read mailbox, thats why I tout dovecot was configured ok.

I had:

userdb prefetch {

  }

instead of:

userdb sql {

    args = /etc/dovecot/dovecot-sql.conf

- - -

I think I can configure with prefetch to but but I have to read more about dovecot configuration features first.  :Smile: 

THANK YOU!  :Smile: 

----------

## steveb

 :Smile:  Nice that it worked  :Very Happy: 

 *Biffen wrote:*   

> Later I like ti use dspam for spam protection.

 Okay. I am now waiting for your problems with DSPAM  :Smile:  I am very good at DSPAM.

// SteveB

----------

## Biffen

 *steveb wrote:*   

>  Nice that it worked 
> 
>  *Biffen wrote:*   Later I like ti use dspam for spam protection. Okay. I am now waiting for your problems with DSPAM  I am very good at DSPAM.
> 
> // SteveB

 

Hehe, well I used to qmail,vpopmail,courier-imap and spamassassin so its possible ill maybe will ave some problems with dspam, Im planing to follow this guide:

http://gentoo-wiki.com/HOWTO_Secure_Mail_Server_using_Dovecot

Why do you use courier instead of dovecot? (courier-authlib has dropped support for vpopmail, thats why I looking into maybe switch to postfix,dovecot,dspam)

----------

## steveb

 *Biffen wrote:*   

> Why do you use courier instead of dovecot? (courier-authlib has dropped support for vpopmail, thats why I looking into maybe switch to postfix,dovecot,dspam)

 I use Cyrus AND Courier (have a bunch of servers running). Have planed to play one day with Dovecot but did not got enough time to do so.

// SteveB

----------

