|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
fork: Cannot allocate memory and mail_addr_find problem
From: brian (postfixlist
subtropolix.org)
Date: Fri Sep 01 2006 - 20:38:15 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
postfix-2.2.5
# uname -srvpi
Linux 2.4.20-021stab028.24.777-enterprise #1 SMP Fri Jan 6 19:39:27 MSK
2006 i686 i386
# free
total used free shared buffers cached
Mem: 6204544 6062516 142028 0 1451612 835384
-/+ buffers/cache: 3775520 2429024
Swap: 8008352 3212492 4795860
(postconf -n & master.cf follows)
I have two questions, and i think they may be related. I'm seeing
processes die while running a PHP script (sigh - yes) which sends out a
batch of about ~750 mails. (the package being used is Swift-2.1.12,
fwiw). It looks like it was set to run through too any addresses at a
time (100, with a 30sec sleep), which was perhaps bit too much. I'm
seeing lines in maillog like:
-- snip --
Sep 1 15:28:32 DOMAIN postfix/master[20450]: fatal: event_loop: select:
Cannot allocate memory
Sep 1 15:28:33 DOMAIN postfix/smtpd[12164]: connect from
unknown[nnn.nnn.nnn.nnn]
Sep 1 15:28:33 DOMAIN postfix/smtpd[12164]: fatal: select: Cannot
allocate memory
Sep 1 15:28:33 DOMAIN postfix/qmgr[5570]: fatal: qmgr_active_defer:
rename A030950E2DE from active to deferred: Cannot allocate memorySep 1
15:28:34 DOMAIN postfix/smtp[9265]: warning: premature end-of-input on
private/bounce socket while reading input attribute name
Sep 1 15:28:34 DOMAIN postfix/smtp[9184]: warning: premature
end-of-input on private/bounce socket while reading input attribute name
Sep 1 15:28:34 DOMAIN postfix/smtp[9268]: warning: premature
end-of-input on private/bounce socket while reading input attribute name
...
Sep 1 15:28:34 DOMAIN postfix/smtp[9268]: warning: premature
end-of-input on private/defer socket while reading input attribute name
Sep 1 15:28:34 DOMAIN postfix/smtp[9268]: warning: 194F050E2CB: defer
service failure
...
postfix/smtp[9260]: 25A9050E2D0: to=<[EMAIL PROTECTED]
hotmail.com>,
relay=mx3.hotmail.com[65.54.244.72], delay=91, status=sent (250
<20060901192728.25A9050E2D0
DOMAIN.org> Queued mail for delivery)
postfix/smtp[9260]: warning: connect #1 to subsystem private/scache:
Connection refused
postfix/smtpd[8992]: connect to subsystem private/rewrite: Connection
refused
postfix/smtpd[8992]: warning: connect #4 to subsystem private/rewrite:
Connection refused
...
postfix/smtp[9260]: fatal: connect #11 to subsystem private/scache:
Connection refused
postfix/smtp[9261]: 71C4650E2A0: to=<[EMAIL
PROTECTED]
cirquedusoleil.ca>,
relay=mx2.cirquedusoleil.com[204.101.137.135], delay=197, status=sent
(250 M2006090115300022790 Message accepted for delivery)
-- snip --
My first question is: is there something i could be doing for Postfix
(aside from lowering the number of addresses thrown at it at once from
PHP scripts)? I'll be frank: i'm very much new at dealing with MTAs.
I've had this Postfix/Cyrus IMAP setup running very nicely for a little
over year with no problems, though. But i'm really sure i could perhaps
optimise things a bit.
As for the last part above, i did man 8 scache, but i haven't been able
to figure out why the connection is being refused. google tels me to
ensure that the 'scache unix - - n - 1 scache' line is in master.cf,
and, indeed, it's there.
One page i found had this to say:
> Some possible causes are:
>
> 1. Recent changes to smtp_connection_cache_on_demand or
> lmtp_connection_cache_on_demand settings in main.cf
>
> 2. Overwritinng master.cf with an older file; or during an upgrade.
>
> 3. Executing an old /etc/postfix/postfix-install program, or running
> "postfix upgrade-configuration"
Unfortunately, that doesn't apply to me. The only recent change to
master.cf was the addition of a call to spamc.sh (for SA/Anomy, last
line in master.cf, below).
My second question is about some delivery failures i'm seeing. I can't
grok what the log is telling me. Why am i seeing failures from maps_find
when i'm trying to send to a remote address? Why is Postfix even looking
up the address there when i'm trying to deliver it elsewhere?
This seems bizarre to me, and i'm wondering if it has something to do
with the processes being killed. Several of the addresses affected
similarly had had mail sent out to them earlier with no problem. Around
10% of the mails from that batch failed in this way. The only address
that was local to the server also had repeated tries (the only one that
did so - all failed). The rest of theaddresses are remote.
The following maillog lines are for a single address. I'd really
appreciate it if somebody could explain to me what's happening here (and
why).
-- snip --
postfix/smtpd[8992]: < DOMAIN.org[127.0.0.1]: RCPT TO: <[EMAIL
PROTECTED]
gmail.com>
postfix/smtpd[8992]: extract_addr: input: <[EMAIL PROTECTED]
gmail.com>
postfix/smtpd[8992]: smtpd_check_addr: addr=[EMAIL PROTECTED]
gmail.com
postfix/smtpd[8992]: send attr address = [EMAIL PROTECTED]
gmail.com
postfix/smtpd[8992]: input attribute value: [EMAIL PROTECTED]
gmail.com
postfix/smtpd[8992]: rewrite_clnt: local: [EMAIL PROTECTED]
gmail.com ->
[EMAIL PROTECTED]
gmail.com
postfix/smtpd[8992]: send attr address = [EMAIL PROTECTED]
gmail.com
postfix/smtpd[8992]: input attribute value: gmail.com
postfix/smtpd[8992]: input attribute value: [EMAIL PROTECTED]
gmail.com
postfix/smtpd[8992]: resolve_clnt: `[EMAIL PROTECTED]
gmail.com' ->
transp=`smtp' host=`gmail.com' rcpt=`[EMAIL PROTECTED]
gmail.com' flags=
class=default
postfix/smtpd[8992]: ctable_locate: install entry key [EMAIL
PROTECTED]
gmail.com
postfix/smtpd[8992]: extract_addr: result: [EMAIL PROTECTED]
gmail.com
postfix/smtpd[8992]: ctable_locate: leave existing entry key [EMAIL
PROTECTED]
gmail.com
postfix/smtpd[8992]: maps_find: recipient_canonical_maps: [EMAIL
PROTECTED]
gmail.com: not found
postfix/smtpd[8992]: match_string: gmail.com ~? DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? localhost.DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? localhost
postfix/smtpd[8992]: match_string: gmail.com ~? DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? mail.DOMAIN.org
postfix/smtpd[8992]: match_list_match: gmail.com: no match
postfix/smtpd[8992]: maps_find: recipient_canonical_maps:
gmail.com:
not found
postfix/smtpd[8992]: mail_addr_find: [EMAIL PROTECTED]
gmail.com -> (not
found)
postfix/smtpd[8992]: maps_find: canonical_maps: [EMAIL
PROTECTED]
gmail.com: not found
postfix/smtpd[8992]: match_string: gmail.com ~? DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? localhost.DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? localhost
postfix/smtpd[8992]: match_string: gmail.com ~? DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? mail.DOMAIN.org
postfix/smtpd[8992]: match_list_match: gmail.com: no match
postfix/smtpd[8992]: maps_find: canonical_maps:
gmail.com: not found
postfix/smtpd[8992]: mail_addr_find: [EMAIL PROTECTED]
gmail.com -> (not
found)
postfix/smtpd[8992]: maps_find: virtual_alias_maps: [EMAIL
PROTECTED]
gmail.com: not found
postfix/smtpd[8992]: match_string: gmail.com ~? DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? localhost.DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? localhost
postfix/smtpd[8992]: match_string: gmail.com ~? DOMAIN.org
postfix/smtpd[8992]: match_string: gmail.com ~? mail.DOMAIN.org
postfix/smtpd[8992]: match_list_match: gmail.com: no match
postfix/smtpd[8992]: maps_find: virtual_alias_maps:
gmail.com: not found
postfix/smtpd[8992]: mail_addr_find: [EMAIL PROTECTED]
gmail.com -> (not
found)
-- snip --
# postconf -n
alias_database = hash:$config_directory/maps/aliases
alias_maps = hash:$config_directory/maps/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
debug_peer_list = 127.0.0.1
default_privs = nobody
disable_vrfy_command = yes
fallback_transport =
home_mailbox = Maildir/
html_directory = /usr/share/doc/postfix-2.2.5-documentation/html
in_flow_delay = 1s
inet_interfaces = all
local_recipient_maps = unix:passwd.byname $alias_maps
hash:$config_directory/maps/non-unix-accounts
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
mail.$mydomain
mydomain = DOMAIN.org
myhostname = $mydomain
mynetworks = 127.0.0.0/8
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
notify_classes = resource, software
owner_request_special = no
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.5-documentation/readme
recipient_delimiter = +
sample_directory = $config_directory
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname NO UCE ESMTP
smtpd_hard_error_limit = 3
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
check_client_access hash:$config_directory/maps/access,
check_recipient_access hash:$config_directory/maps/filtered_domains,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
reject_unauth_destination,
reject_non_fqdn_hostname,
reject_invalid_hostname,
reject_unauth_pipelining
smtpd_sasl_application_name = smtpd
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_timeout = 30s
smtpd_tls_CAfile = $config_directory/ssl/cacert.pem
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = $config_directory/ssl/smtpd-cert.pem
smtpd_tls_key_file = $config_directory/ssl/smtpd-req.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:$config_directory/maps/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:$config_directory/maps/virtual-alias-maps
virtual_gid_maps = static:5000
virtual_mailbox_domains = $config_directory/maps/virtual-mailbox-domains.txt
virtual_mailbox_maps = hash:$config_directory/maps/virtual-mailbox-maps
virtual_transport = lmtp:unix:/var/lib/imap/socket/lmtp
virtual_uid_maps = static:5000
# cat /etc/postfix/master.cf
==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_etrn_restrictions=reject
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - n - - smtpd
# -o smtpd_etrn_restrictions=reject
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
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
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error 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
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#cyrus unix - n n - - pipe
# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension}
${user}
#
cyrus-deliver unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m
${extension} $recipient
#
# See the Postfix UUCP_README file for configuration details.
#
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender -
$nexthop!rmail.postfix ($recipient)
#
# Other external delivery methods.
#
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop
$recipient
filter unix - n n - - pipe
flags=Rq user=filter argv=/usr/local/anomy/spamc.sh -f ${sender} --
${recipient}
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]