public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] problem with mail server
@ 2009-02-03 13:24 Marcin Niśkiewicz
  2009-02-03 19:09 ` kashani
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Niśkiewicz @ 2009-02-03 13:24 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]

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>: <piotrpol@kujawy.com.pl> Temporary
lookup failure; from=<user@domain.org <piotrpol@kujawy.com.pl>> to=<
user@domain2.org <piotrpol@kujawy.com.pl>> 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

[-- Attachment #2: Type: text/html, Size: 2007 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] problem with mail server
  2009-02-03 13:24 [gentoo-user] problem with mail server Marcin Niśkiewicz
@ 2009-02-03 19:09 ` kashani
  2009-02-04 10:28   ` Marcin Niskiewicz
  0 siblings, 1 reply; 3+ messages in thread
From: kashani @ 2009-02-03 19:09 UTC (permalink / raw
  To: gentoo-user

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>: 
> <mailto:piotrpol@kujawy.com.pl> Temporary lookup failure; 
> from=<user@domain.org <mailto:piotrpol@kujawy.com.pl>> 
> to=<user@domain2.org <mailto:piotrpol@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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] problem with mail server
  2009-02-03 19:09 ` kashani
@ 2009-02-04 10:28   ` Marcin Niskiewicz
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Niskiewicz @ 2009-02-04 10:28 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 2160 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2825 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-04 10:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 13:24 [gentoo-user] problem with mail server Marcin Niśkiewicz
2009-02-03 19:09 ` kashani
2009-02-04 10:28   ` Marcin Niskiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox