alias_maps error?

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

alias_maps error?

Alan Rubin

Hello,

I have a Solaris 9 server running Blastwave.org's Postfix 2.4.6,REV=2008.05.28.
I am trying to get Mailman (v2.1.10) working properly with this configuration.
Mailman seems to be working fine except for the automation of the list aliases
(creation, deletion, update).  The symptom is that no matter how alias_maps is
defined Postfix is only looking in the default aliases db (in this case,
/etc/opt/csw/postfix/aliases).  If I cut-and-paste the aliases to  the default
aliases file, mailman delivers mail correctly.  Otherwise, my logs show the
following error:

" 550 5.1.1 <[hidden email]>: Recipient address rejected: User unknown
in local recipient table; "

If I add a few v's to the postalias command in mailman's genalias script, I get
some odd results.

relevant lines from main.cf:

alias_maps = dbm:/etc/opt/csw/postfix/aliases,
        hash:/export/home/mailman/data/aliases

debug output:

postalias: dict_update: alias_maps = dbm:/etc/opt/csw/postfix/aliases,
?hash:/export/home/mailman/data/aliases
<snip>
postalias: open dbm /export/home/mailman/data/aliases
...

Note the "?hash" reference, and the attempt to open the file as a dbm at the
end.

Any help would be appreciated.

Regards,

Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

MrC-7
[hidden email] wrote:

> Hello,
>
> I have a Solaris 9 server running Blastwave.org's Postfix 2.4.6,REV=2008.05.28.
> I am trying to get Mailman (v2.1.10) working properly with this configuration.
> Mailman seems to be working fine except for the automation of the list aliases
> (creation, deletion, update).  The symptom is that no matter how alias_maps is
> defined Postfix is only looking in the default aliases db (in this case,
> /etc/opt/csw/postfix/aliases).  If I cut-and-paste the aliases to  the default
> aliases file, mailman delivers mail correctly.  Otherwise, my logs show the
> following error:

