[gentoo-user] problem with mail server

2009-02-03 Thread Marcin Niƛkiewicz
Hello
I'm testing mail server with mysql backend. Generally it works quite well.
But from time to time during testing, single mails can't be send because of
smtp errors:

in mail.log
Feb  3 13:47:37 mail postfix/smtpd[28339]: NOQUEUE: reject: RCPT from
unknown[ip]: 451 4.3.0 :  Temporary
lookup failure; from=> to=<
u...@domain2.org > proto=ESMTP helo=
in mail.warn
Feb  3 13:47:37 kurier4 postfix/trivial-rewrite[2438]: warning:
transport_maps lookup failure

when I check transport_map:

postconf | grep transport_map
address_verify_transport_maps = $transport_maps
fallback_transport_maps =
mailbox_transport_maps =
mydestination = $myhostname, localhost.localdomain, $transport_maps
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
$virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
$relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
$recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
transport_maps = mysql:/etc/mail/sql/mysql-transport.cf

my /etc/mail/sql/mysql-transport.cf looks like that:
user = postfix
password = password
dbname = maildb
table = transport
select_field = destination
where_field = domain
hosts = 127.0.0.1

Generally I'm thinking that it could be mysql error - but there is nothing
wrong in its error log...
I set really big limit of concurrent connections

max_user_connections = 1000

So what can be wrong?
Any ideas?

Thank in progress for any help
best regards
nichu


Re: [gentoo-user] problem with mail server

2009-02-03 Thread kashani

Marcin Nis'kiewicz wrote:

Hello
I'm testing mail server with mysql backend. Generally it works quite 
well. But from time to time during testing, single mails can't be send 
because of smtp errors:


in mail.log
Feb  3 13:47:37 mail postfix/smtpd[28339]: NOQUEUE: reject: RCPT from 
unknown[ip]: 451 4.3.0 : 
 Temporary lookup failure; 
from=mailto:piotr...@kujawy.com.pl>> 
to=mailto:piotr...@kujawy.com.pl>> proto=ESMTP 
helo=http://domain.org> >

in mail.warn
Feb  3 13:47:37 kurier4 postfix/trivial-rewrite[2438]: warning: 
transport_maps lookup failure


when I check transport_map:

postconf | grep transport_map
address_verify_transport_maps = $transport_maps
fallback_transport_maps =
mailbox_transport_maps =
mydestination = $myhostname, localhost.localdomain, $transport_maps
proxy_read_maps = $local_recipient_maps $mydestination 
$virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps 
$virtual_mailbox_domains $relay_recipient_maps $relay_domains 
$canonical_maps $sender_canonical_maps $recipient_canonical_maps 
$relocated_maps $transport_maps $mynetworks
transport_maps = mysql:/etc/mail/sql/mysql-transport.cf 



my /etc/mail/sql/mysql-transport.cf  looks 
like that:

user = postfix
password = password
dbname = maildb
table = transport
select_field = destination
where_field = domain
hosts = 127.0.0.1

Generally I'm thinking that it could be mysql error - but there is 
nothing wrong in its error log...

I set really big limit of concurrent connections

max_user_connections = 1000

So what can be wrong?
Any ideas?

Thank in progress for any help
best regards
nichu


I think you've got a couple of problems, but none of them individually 
jump at as the cause of your problems. However making these three 
changes together might help.


1. Turn your max_user_connections in Mysql down to something sane. 
Default is 100 which is fine unless you're also running a web app 
against the same Mysql instance.


2. Use proxy in your Mysql connections from Postfix.
Postfix can be configured to open a connection to Mysql and keep it 
open. Basically acts a connection pool and keep Postfix from opening 
hundreds of connections to Mysql on a very busy server. I recommend 
*always* using the proxy: statement anytime you're connecting to Mysql 
from Postfix. Your new transport_map statement will look like this.


transport_maps =  proxy:mysql:/etc/mail/sql/mysql-transport.cf

Generally you shouldn't be running into connection issues because you're 
hitting Mysql on localhost which means it'll default to a socket 
connection. It's possible that opening a new session is taking to too 
long occasionally and using proxy should alleviate that.


3. You're using Postfix 2.1 or earlier query syntax.
Hell it might even be Postfix 1.x syntax. This is the new syntax for 
Postfix 2.2 or better. This really isn't a problem, but the new syntax 
is far more powerful and suspect bugs that creep into the parser around 
old syntax aren't noticed or getting fixed.


user = postfix
password = password
hosts = localhost
dbname = maildb
query = SELECT destination FROM domain WHERE domain='%s'

I'm not sure what how-to you've been using, but I'd look at a few others 
to see some of the other options available. The one you're using seems 
to be pretty far out of date. While not wrong in any way it isn't taking 
full advantage of the last seven years of updates in Postfix.


kashani



Re: [gentoo-user] problem with mail server

2009-02-04 Thread Marcin Niskiewicz
2009/2/3 kashani 

>
>>
> I think you've got a couple of problems, but none of them individually jump
> at as the cause of your problems. However making these three changes
> together might help.
>
> 1. Turn your max_user_connections in Mysql down to something sane. Default
> is 100 which is fine unless you're also running a web app against the same
> Mysql instance.
>
> 2. Use proxy in your Mysql connections from Postfix.
> Postfix can be configured to open a connection to Mysql and keep it open.
> Basically acts a connection pool and keep Postfix from opening hundreds of
> connections to Mysql on a very busy server. I recommend *always* using the
> proxy: statement anytime you're connecting to Mysql from Postfix. Your new
> transport_map statement will look like this.
>
> transport_maps =  proxy:mysql:/etc/mail/sql/mysql-transport.cf
>
> Generally you shouldn't be running into connection issues because you're
> hitting Mysql on localhost which means it'll default to a socket connection.
> It's possible that opening a new session is taking to too long occasionally
> and using proxy should alleviate that.
>
> 3. You're using Postfix 2.1 or earlier query syntax.
> Hell it might even be Postfix 1.x syntax. This is the new syntax for
> Postfix 2.2 or better. This really isn't a problem, but the new syntax is
> far more powerful and suspect bugs that creep into the parser around old
> syntax aren't noticed or getting fixed.
>
> user = postfix
> password = password
> hosts = localhost
> dbname = maildb
> query = SELECT destination FROM domain WHERE domain='%s'
>
> I'm not sure what how-to you've been using, but I'd look at a few others to
> see some of the other options available. The one you're using seems to be
> pretty far out of date. While not wrong in any way it isn't taking full
> advantage of the last seven years of updates in Postfix.
>
> kashani
>
> thank You for Your response
I switch all of mysql connections to proxy and I'll be watching if it helps.
You're right - syntax of my configs were ancient - so I set them right.

thank You again
I hope it's solutions to my problems

regards
nichu