Postfix newbie virtual domain problem - FIXED
Basically, if I email
> 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
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