Are the db files getting created?

  ls /export/home/mailman/data/*.db

If not, check the permissions of the directories up to and including the
data directory.

>
> " 550 5.1.1 <[hidden email]>: Recipient address rejected: User unknown
> in local recipient table; "
>
> If I add a few v's to the postalias command in mailman's genalias script, I get
> some odd results.
>
> relevant lines from main.cf:
>
> alias_maps = dbm:/etc/opt/csw/postfix/aliases,
>         hash:/export/home/mailman/data/aliases
>
> debug output:
>
> postalias: dict_update: alias_maps = dbm:/etc/opt/csw/postfix/aliases,
> ?hash:/export/home/mailman/data/aliases
> <snip>
> postalias: open dbm /export/home/mailman/data/aliases
> ...
> Note the "?hash" reference, and the attempt to open the file as a dbm
> at the end.

Postalias has read all the main.cf params, and the ? is just the
non-printable newline.

Mailman will update its own alias file and virtual-mailman file.  From
Mailman/MTA/Postfix.py :

ALIASFILE = os.path.join(mm_cfg.DATA_DIR, 'aliases')
VIRTFILE = os.path.join(mm_cfg.DATA_DIR, 'virtual-mailman')

...

def _update_maps():
    msg = 'command failed: %s (status: %s, %s)'
    acmd = mm_cfg.POSTFIX_ALIAS_CMD + ' ' + ALIASFILE
    status = (os.system(acmd) >> 8) & 0xff
...
    if os.path.exists(VIRTFILE):
        vcmd = mm_cfg.POSTFIX_MAP_CMD + ' ' + VIRTFILE
        status = (os.system(vcmd) >> 8) & 0xff


So your Mailman/mm_cfg.py should include:

MTA = 'Postfix'
POSTFIX_ALIAS_CMD = '/path/to/postalias'
POSTFIX_MAP_CMD = '/path/to/postmap'

What do you have in your file?

MrC

>
>
> Any help would be appreciated.
>
> Regards,
> Alan Rubin
Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Alan Rubin
In reply to this post by Alan Rubin

Thanks for the comments.

Here are the current settings in mm_cfg.py:

###############################################
# Here's where we get the distributed defaults.

from Defaults import *

##################################################
# Put YOUR site-specific settings below this line.

DEFAULT_EMAIL_HOST = 'lists.nt.gov.au'
DEFAULT_URL_HOST = 'lists.nt.gov.au'

add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

DEFAULT_ARCHIVE = Off

DEFAULT_LIST_ADVERTISED = No

DEFAULT_MAX_MESSAGE_SIZE= 1000

MTA = 'Postfix'
POSTFIX_ALIAS_CMD = '/opt/csw/sbin/postalias -vvvv'
POSTFIX_MAP_CMD = '/opt/csw/sbin/postmap'
...

The physical server is called titree, but the A record is for lists.nt.gov.au,
thus the DEFAULT_*_HOST changes above.  The aliases.db file was created once,
but it was never updated by any of the automatic processes.  This circumstance
creates this error:

Jun  6 12:26:05 titree postfix/local[8012]: [ID 947731 mail.warning] warning:
database /export/home/mailman/data/aliases.db is older than source file
/export/home/mailman/data/aliases

When I updated aliases.db manually, that error went away while the two files
were still in sync, but the aliases database still wasn't used by postfix.
Since I've been running genaliases, the aliases file has been re-created, but
the aliases.db has not been updated so they no longer have the same timestamps.

Regards,

Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]


                                                                               
             MrC                                                                
             <lists-postfix@capp                                                
             ella.us>                                                        To
                                         [hidden email]              
             06/06/2008 03:39 PM                                             cc
                                         [hidden email]                  
                                                                        Subject
              Please respond to          Re: alias_maps error?                  
             lists-postfix@cappe                                                
                   lla.us                                                      
                                                                               
                                                                               
                                                                               
                                                                               




[hidden email] wrote:
> Hello,
>
> I have a Solaris 9 server running Blastwave.org's Postfix
2.4.6,REV=2008.05.28.
> I am trying to get Mailman (v2.1.10) working properly with this configuration.
> Mailman seems to be working fine except for the automation of the list aliases
> (creation, deletion, update).  The symptom is that no matter how alias_maps is
> defined Postfix is only looking in the default aliases db (in this case,
> /etc/opt/csw/postfix/aliases).  If I cut-and-paste the aliases to  the default
> aliases file, mailman delivers mail correctly.  Otherwise, my logs show the
> following error:

Are the db files getting created?

  ls /export/home/mailman/data/*.db

If not, check the permissions of the directories up to and including the
data directory.

>
> " 550 5.1.1 <[hidden email]>: Recipient address rejected: User
unknown
> in local recipient table; "
>
> If I add a few v's to the postalias command in mailman's genalias script, I
get

> some odd results.
>
> relevant lines from main.cf:
>
> alias_maps = dbm:/etc/opt/csw/postfix/aliases,
>         hash:/export/home/mailman/data/aliases
>
> debug output:
>
> postalias: dict_update: alias_maps = dbm:/etc/opt/csw/postfix/aliases,
> ?hash:/export/home/mailman/data/aliases
> <snip>
> postalias: open dbm /export/home/mailman/data/aliases
> ...
> Note the "?hash" reference, and the attempt to open the file as a dbm
> at the end.

Postalias has read all the main.cf params, and the ? is just the
non-printable newline.

Mailman will update its own alias file and virtual-mailman file.  From
Mailman/MTA/Postfix.py :

ALIASFILE = os.path.join(mm_cfg.DATA_DIR, 'aliases')
VIRTFILE = os.path.join(mm_cfg.DATA_DIR, 'virtual-mailman')

...

def _update_maps():
    msg = 'command failed: %s (status: %s, %s)'
    acmd = mm_cfg.POSTFIX_ALIAS_CMD + ' ' + ALIASFILE
    status = (os.system(acmd) >> 8) & 0xff
...
    if os.path.exists(VIRTFILE):
        vcmd = mm_cfg.POSTFIX_MAP_CMD + ' ' + VIRTFILE
        status = (os.system(vcmd) >> 8) & 0xff


So your Mailman/mm_cfg.py should include:

MTA = 'Postfix'
POSTFIX_ALIAS_CMD = '/path/to/postalias'
POSTFIX_MAP_CMD = '/path/to/postmap'

What do you have in your file?

MrC

>
>
> Any help would be appreciated.
>
> Regards,
> Alan Rubin


Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

MrC-7
[hidden email] wrote:

> Thanks for the comments.
>
> Here are the current settings in mm_cfg.py:
>
>
> DEFAULT_EMAIL_HOST = 'lists.nt.gov.au'
> DEFAULT_URL_HOST = 'lists.nt.gov.au'
>
> add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
>
> DEFAULT_ARCHIVE = Off
>
> DEFAULT_LIST_ADVERTISED = No
>
> DEFAULT_MAX_MESSAGE_SIZE= 1000
>
> MTA = 'Postfix'
> POSTFIX_ALIAS_CMD = '/opt/csw/sbin/postalias -vvvv'
> POSTFIX_MAP_CMD = '/opt/csw/sbin/postmap'
> ...
>
> The physical server is called titree, but the A record is for lists.nt.gov.au,
> thus the DEFAULT_*_HOST changes above.  The aliases.db file was created once,
> but it was never updated by any of the automatic processes.  This circumstance
> creates this error:
>
> Jun  6 12:26:05 titree postfix/local[8012]: [ID 947731 mail.warning] warning:
> database /export/home/mailman/data/aliases.db is older than source file
> /export/home/mailman/data/aliases

This means the text file was updated, but the db file is old and hasn't
be rebuilt.  This indicates newaliases/postaliases hasn't be run, or
hasn't been run on the desired file.

>
> When I updated aliases.db manually, that error went away while the two files
> were still in sync, but the aliases database still wasn't used by postfix.


Do you have a chroot environment ?

Show postconf -n output, and master.cf file.

> Since I've been running genaliases, the aliases file has been re-created, but
> the aliases.db has not been updated so they no longer have the same timestamps.
>

See also:
http://www.gnu.org/software/mailman/mailman-install/node13.html

Have you verified permissions/ownership?

MrC
Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

mouss-2
In reply to this post by Alan Rubin
[hidden email] wrote:

> Hello,
>
> I have a Solaris 9 server running Blastwave.org's Postfix 2.4.6,REV=2008.05.28.
> I am trying to get Mailman (v2.1.10) working properly with this configuration.
> Mailman seems to be working fine except for the automation of the list aliases
> (creation, deletion, update).  The symptom is that no matter how alias_maps is
> defined Postfix is only looking in the default aliases db (in this case,
> /etc/opt/csw/postfix/aliases).  If I cut-and-paste the aliases to  the default
> aliases file, mailman delivers mail correctly.  Otherwise, my logs show the
> following error:
>
> " 550 5.1.1 <[hidden email]>: Recipient address rejected: User unknown
> in local recipient table; "
>
> If I add a few v's to the postalias command in mailman's genalias script, I get
> some odd results.
>
> relevant lines from main.cf:
>
> alias_maps = dbm:/etc/opt/csw/postfix/aliases,
>         hash:/export/home/mailman/data/aliases
>
> debug output:
>
> postalias: dict_update: alias_maps = dbm:/etc/opt/csw/postfix/aliases,
> ?hash:/export/home/mailman/data/aliases
> <snip>
> postalias: open dbm /export/home/mailman/data/aliases
> ...
>
> Note the "?hash" reference, and the attempt to open the file as a dbm at the
> end.
>  

looks like there is a bad character there (shown as '?').

try
# postconf -e
alias_maps=dbm:/etc/opt/csw/postfix/aliases,hash:/export/home/mailman/data/aliases

Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

MrC-7


mouss wrote:
> [hidden email] wrote:

>> postalias: dict_update: alias_maps = dbm:/etc/opt/csw/postfix/aliases,
>> ?hash:/export/home/mailman/data/aliases
>> <snip>
>> postalias: open dbm /export/home/mailman/data/aliases
>> ...
>>
>> Note the "?hash" reference, and the attempt to open the file as a dbm
>> at the
>> end.
>>  
>
> looks like there is a bad character there (shown as '?').

Hmmm, could be.  Hard to tell from the output.  For me:

alias_maps = hash:/usr/pkg/etc/postfix/aliases
        hash:/var/mailman/data/aliases

yields:

postalias: dict_update: virtual_alias_maps =
pcre:/usr/pkg/etc/postfix/virtual.pcre?hash:/var/mailman/data/virtual-mailman

and

alias_maps = hash:/usr/pkg/etc/postfix/aliases,
        hash:/var/mailman/data/aliases

yields:

postalias: dict_update: alias_maps =
hash:/usr/pkg/etc/postfix/aliases,?hash:/var/mailman/data/aliases

What we can't tell what did the line wrap above.

But postalias requires a file name, and an optional file type, so this
this seems like postalias either a) wasn't given the correct file type,
or b) no file type was given and the OPs system has
default_database_type = dbm.

>
> try
> # postconf -e
> alias_maps=dbm:/etc/opt/csw/postfix/aliases,hash:/export/home/mailman/data/aliases
>
>
Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Alan Rubin
In reply to this post by MrC-7
Hello,

Thanks for the continuing help.

This is not a chroot'ed environment.

Here's the result of "postconf -n":

# postconf -n
alias_database = dbm:/etc/opt/csw/postfix/aliases
alias_maps = dbm:/etc/opt/csw/postfix/aliases,
hash:/export/home/mailman/data/aliases
command_directory = /opt/csw/sbin
config_directory = /etc/opt/csw/postfix
daemon_directory = /opt/csw/libexec/postfix
debug_peer_level = 2
default_privs = mailman
html_directory = /opt/csw/share/doc/postfix/html
mail_owner = postfix
mailq_path = /opt/csw/bin/mailq
manpage_directory = /opt/csw/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
lists.nt.gov.au
myorigin = titree.nt.gov.au
newaliases_path = /opt/csw/bin/newaliases
queue_directory = /opt/csw/var/spool/postfix
readme_directory = /opt/csw/share/doc/postfix/README_FILES
relayhost = [155.205.6.45]
sample_directory = /opt/csw/share/doc/postfix/samples
sendmail_path = /opt/csw/sbin/sendmail
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
...

And here's the master.cf file:

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ==========================================================================
# 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_enforce_tls=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps     inet  n       -       n       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#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
retry     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
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
#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}
#
# ====================================================================
#
# 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
($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=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop
$recipient
#
#scalemail-backend unix -       n       n       -       2       pipe
#  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
#  ${nexthop} ${user} ${extension}
#
#mailman   unix  -       n       n       -       -       pipe
#  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
#  ${nexthop} ${user}
...

I've run the fix permissions tool with mailman and there doesn't seem to be any
issues.

This being a Solaris box, it was running sendmail when I initially installed
Mailman.  Is there any way to correct installation steps if they were done out
of order/changed between MTA configurations?

Regards,

Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]


                                                                               
             MrC                                                                
             <lists-postfix@capp                                                
             ella.us>                                                        To
             Sent by:                    [hidden email]                  
             owner-postfix-users                                             cc
             @postfix.org                [hidden email]              
                                                                        Subject
                                         Re: alias_maps error?                  
             07/06/2008 04:23 AM                                                
                                                                               
                                                                               
              Please respond to                                                
             lists-postfix@cappe                                                
                   lla.us                                                      
                                                                               
                                                                               




[hidden email] wrote:

> Thanks for the comments.
>
> Here are the current settings in mm_cfg.py:
>
>
> DEFAULT_EMAIL_HOST = 'lists.nt.gov.au'
> DEFAULT_URL_HOST = 'lists.nt.gov.au'
>
> add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
>
> DEFAULT_ARCHIVE = Off
>
> DEFAULT_LIST_ADVERTISED = No
>
> DEFAULT_MAX_MESSAGE_SIZE= 1000
>
> MTA = 'Postfix'
> POSTFIX_ALIAS_CMD = '/opt/csw/sbin/postalias -vvvv'
> POSTFIX_MAP_CMD = '/opt/csw/sbin/postmap'
> ...
>
> The physical server is called titree, but the A record is for lists.nt.gov.au,
> thus the DEFAULT_*_HOST changes above.  The aliases.db file was created once,
> but it was never updated by any of the automatic processes.  This circumstance
> creates this error:
>
> Jun  6 12:26:05 titree postfix/local[8012]: [ID 947731 mail.warning] warning:
> database /export/home/mailman/data/aliases.db is older than source file
> /export/home/mailman/data/aliases

This means the text file was updated, but the db file is old and hasn't
be rebuilt.  This indicates newaliases/postaliases hasn't be run, or
hasn't been run on the desired file.

>
> When I updated aliases.db manually, that error went away while the two files
> were still in sync, but the aliases database still wasn't used by postfix.


Do you have a chroot environment ?

Show postconf -n output, and master.cf file.

> Since I've been running genaliases, the aliases file has been re-created, but
> the aliases.db has not been updated so they no longer have the same
timestamps.
>

See also:
http://www.gnu.org/software/mailman/mailman-install/node13.html

Have you verified permissions/ownership?

MrC


Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

mouss-2
In reply to this post by Alan Rubin
[hidden email] wrote:

> Hello,
>
> I have a Solaris 9 server running Blastwave.org's Postfix 2.4.6,REV=2008.05.28.
> I am trying to get Mailman (v2.1.10) working properly with this configuration.
> Mailman seems to be working fine except for the automation of the list aliases
> (creation, deletion, update).  The symptom is that no matter how alias_maps is
> defined Postfix is only looking in the default aliases db (in this case,
> /etc/opt/csw/postfix/aliases).  If I cut-and-paste the aliases to  the default
> aliases file, mailman delivers mail correctly.  Otherwise, my logs show the
> following error:
>
> " 550 5.1.1 <[hidden email]>: Recipient address rejected: User unknown
> in local recipient table; "
>
> If I add a few v's to the postalias command in mailman's genalias script, I get
> some odd results.
>
> relevant lines from main.cf:
>
> alias_maps = dbm:/etc/opt/csw/postfix/aliases,
>         hash:/export/home/mailman/data/aliases
>
> debug output:
>
> postalias: dict_update: alias_maps = dbm:/etc/opt/csw/postfix/aliases,
> ?hash:/export/home/mailman/data/aliases
> <snip>
> postalias: open dbm /export/home/mailman/data/aliases
> ...
>  

BTW,  what command did you type to get the error above?

and what is the output of
# postconf -m



> Note the "?hash" reference, and the attempt to open the file as a dbm at the
> end.
>
> Any help would be appreciated.
>
> Regards,
>
> Alan Rubin
> Technician Unix
> DCS Midrange Services
> Phone: +61 (08) 8999 6814
> Fax:      +61 (08) 8999 7493
> e-Mail: [hidden email]
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Alan Rubin
In reply to this post by Alan Rubin
Mouss,

Strange behavior.  Running the command by hand did allow for a newly created
list to function; however, I then deleted the list using the mailman rmlist
program, which removes the alias entries from the mailman aliases file and runs
postalias again, but am still able to send mail to this ghost of a list.
Postfix and mailman seem to be out of sync.  I even manually restarted postfix
but this list is still working.  Without any functioning aliases!

Regards,

Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]


                                                                               
             mouss                                                              
             <[hidden email]>                                                
                                                                             To
             11/06/2008 05:11 AM         [hidden email]                  
                                                                             cc
                                                                               
                                                                        Subject
                                         Re: alias_maps error?                  
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               




[hidden email] wrote:
> I added several v's to the postalias command configured in mailman's mm_cfg.py
> file, and I saved the output from running the genaliases script.
>
>

try manually running postalias:

# postalias dbm:/etc/opt/csw/postfix/aliases
# postalias hash:/export/home/mailman/data/aliases





Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

mouss-2
[hidden email] wrote:
> Mouss,
>
> Strange behavior.  Running the command by hand did allow for a newly created
> list to function; however, I then deleted the list using the mailman rmlist
> program, which removes the alias entries from the mailman aliases file and runs
> postalias again, but am still able to send mail to this ghost of a list.
> Postfix and mailman seem to be out of sync.  I even manually restarted postfix
> but this list is still working.  Without any functioning aliases!
>  

retry the commands (manually) and see if you can still send.


my guess is that the script that calls postalias is broken.

Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Alan Rubin
Nope,  the list is still working even though I've re-run those postalias
commands and there are no aliases listed in /export/home/mailman/data/aliases.

Regards,

Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]


                                                                               
             mouss                                                              
             <[hidden email]>                                                
             Sent by:                                                        To
             owner-postfix-users                                                
             @postfix.org                                                    cc
                                         [hidden email]              
                                                                        Subject
             11/06/2008 08:16 AM         Re: alias_maps error?                  
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               




[hidden email] wrote:
> Mouss,
>
> Strange behavior.  Running the command by hand did allow for a newly created
> list to function; however, I then deleted the list using the mailman rmlist
> program, which removes the alias entries from the mailman aliases file and
runs
> postalias again, but am still able to send mail to this ghost of a list.
> Postfix and mailman seem to be out of sync.  I even manually restarted postfix
> but this list is still working.  Without any functioning aliases!
>

retry the commands (manually) and see if you can still send.


my guess is that the script that calls postalias is broken.



Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

mouss-2
[hidden email] wrote:
> Nope,  the list is still working even though I've re-run those postalias
> commands and there are no aliases listed in /export/home/mailman/data/aliases.
>  

if postfix accepts mail to addresses that do not exist, then you have an
error in your config.

- show output of 'postconf -n'
- relevant logs (that show postfix accepting mail)
- output of postmap -q to prove that the addresses are nt found in your maps



Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Wietse Venema
In reply to this post by Alan Rubin
[hidden email]:
> Nope,  the list is still working even though I've re-run those postalias
> commands and there are no aliases listed in /export/home/mailman/data/aliases.

What isw the output of:

        postmap -s /export/home/mailman/data/aliases

This dumps the aliases.db file.

Any stuff in there that should not be? If so, then your aliases
update procedure is broken. Most likely it runs as the wrong
UID and perhaps you did all your testing as root.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Alan Rubin
In reply to this post by mouss-2
Hello,

First,  I have found 'human error'.  I don't mind human error since it is
usually correctable.  In this case, I was replying to old messages on this test
list and hadn't realized that the replies were going straight to the sender,
myself, and not the list.  D'oh! Unfortunately, while the idea of the 'ghost
list' appears to have been a figment of my imagination, I am still having the
same issues that I started with:  newly created lists are not working even when
aliases exist in /export/home/mailman/data/aliases.  I can get them to work by
manually running "postalias hash:/export/home/mailman/data/aliases", but this is
not ideal.

As before, the output from the postalias command run within genaliases, and when
a new list is created from the command line,  indicates that the mailman aliases
file is loading as a dbm and not a hash - which is probably why things are not
working correctly.

Here is 'postconf -n':

# postconf -n
alias_database = dbm:/etc/opt/csw/postfix/aliases
alias_maps = dbm:/etc/opt/csw/postfix/aliases,
hash:/export/home/mailman/data/aliases
command_directory = /opt/csw/sbin
config_directory = /etc/opt/csw/postfix
daemon_directory = /opt/csw/libexec/postfix
debug_peer_level = 2
default_privs = mailman
html_directory = /opt/csw/share/doc/postfix/html
mail_owner = postfix
mailq_path = /opt/csw/bin/mailq
manpage_directory = /opt/csw/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
lists.nt.gov.au
myorigin = titree.nt.gov.au
newaliases_path = /opt/csw/bin/newaliases
queue_directory = /opt/csw/var/spool/postfix
readme_directory = /opt/csw/share/doc/postfix/README_FILES
relayhost = [155.205.6.45]
sample_directory = /opt/csw/share/doc/postfix/samples
sendmail_path = /opt/csw/sbin/sendmail
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
...

Here is the debug information from genaliases:

postalias: open dbm /export/home/mailman/data/aliases
...

Here is a copy of the Delivery Failure message:

                                                                               
 Your        re-created list again..                                            
 document:                                                                      
                                                                               
             [hidden email]                                          
                                                                               
                                                                               
             host 150.191.67.11[150.191.67.11] said: 550 5.1.1                  
             <[hidden email]>: Recipient address rejected: User      
             unknown in   local recipient table (in reply to RCPT TO command)  
                                                                               




...



Everything seems to hinge on /export/home/mailman/data/aliases.db.  I deleted
and re-created the list after a successful creation (success reached after
running postalias by hand) and the list remained successful.  I deleted the list
and ran the postalias command by hand again.  After re-creating the list, the
list has failed as I have not re-run postalias by hand again.


Sorry for the confusion, and thanks for the continuing assistance.

Regards,


Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]


                                                                               
             mouss                                                              
             <[hidden email]>                                                
             Sent by:                                                        To
             owner-postfix-users                                                
             @postfix.org                                                    cc
                                         [hidden email]              
                                                                        Subject
             11/06/2008 08:40 AM         Re: alias_maps error?                  
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               




[hidden email] wrote:
> Nope,  the list is still working even though I've re-run those postalias
> commands and there are no aliases listed in /export/home/mailman/data/aliases.
>

if postfix accepts mail to addresses that do not exist, then you have an
error in your config.

- show output of 'postconf -n'
- relevant logs (that show postfix accepting mail)
- output of postmap -q to prove that the addresses are nt found in your maps





Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Wietse Venema
[hidden email]:

> Hello,
>
> First,  I have found 'human error'.  I don't mind human error since it is
> usually correctable.  In this case, I was replying to old messages on this test
> list and hadn't realized that the replies were going straight to the sender,
> myself, and not the list.  D'oh! Unfortunately, while the idea of the 'ghost
> list' appears to have been a figment of my imagination, I am still having the
> same issues that I started with:  newly created lists are not working even when
> aliases exist in /export/home/mailman/data/aliases.  I can get them to work by
> manually running "postalias hash:/export/home/mailman/data/aliases", but this is
> not ideal.

What is the exact postfix command that is executed by mailman?

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Alan Rubin
This will require some deconstruction of mailman,so bear with me.

Looking at the 'newlist' code:

    # Now do the MTA-specific list creation tasks
    if mm_cfg.MTA:
        modname = 'Mailman.MTA.' + mm_cfg.MTA
        __import__(modname)
        sys.modules[modname].create(mlist)
...

The mm_cfg.MTA in this case being set to Postfix.  This means that the program
calls the Postfix module.


I don't know very much about python, but I think these are the relevant code
blocks:

def create(mlist, cgi=False, nolock=False, quiet=False):
    # Acquire the global list database lock.  quiet flag is ignored.
    lock = None
    if not nolock:
        lock = makelock()
        lock.lock()
    # Do the aliases file, which need to be done in any case
    try:
        _do_create(mlist, ALIASFILE, _addlist)
        if mlist and mlist.host_name in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS:
            _do_create(mlist, VIRTFILE, _addvirtual)
        _update_maps()
    finally:
        if lock:
            lock.unlock(unconditionally=True)
....

and "_update_maps" is defined here:

def _update_maps():
    msg = 'command failed: %s (status: %s, %s)'
    acmd = mm_cfg.POSTFIX_ALIAS_CMD + ' ' + ALIASFILE
    status = (os.system(acmd) >> 8) & 0xff
    if status:
        errstr = os.strerror(status)
        syslog('error', msg, acmd, status, errstr)
        raise RuntimeError, msg % (acmd, status, errstr)
    if os.path.exists(VIRTFILE):
        vcmd = mm_cfg.POSTFIX_MAP_CMD + ' ' + VIRTFILE
        status = (os.system(vcmd) >> 8) & 0xff
        if status:
            errstr = os.strerror(status)
            syslog('error', msg, vcmd, status, errstr)
            raise RuntimeError, msg % (vcmd, status, errstr)
...

"mm_cfg.POSTFIX_ALIAS_CMD" is set to to /opt/csw/sbin/postalias (-vvvv).

Just for further detail, here is the "_do_create" code block:

def _do_create(mlist, textfile, func):
    # Crack open the plain text file
    try:
        fp = open(textfile, 'r+')
    except IOError, e:
        if e.errno <> errno.ENOENT: raise
        omask = os.umask(007)
        try:
            fp = open(textfile, 'w+')
        finally:
            os.umask(omask)
    try:
        func(mlist, fp)
    finally:
        fp.close()
    # Now double check the virtual plain text file
    if func is _addvirtual:
        _check_for_virtual_loopaddr(mlist, textfile)
...

The genaliases program also calls this module.

Regards,

Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]



                                                                               
             [hidden email]                                                
             g (Wietse Venema)                                                  
             Sent by:                                                        To
             owner-postfix-users         Postfix users                          
             @postfix.org                <[hidden email]>            
                                                                             cc
                                                                               
             11/06/2008 09:40 AM                                        Subject
                                         Re: alias_maps error?                  
                                                                               
              Please respond to                                                
                Postfix users                                                  
             <postfix-users@post                                                
                  fix.org>                                                      
                                                                               
                                                                               




[hidden email]:
> Hello,
>
> First,  I have found 'human error'.  I don't mind human error since it is
> usually correctable.  In this case, I was replying to old messages on this
test
> list and hadn't realized that the replies were going straight to the sender,
> myself, and not the list.  D'oh! Unfortunately, while the idea of the 'ghost
> list' appears to have been a figment of my imagination, I am still having the
> same issues that I started with:  newly created lists are not working even
when
> aliases exist in /export/home/mailman/data/aliases.  I can get them to work by
> manually running "postalias hash:/export/home/mailman/data/aliases", but this
is
> not ideal.

What is the exact postfix command that is executed by mailman?

             Wietse


Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Wietse Venema
[hidden email]:

> def _update_maps():
>     msg = 'command failed: %s (status: %s, %s)'
>     acmd = mm_cfg.POSTFIX_ALIAS_CMD + ' ' + ALIASFILE
>     status = (os.system(acmd) >> 8) & 0xff
>     if status:
>         errstr = os.strerror(status)
>         syslog('error', msg, acmd, status, errstr)
>         raise RuntimeError, msg % (acmd, status, errstr)
>     if os.path.exists(VIRTFILE):
>         vcmd = mm_cfg.POSTFIX_MAP_CMD + ' ' + VIRTFILE
>         status = (os.system(vcmd) >> 8) & 0xff
>         if status:
>             errstr = os.strerror(status)
>             syslog('error', msg, vcmd, status, errstr)
>             raise RuntimeError, msg % (vcmd, status, errstr)
> ...
>
> "mm_cfg.POSTFIX_ALIAS_CMD" is set to to /opt/csw/sbin/postalias (-vvvv).

What is the output of:

$ postconf default_database_type

This determines whether postalias creates a hash or dbm file.

You can change this by editing the postalias command line to
include the file type. For example: "postalias dbm:/file/name"
to create a DBM file.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Alan Rubin
Wietse,

It seemed simpler to change the configuration setting of postfix rather than
experiment with the code/functionality of mailman.  I changed the setting,
default_database_type, from dbm to hash (for the record, the value was dbm to
start with).  Mailman seems to be working as expected now!  A simple test of the
default aliases file (/etc/opt/csw/postfix/aliases) seems to show it is still
working too.  When I run newaliases, the aliases.dir and aliases.pag file
timestamps correspond with the execution time.  Still, I must ask: will changing
that setting possibly confuse postfix?

Also, since the aliases file for mailman was defined as
"hash:/export/home/mailman/data/aliases" is there some reason, other than a bug,
why the prefix, "hash:" was being ignored and postalias was trying to open the
file as a dbm?

Thanks,

Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]


                                                                               
             [hidden email]                                                
             g (Wietse Venema)                                                  
             Sent by:                                                        To
             owner-postfix-users         [hidden email]                  
             @postfix.org                                                    cc
                                         Postfix users                          
                                         <[hidden email]>            
             11/06/2008 10:28 AM                                        Subject
                                         Re: alias_maps error?                  
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               




[hidden email]:

> def _update_maps():
>     msg = 'command failed: %s (status: %s, %s)'
>     acmd = mm_cfg.POSTFIX_ALIAS_CMD + ' ' + ALIASFILE
>     status = (os.system(acmd) >> 8) & 0xff
>     if status:
>         errstr = os.strerror(status)
>         syslog('error', msg, acmd, status, errstr)
>         raise RuntimeError, msg % (acmd, status, errstr)
>     if os.path.exists(VIRTFILE):
>         vcmd = mm_cfg.POSTFIX_MAP_CMD + ' ' + VIRTFILE
>         status = (os.system(vcmd) >> 8) & 0xff
>         if status:
>             errstr = os.strerror(status)
>             syslog('error', msg, vcmd, status, errstr)
>             raise RuntimeError, msg % (vcmd, status, errstr)
> ...
>
> "mm_cfg.POSTFIX_ALIAS_CMD" is set to to /opt/csw/sbin/postalias (-vvvv).

What is the output of:

$ postconf default_database_type

This determines whether postalias creates a hash or dbm file.

You can change this by editing the postalias command line to
include the file type. For example: "postalias dbm:/file/name"
to create a DBM file.

             Wietse


Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

mouss-2
[hidden email] wrote:

> Wietse,
>
> It seemed simpler to change the configuration setting of postfix rather than
> experiment with the code/functionality of mailman.  I changed the setting,
> default_database_type, from dbm to hash (for the record, the value was dbm to
> start with).  Mailman seems to be working as expected now!  A simple test of the
> default aliases file (/etc/opt/csw/postfix/aliases) seems to show it is still
> working too.  When I run newaliases, the aliases.dir and aliases.pag file
> timestamps correspond with the execution time.  Still, I must ask: will changing
> that setting possibly confuse postfix?
>  

postfix doesn't care as long as the map type is supported.
> Also, since the aliases file for mailman was defined as
> "hash:/export/home/mailman/data/aliases" is there some reason, other than a bug,
> why the prefix, "hash:" was being ignored and postalias was trying to open the
> file as a dbm?
>  

since you had no problem running postalias manually, the bug is in the
mailman script that calls postalias.
Reply | Threaded
Open this post in threaded view
|

Re: alias_maps error?

Alan Rubin
Mouss,

Thanks for your comments.  It now dawns on me that the volume of information I
was viewing from the postalias command at such a high level of verbosity was
throwing me off the trail.  Where it was writing out
"hash:/export/home/mailman/data/aliases", postalias was merely parsing through
the postfix configuration file.  It is only in the last few lines, where it said
"open dbm /export/home/mailman/data/aliases", where it is actually doing any
work, and, as you (and Wietse implied) say, mailman was only telling it to do
"postalias /export/home/mailman/data/aliases" AND NOT "postalias
hash:/export/home/mailman/data/aliases".  This is where changing the default
setting comes into play.  If this does not affect the default aliases file I
think I will just keep the postfix configuration change of default_database_type
than trying to alter mailman code since I do not know how to program in python,
and would lose changes with mailman upgrades anyways.

Regards,

Alan Rubin
Technician Unix
DCS Midrange Services
Phone: +61 (08) 8999 6814
Fax:      +61 (08) 8999 7493
e-Mail: [hidden email]


                                                                               
             mouss                                                              
             <[hidden email]>                                                
             Sent by:                                                        To
             owner-postfix-users                                                
             @postfix.org                                                    cc
                                         Postfix users                          
                                         <[hidden email]>            
             11/06/2008 11:09 AM                                        Subject
                                         Re: alias_maps error?                  
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               




[hidden email] wrote:
> Wietse,
>
> It seemed simpler to change the configuration setting of postfix rather than
> experiment with the code/functionality of mailman.  I changed the setting,
> default_database_type, from dbm to hash (for the record, the value was dbm to
> start with).  Mailman seems to be working as expected now!  A simple test of
the
> default aliases file (/etc/opt/csw/postfix/aliases) seems to show it is still
> working too.  When I run newaliases, the aliases.dir and aliases.pag file
> timestamps correspond with the execution time.  Still, I must ask: will
changing
> that setting possibly confuse postfix?
>

postfix doesn't care as long as the map type is supported.
> Also, since the aliases file for mailman was defined as
> "hash:/export/home/mailman/data/aliases" is there some reason, other than a
bug,
> why the prefix, "hash:" was being ignored and postalias was trying to open the
> file as a dbm?
>

since you had no problem running postalias manually, the bug is in the
mailman script that calls postalias.


12