Postfix newbie virtual domain problem - FIXED

Hello folks, I've been pulling my hair out trying to figure this one out. I'm fairly new to postfix and I thought I had it all set up correctly, but I can't get it working completely.

Basically, if I email user@domain.com (substituted with a real domain name that I have set up) I get the following message:
> This is the Postfix program at host mithras.

I'm sorry to have to inform you that your message could not be be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to If you do so, please include this problem report. You can delete your own text from the attached returned message.

The Postfix program

<user@domain.com>: User unknown in virtual alias table
So I know the postfix program is up and running, but for some reason it isn't accepting my message.

Here's my main.cf file:
> # See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpdbanner = $myhostname ESMTP $mailname (Debian/GNU)

biff = no

appending .domain is the MUA's job.

appenddotmydomain = no

Uncomment the next line to generate "delayed mail" warnings

delaywarningtime = 4h

mailbox_command = procmail -a "$EXTENSION"

myhostname = mithras

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

myorigin = /etc/mailname

mydestination = mithras, localhost, localhost.localdomain

virtualaliasdomains = domain.com, domain2.com

relayhost =

mynetworks = 127.0.0.0/8

mailboxsizelimit = 0

recipient_delimiter = +

inet_interfaces = all

virtualaliasmaps = hash:/etc/postfix/virtual_mailbox.txt

mynetworks_style = host

relay_domains = $mydestination

unknownlocalrecipientrejectcode = 450

In the /etc/postfix/virtual_mailbox.txt file, I have entries such as the following, and the permissions of the file are owned by root and are set with -rwxr–r--. The contents of the file is:
> # domain.com

@domain.com unixuser

domain2.com

@domain2.com unixuser

Elsewhere I saw that the output of postfix -n is more useful, so here is the output from that command:
> alias_database = hash:/etc/aliases

alias_maps = hash:/etc/aliases

appenddotmydomain = no

biff = no

config_directory = /etc/postfix

inet_interfaces = all

mailbox_command = procmail -a "$EXTENSION"

mailboxsizelimit = 0

mydestination = mithras, localhost, localhost.localdomain

myhostname = mithras

mynetworks_style = host

myorigin = /etc/mailname

recipient_delimiter = +

relayhost =

smtpdbanner = $myhostname ESMTP $mailname (Debian/GNU)

unknownlocalrecipientrejectcode = 450

virtualaliasdomains = domain.com, domain2.com

virtualaliasmaps = hash:/etc/postfix/virtual_mailbox.txt

I am running Debian Sarge and the latest version of postfix.

If anyone can help me get my virtual mailboxes working I would greatly appreciate it.

Thanks,

Shawn

3 Replies

You have specified virtualaliasmaps to be a database file of type hash - but it is a text file.

postmap hash:/etc/postfix/virtual_mailbox.txt

will produce /etc/postfix/virtual_mailbox.db which should then be referenced in your main.cf

@pclissold:

You have specified virtualaliasmaps to be a database file of type hash - but it is a text file.

postmap hash:/etc/postfix/virtual_mailbox.txt

will produce /etc/postfix/virtual_mailbox.db which should then be referenced in your main.cf

Actually, I tried that and it gives me the following error. It looks like the .db extension is automatically added by Postfix:

> Sep 14 11:35:25 localhost postfix/smtpd[2810]: fatal: open database /etc/postfix/virtual_mailbox.txt.db.db: No such file or directory

I am starting to wonder if the problem might be elsewhere. In my log file I see it trying to forward the email on to an address that looks like it's on the internet rather than localhost, so I'm going to do some more testing.

If you see anything else wrong or anyone else has suggestions I would appreciate it.

Thanks,

Shawn

I'm able to accept email now, and the only change I made was to move my "main" domain name to the mydestination portion of my main.cf file. I don't know why that works, but it does. The problem seems to be that in the virtual mailboxes, it would try to forward to a local account that was giving me the fully qualified domain name for some reason, and would not find that. My "user@domain.com" address was working fine.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct