some postscreen(8) stats

2012-03-31 Thread Sahil Tandon
Before enabling DNSBL blocklists on one site, I was tasked with
gathering some postscreen(8) statistics.  I liked the information
display in a previous thread[1], but did not require the geoIP and
mapping features in Julien Vehent's script. So, I cobbled together a
smaller log parser[2] to produce only the data I need; just sharing in
case the information or script could be useful to others in the
community.

Example output, on a day earlier this week, aftering populating
'postscreen_dnsbl_sites', but leaving the default action as 'ignore':

UNIQ/TOTAL   EVENT
 127/494 COMMAND COUNT LIMIT
  60/104 COMMAND PIPELINING
 355/492 COMMAND TIME LIMIT
   35823/634743  CONNECT
   31504/65612   DISCONNECT
   24259/323664  DNSBL
   22464/51380   HANGUP
  54/90  NON-SMTP
8840/9300PASS NEW
   11394/292608  PASS OLD
4324/30342   PREGREET
   2/1447WHITELISTED
   25760/32960   reject (450)
4193/20639   reject (550)
  44/230 reject (all server ports busy)
   5/868 reject (too many connections)

... and for DNSBL clients only:

UNIQ/TOTAL   EVENT
 102/326 COMMAND COUNT LIMIT
  54/81  COMMAND PIPELINING
 299/408 COMMAND TIME LIMIT
   24259/389632  CONNECT
   23061/51893   DISCONNECT
   24259/323664  DNSBL
   19137/44210   HANGUP
  49/85  NON-SMTP
1722/1787PASS NEW
2716/62660   PASS OLD
3889/27267   PREGREET
   18643/24811   reject (450)
3783/16010   reject (550)
  35/220 reject (all server ports busy)
   3/374 reject (too many connections)

[1] http://article.gmane.org/gmane.mail.postfix.user/224979
[2] http://people.freebsd.org/~sahil/scripts/mailstats.py.txt

-- 
Sahil Tandon


Re: performance problems

2012-03-31 Thread Stan Hoeppner
On 3/30/2012 2:40 AM, Jeremie CEINTREY wrote:

Due to lack of any evidence I'll have to make some coarse educated
guesses here.

> I often encounter performance problems with postfix and mailing-list.

Mailing list servers.  Implicates rapid and likely parallel delivery
over a short interval.

> I have a relay mail postfix filtering mail traffic for about 12 000 
> mailboxes. Mailboxes are hosted on other mail servers. 
> 
> I use also amavisd-new with spammassassin and clamav. 
> Postfix version is 2.8 and i use it with postscreen configuration. 

This is likely not the problem.

> My problem is that I often see that mailq grows up to 7000 mails and it takes 
> about 2 hours to deliver those mails. I don't understand why it is so slow. 
> When i take a look at sender with qshape -s active i see who are sending 
> mails and it is always mailling, but it is not spam traffic. 

Let's assume you don't have any obvious Postfix mis-configuration.

So lets think this through logically, step by step.  The first and
obvious issue is that mail is coming in faster than it can go out which
is why the queue is filling up.  So we need to identify the cause of the
slow outbound queue.  A couple of possible causes:

1.  Downstream servers are limiting your delivery rate
2.  You storage system doesn't have enough IOPS performance to handle
both the incoming write load *and* outgoing read load

#1 should be identifiable by lots of premature disconnects and/or 4xx
rejections from downstream servers.  If this is indeed the problem you
can have admins of those servers make necessary changes, or you can
create individual relay transports configured with delays.

#2 can be fixed by replacing the queue disk with a faster device with
more IOPS capability, either a disk with higher RPM, an SSD, or multiple
disks in a striped RAID configuration, accomplished either with a
software RAID driver or with a hardware RAID controller.

Both #1 and #2 can usually easily be fixed by limiting the rate of
incoming mail, specifically by reducing the number of allowed parallel
connections.  Both mailing lists and bulk mailers tend to send a large
volume of mail in a short period of time.  The sending MTAs tend to do
this by opening multiple connections to your MTA, Postfix in this case,
which allows 50 connections per client by default.  To limit the number
of inbound parallel connections, you would change the value of the
following parameter

smtpd_client_connection_count_limit

from the default of 50 to something much lower, such as 1.  This will
limit the number of connections from mailing list servers, bulk mailers,
and spammers, while having no negative impact on normal inbound mail
flow.  Regular/normal mail delivery is usually accomplished with one
email being sent over a single connection which is then closed upon
successful delivery.  With 50 open connections, a sending MTA such as a
mailing list server, could potentially send hundreds of messages per
second.  If your disk isn't fast enough, which is likely your problem,
it will spend all of its IOPS writing the inbound mail to the queue,
which takes precedence over reads, causing read starvation and thus slow
delivery.  This is likely why your queue piles up and takes so long to
drain.

The net effect of this is that instead of your outbound queue piling up
messages, these messages pile up in the outbound queue of the sending
MTA, allowing you to receive them at a sane rate, and preventing your
queue from piling up, and delaying delivery.

An almost identical question came up on this list about a month or so
ago.  Setting smtpd_client_connection_count_limit=1 solved the OP's
queue problem.  It'll probably solve yours as well.

Hope this information is helpful.  Please let us know if this fixes your
problem.

-- 
Stan


Re: local not delivry with dspam

2012-03-31 Thread Wietse Venema
ml:
> hello list
> hello guru of the soft
> hello all
> 
> hello I seek again to set up dspam in my messaging solution but I am
> having a problem mails locals are no longer distributed
> 
> I know the option is in postfix is pickup
> can you help me put to good value of this variable
> 
> sincerely
> 
> my current config is a centos 5.8 with the last release of postfix and
> dovecot
> and the naturel release of dspam

Allow me to repeat the mailing list welcome message.

Wietse

TO REPORT A PROBLEM see http://www.postfix.org/DEBUG_README.html#mail

TO (UN)SUBSCRIBE see http://www.postfix.org/lists.html

Thank you for using Postfix.