FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-03-2009, 12:24 PM
Marcin Ni┼Ťkiewicz
 
Default problem with mail server

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 <user@domain.org>: Temporary lookup failure; from=<user@domain.org> to=<user@domain2.org> proto=ESMTP helo=<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
 
Old 02-03-2009, 06:09 PM
kashani
 
Default problem with mail server

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 <user@domain.org>:
<mailtoiotrpol@kujawy.com.pl> Temporary lookup failure;
from=<user@domain.org <mailtoiotrpol@kujawy.com.pl>>
to=<user@domain2.org <mailtoiotrpol@kujawy.com.pl>> proto=ESMTP
helo=<domain.org <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
<http://mysql-transport.cf>


my /etc/mail/sql/mysql-transport.cf <http://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
 
Old 02-04-2009, 09:28 AM
Marcin Niskiewicz
 
Default problem with mail server

2009/2/3 kashani <kashani-list@badapple.net>





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
 

Thread Tools




All times are GMT. The time now is 04:07 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ę2007 - 2008, www.linux-archive.org