Postfix > User unknown in virtual alias table

Hello,

I have a problem with postfix when i try to send emails from usermin or email clients.
Before i change my hostname, all worked like a charm, and now (also after create sub-server), smtp is not working.

Can you help me to correct this problem ?

i have put some information about my configuration >(mydomain) = my domain name…
In virtual domains, the map specification seems to be ok > hash:/etc/aliases

The error message in mail log >
Recipient address rejected: User unknown in virtual alias table; from=<test@(mydomain).com> to=<test@(externaldomain).com> proto=ESMTP helo=<[192.168.0.4]>

		-------------------------------------------------------------------------

cat /etc/hosts
127.0.0.1 localhost.localdomain localhost

Auto-generated hostname. Please do not remove this comment.

178.32.5.242 server.(mydomain).com server
------------------------------------------------------------------------

hostname
server.(mydomain).com
-------------------------------------------------------------------------
postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
home_mailbox = Maildir/
html_directory = no
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, server.13cinq.com
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sender_bcc_maps = hash:/etc/postfix/bcc
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual
-------------------------------------------------------------------------
cat /etc/mailname
cat: /etc/mailname: No such file or directory
-------------------------------------------------------------------------
main.cf >
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
virtual_alias_maps = hash:/etc/postfix/virtual
mydestination = $myhostname, localhost.$mydomain, localhost, server.(mydomain).com

		-------------------------------------------------------------------------

Thank you

Howdy,

If you changed the hostname, what you’ll want to do is make sure there’s matching entries in your /etc/hosts file and on the mydestination line of your /etc/postfix/main.cf.

There needs to be a line in your hosts file and on your mydestination line that exactly matches your servers hostname.

If you make changes to your main.cf file, make sure you restart Postfix afterwards.

Let us know if that does the trick!

-Eric

Hi Eric,

The matching entries are ok :

/etc/hosts
178.32.5.242 server.(mydomain).com server

/etc/postfix/main.cf
mydestination = $myhostname, localhost.$mydomain, localhost, server.(mydomain).com

I have restarted postfix, but the problem persist

Thank you so much for your help

Angang

Hrm, in the logs above, I see a reference to the address 192.168.0.4. If your server is behind a NAT firewall, I believe you’ll want to use that 192 address in the hosts file, rather than the external IP address.

Also, just to be super-sure, if you run the command “hostname” on your server, do you see the correct “server.mydomain.com” returned?

-Eric

i Eric,

I’m really glad to have your help…

The reference 192.168.0.4 is about my computer from what i have sent the email test (with OSX “MAIL” client).
The server is on OVH.
I have installed CSF (stoping the service doesn’t resolve the issue).

About Hostname 100% sure :

hostname
server.(mydomain).com

It is the same as the postconf…
mydestination = $myhostname, localhost.$mydomain, localhost, server.(mydomain).com

In > cat /etc/postfix/virtual for the test email i have :
test@(mydomain).com test.(mydomain)

The strange thing is that it worked before… Other thing is about the recipient… if i try to send to google user, no problem… but i think it’s about “MAIL” client and automated relay…
relay=gmail-smtp-in.l.google.com

Thanks again for your help

Angang

Eric,

I have to thank you for your efforts, now the problem is resolved.

I have just found that the problem was double :

  • for usermin, i thonk that i haven’t test after change postfix conf.
  • for email client, the problem was that i have put smtp.mydomain.com instead of mydomain.com !!

Thanks again,

Angang