Postfix Installing with dovecot

I have installed postfix with dovecot for my mail server. Both dovecot and Postfix seem to be operational when I Telnet to them.

But when I try to send a mail from the command line suing mailx I get this error in the mail.log

proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf lookup error for "sales@XXXXXXX.co.uk"

 virtual_alias_maps map lookup problem for sales@XXXXXXX.co.uk -- deferring delivery

I looked into this file and its all correct. That is it below

Code:
user = xxxxx
password = xxxxx
dbname = mail
query = SELECT destination FROM forwardings WHERE source='%s'
hosts = 127.0.0.1

Not sure where I stand with this? Any help would be great. Can provide any information if needed. I set this up following the guide on linode. Any help would be great.

~~[http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid" target="_blank">](http://library.linode.com/email/postfix … 0.04-lucid">http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid](

Thanks

William

3 Replies

What does running

echo "SELECT destination FROM forwardings WHERE source='sales@XXXXXXX.co.uk'" | mysql -u xxxxx --password=xxxxx mail

get you?

@Vance:

What does running

echo "SELECT destination FROM forwardings WHERE source='sales@XXXXXXX.co.uk'" | mysql -u xxxxx --password=xxxxx mail

get you?

Nothing mate. Doesn't echo anything. Both the forwarding's and destinations tables are empty. I have just created one users email address in the users table like the guide said..

Should the other tables be populated when I try to send a mail to the address to create the virtual mail box.

Thanks

OK, sorry, I wasn't all that familiar with the library article.

It indeed does not specify any entries to be added to the forwardings table (and I'm pretty sure one won't be created automatically).

You should look at both the domains and users tables and make sure they have appropriate entries. Check using the username and password you redacted to ensure that this user has the rights to perform lookups.

Also double-check the value of virtualaliasmaps in your Postfix main.cf:

virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf

There may be a typo in /etc/postfix/mysql-virtual_email2email.cf, or the file itself may be misnamed.

The error message suggests to me that Postfix is searching for the destination e-mail address via mysql-virtualforwardings.cf but not via mysql-virtualemail2email.cf.

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