OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Local aliases problem?

From: Peter Serwe (peter.serwegmail.com)
Date: Thu May 01 2008 - 17:53:49 CDT


I've recently converted a sendmail outbound relay and backup MX box to postfix,
and while I have a bit of experience with qmail, exim, sendmail, and a
few other MTA's,
postfix is being somewhat elusive for this one particular issue.

I send mail to the localhost from various cron'd applications that
need to report status
and send the mail out to a small distribution list. In the sendmail
world, I used /etc/aliases
to accomplish this and it worked fairly smoothly.

Now, however, I have sendmail complaining that those aliases loop back
to itself, and
refuses to parse the aliases and distribute the mail to the
recipients. It seems like it's
not actually parsing /etc/aliases at all, and I've tried every means I
could figure out to
make it perform this behavior.

Towards that end, I configured my /etc/postfix/main.cf thusly:

# ALIAS DATABASE
#
# The alias_maps parameter specifies the list of alias databases used
# by the local delivery agent. The default list is system dependent.
#
# On systems with NIS, the default is to search the local alias
# database, then the NIS alias database. See aliases(5) for syntax
# details.
#
# If you change the alias database, run "postalias /etc/aliases" (or
# wherever your system stores the mail alias file), or simply run
# "newaliases" to build the necessary DBM or DB file.
#
# It will take a minute or so before changes become visible. Use
# "postfix reload" to eliminate the delay.
#
#alias_maps = dbm:/etc/aliases
alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases

# The alias_database parameter specifies the alias database(s) that
# are built with "newaliases" or "sendmail -bi". This is a separate
# configuration parameter, because alias_maps (see above) may specify
# tables that are not necessarily all under control by Postfix.
#
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases

And have run postalias innumerable times, still without the result I'm
expecting.

Instead, I get these messages which I'm assuming indicates correct behavior
on the part of postfix according to the way I'm unfortunately configured:

May 1 15:31:16 testbed sendmail[2224]: m41MVGfD002224: from=rancid,
size=258, class=-60, nrcpts=1,
msgid=<200805012231.m41MVGfD002224testbed.my.domain>,
relay=rancidlocalhost
May 1 15:31:16 testbed postfix/smtpd[1967]: connect from
localhost.localdomain[127.0.0.1]
May 1 15:31:16 testbed postfix/smtpd[1967]: D6D92CA0034:
client=localhost.localdomain[127.0.0.1]
May 1 15:31:16 testbed postfix/cleanup[2228]: D6D92CA0034:
message-id=<200805012231.m41MVGfD002224testbed.my.domaint>
May 1 15:31:16 testbed sendmail[2224]: m41MVGfD002224:
to=rancid-admin-cpe, ctladdr=rancid (200/500), delay=00:00:00,
xdelay=00:00:00, mailer=relay, pri=138258, relay=[127.0.0.1]
[127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as D6D92CA0034)
May 1 15:31:16 testbed postfix/qmgr[3071]: D6D92CA0034:
from=<rancidtestbed.my.domain>, size=790, nrcpt=1 (queue active)
May 1 15:31:16 testbed postfix/smtpd[1967]: disconnect from
localhost.localdomain[127.0.0.1]
May 1 15:31:16 testbed postfix/smtp[2229]: D6D92CA0034:
to=<rancid-admin-cpetestbed.my.domain>, relay=none, delay=0,
status=bounced (mail for testbed.my.domain loops back to myself)
May 1 15:31:16 testbed postfix/cleanup[2228]: F2789714001:
message-id=<20080501223116.F2789714001mx2.my.otherdomain>
May 1 15:31:16 testbed postfix/qmgr[3071]: F2789714001: from=<>,
size=2581, nrcpt=1 (queue active)
May 1 15:31:17 testbed postfix/qmgr[3071]: D6D92CA0034: removed
May 1 15:31:17 testbed postfix/smtp[2229]: F2789714001:
to=<rancidtestbed.my.domain>, relay=none, delay=1, status=bounced
(mail for testbed.my.domain loops back to myself)
May 1 15:31:17 testbed postfix/qmgr[3071]: F2789714001: removed

Postfix is performing flawlessly in it's roles as a backup MX and a
local relay for hosts here on my networks,
just not for this seemingly trivial, yet important local alias-style
distribution list functionality.

Peter

--
$B%T!<%?!<(B