# [SOLVED] Postfix & Mysql : Temporary lookup failure

## arvath

Hi,

I have problem with my Postfix & Mysql with amavis and spamassassin instalation. I have installed it with article from Gentoo Wiki.

My problem: 

When I'm sending e-mail from webmail, in logs i have:

 *Quote:*   

> 
> 
> Jan 22 14:21:04 batman postfix/smtp[30703]: 73913422D1: to=<user@domain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.58, delays=0.03/0/0.02/0.54, dsn=4.3.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.3.0 Failed, id=07109-15, from MTA([127.0.0.1]:10025): 451 4.3.0 <user@domain.com>: Temporary lookup failure (in reply to end of DATA command))
> 
> 

 

What is wrong?

Postfix config:

```
alias_database = hash:/etc/mail/aliases

alias_maps = hash:/etc/mail/aliases

broken_sasl_auth_clients = yes

command_directory = /usr/sbin

config_directory = /etc/postfix

content_filter = smtp-amavis:[127.0.0.1]:10024

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

default_destination_concurrency_limit = 10

disable_vrfy_command = yes

home_mailbox = Maildir/

inet_interfaces = all

local_destination_concurrency_limit = 2

mail_name = My Mail

mail_owner = postfix

mail_spool_directory = /var/mail

mailbox_size_limit = 1000000000

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

message_size_limit = 5000000

mydestination = $myhostname

mydomain = domain.com

myhostname = host.domain.com

mynetworks = 127.0.0.0/8

myorigin = $myhostname

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

queue_run_delay = 30m

readme_directory = no

relay_domains = 127.0.0.0/8

sample_directory = /etc/postfix

sendmail_path = /sbin/sendmail

setgid_group = postdrop

smtp_tls_note_starttls_offer = yes

smtp_use_tls = yes

smtpd_banner = $myhostname ESMTP $mail_name s

smtpd_client_restrictions = reject_unknown_sender_domain

smtpd_hard_error_limit = 5

smtpd_recipient_limit = 10

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain = 

smtpd_sasl_security_options = noanonymous

smtpd_sender_restrictions = reject_unknown_sender_domain

smtpd_soft_error_limit = 3

smtpd_tls_CAfile = /etc/postfix/ssl/smtpd.pem

smtpd_tls_auth_only = no

smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.pem

smtpd_tls_key_file = /etc/postfix/ssl/smtpd.pem

smtpd_tls_loglevel = 1

smtpd_tls_received_header = yes

smtpd_use_tls = yes

tls_random_source = dev:/dev/urandom

unknown_local_recipient_reject_code = 550

virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf

virtual_gid_maps = static:207

virtual_mailbox_base = /home/vmail/

virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf

virtual_mailbox_limit = 51200000

virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf

virtual_minimum_uid = 207

virtual_transport = virtual

virtual_uid_maps = static:207

```

smtpd.conf:

```

pwcheck_method: auxprop

auxprop_plugin: sql

sql_engine: mysql

mech_list: login plain

sql_user: postfix

sql_passwd: passwod

sql_database: postfix

sql_select: SELECT password FROM mailbox WHERE username = '%u@%r'

sql_verbose: yes

sql_hostnames: 127.0.0.1 

log_level: 7 

```

master.cf

```

smtp      inet  n       -       n       -       -       smtpd

pickup    fifo  n       -       n       60      1       pickup

cleanup   unix  n       -       n       -       0       cleanup

qmgr      fifo  n       -       n       300     1       qmgr

tlsmgr    unix  -       -       n       1000?   1       tlsmgr

rewrite   unix  -       -       n       -       -       trivial-rewrite

bounce    unix  -       -       n       -       0       bounce

defer     unix  -       -       n       -       0       bounce

trace     unix  -       -       n       -       0       bounce

verify    unix  -       -       n       -       1       verify

flush     unix  n       -       n       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

smtp      unix  -       -       n       -       -       smtp

relay     unix  -       -       n       -       -       smtp -o 

showq     unix  n       -       n       -       -       showq

error     unix  -       -       n       -       -       error

retry     unix  -       -       n       -       -       error

discard   unix  -       -       n       -       -       discard

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

scache     unix   -   -   n   -   1   scache

smtp-amavis   unix   -   -   y   -   4   smtp 

   -o smtp_data_done_timeout=1200 

   -o disable_dns_lookups=yes

   -o smtp_send_xforward_command=yes

127.0.0.1:10025   inet   n   -   y   -   -   smtpd 

   -o content_filter= 

   -o local_recipient_maps= 

   -o relay_recipient_maps= 

   -o smtpd_restriction_classes= 

   -o smtpd_helo_restrictions= 

   -o smtpd_sender_restrictions= 

   -o smtpd_recipient_restrictions=permit_mynetworks,reject 

   -o mynetworks=127.0.0.0/8 

   -o strict_rfc821_envelopes=yes 

```

Postfix isn't chrooted. I have local dns on bind, it works good.

Any hints?

P.S Sorry for my english  :Wink: Last edited by arvath on Tue Jan 22, 2008 5:54 pm; edited 1 time in total

----------

## magic919

I'd have a look at these.

```

mydestination = $myhostname

mydomain = domain.com

myhostname = host.domain.com 

```

Can't spot anything else wrong.

----------

## arvath

These settings in my config are setted to my domain and host. I've cutted this for this post.

Any ideas?

----------

## magic919

I know  :Smile: 

Read in main.cf and find out what is wrong.

```

mydestination = $myhostname

```

Plain wrong.  Email address != username@host.domain.com, surely.

```

mydomain = domain.com

myhostname = host.domain.com 

```

Lose mydomain as this is derived from host.domain.com - host = domain.com

----------

## arvath

I've changed it, but it still have Temporary lookup failure.    :Sad: 

----------

## magic919

I could spend all night checking your configs...  I think you should verify them from the howto.

This looks wrong too

```

127.0.0.1:10025   inet   n   -   y   -   -   smtpd 

```

y = chroot

----------

## arvath

Are you sure?

Wthout these "y" My postfix won't start...

EDIT:

I installed postfix with this article http://gentoo-wiki.com/HOWTO_Setup_a_Virtual_Postfix/Courier_Mail_System_with_PostfixAdmin

----------

## magic919

I was meaning use n for that one.

----------

## arvath

Yeah, it works  :Wink:  Thank you for help   :Cool: 

----------

## magic919

No probs.  Enjoy.

----------

