# "bad uid -uid in virtual_uid_maps"

## Dr_Stein

Greetings! After following every direction I could find in the document http://www.gentoo.org/doc/en/virt-mail-howto.xml I'm getting the error shown below.

I have the feeling that it's a problem with a UID somewhere, but for the life of me I cannot find the actual problem.  :Sad: 

Has anybody followed the virtual mail howto and encountered this error? Anybody know a way to fix it or where I should start? I Googled for it and didn't come up with any solutions. Oh, and yes, I checked the forums, too..  :Smile: 

Thanks!

Oh yeah, here's the error: (I made my DNS server authoritative for "domain2.com" so DNS definately isn't the problem.)

Mar 20 20:27:32 [postfix/virtual] B346318FE4: to=<test2@domain2.com>, relay=virtual, delay=0, status=deferred (recipient test2@domain2.com: bad uid -uid in virtual_uid_maps)

----------

## Dr_Stein

Ok, I found the solution! 

The following section (10.10) in the documentation was a little bit confusing. See, main.cf has other things that use the "$" symbol. I didn't change static:$vmail-gid to the GID from /etc/group and likewise for the UID.

Other places in the docs it says to replace "$password" with the appropriate password, but in this particular instance, the $variable wasn't explained.  :Smile: 

I suggest finding a different character to use for a variable in the documentation. Might keep confused people like me from going insane.  :Wink: 

Confusing documentation snippet below:

 Code listing 10.10: /etc/postfix/main.cf

		# nano -w /etc/postfix/main.cf

		alias_maps = mysql:/etc/postfix/mysql-aliases.cf

		relocated_maps = mysql:/etc/postfix/mysql-relocated.cf

		local_transport = local

		local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

		virtual_transport = virtual

		virtual_mailbox_domains =

			virt-bar.com,

			$other-virtual-domain.com

		virtual_minimum_uid = 1000

		virtual_gid_maps = static:$vmail-gid

		virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf

		virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf

		virtual_uid_maps = static:$vmail-uid

		virtual_mailbox_base = /

		#virtual_mailbox_limit =

----------

## Wi1d

This is what makes this forum so great. All the people before post thier solutions.

----------

## Dr_Stein

I do it for myself sometimes - because I may run into the same issue again and need to search for it!  :Very Happy: 

----------

## Willert

 *Dr_Stein wrote:*   

> Ok, I found the solution! 
> 
> The following section (10.10) in the documentation was a little bit confusing. See, main.cf has other things that use the "$" symbol. I didn't change static:$vmail-gid to the GID from /etc/group and likewise for the UID.

 

This had me puzzled for a long time too before reading your post. If you are not into the Posfix configuration syntax then it is not easy to figure out that you need the replace the $vmail-gid (and uid) with the actual UNIX gid (and uid).

Thanks for posting this!

----------

## Dr_Stein

Hey, no problem.  :Smile:  I actually refer to my own posts sometimes because I forget stuff all the time!  :Very Happy: 

The vmail guide is in serious need of some updates, at least the last time that I looked at it was.

----------

## Lartten

I had this problem too. 

But now all the mail gets too the right sender  :Wink: 

----------

