[Mailman-Users] Postfix, Dovecot LDA and Mailman

Niklaas Baudet von Gersdorff niklaas at kulturflatrate.net
Thu Oct 17 11:33:18 CEST 2013


Hi,

I'm a bit frustrated 'cause I want to setup mailman on our system which
runs on postfix using dovecot as the delivery agent. Mailbox accounts
(with password databse) are managed by dovecot. I'm not using MySQL
or any other database for user management 'cause we're not dealing
with lot's of users and I want to try to keep it short and simple. The
problem I have is dovecot complaining that (in this example) the user
mailman-request at lists.aplusr.at does not exist after postfix rewriting
mailman at lists.aplusr.at to mailman at aplusr.at . I guess that somehow my
alias setup does not work at all and I have to set something not to make
dovecot try to deliver the message to a user rather than delivering it
to mailman. Logs and more explanation follow.

uname -a

      Linux aplusr.at 2.6.32-028stab092.1 #1 SMP Wed Jul 20 19:47:12 MSD 
      2011 x86_64 GNU/Linux

/var/log/mail.log

      Oct 17 11:05:39 aplusr postfix/pipe[19995]:
      807A0161C868F: to=<mailman-request at aplusr.at>,
      orig_to=<mailman-request at lists.aplusr.at>, relay=dovecot,
      delay=0.05, delays=0.02/0.01/0/0.02, dsn=5.1.1, status=bounced (user
      unknown)

/etc/postfix/main.cf

      
      # see /usr/share/postfix/main.cf.dist for a commented, more complete 
      # version

      # maintenance mode?
      #soft_bounce                         = yes

      mydomain                            = aplusr.at
      myorigin                            = $mydomain
      myhostname                          = mail.aplusr.at
      mydestination                       = localhost
      relay_domains                       = $mydestination

      smtpd_banner                        = $myhostname esmtp $mail_name
      biff                                = no

      append_dot_mydomain                 = no

      readme_directory                    = no
      mynetworks_style                    = host

      recipient_delimiter                 = +

      # this file is used for delivering local mail to external addresses
      # e.g. for delivering cron job logs etc pp
      canonical_maps                      = hash:/etc/postfix/canonical

      virtual_transport                   = dovecot
      dovecot_destination_recipient_limit = 1

      virtual_mailbox_domains             = aplusr.at
      virtual_mailbox_maps                = hash:/etc/postfix/virtual/mailbox_maps
                                            hash:/etc/postfix/virtual/mailbox_maps

      virtual_alias_domains               = lists.aplusr.at
      virtual_alias_maps                  = hash:/var/lib/mailman/data/virtual-mailman

      #transport_maps                      = hash:/var/lib/mailman/data/transport-mailman
      alias_maps                          = hash:/var/lib/mailman/data/aliases
      alias_database                      = $alias_maps

      unknown_local_recipient_reject_code = 550

      # makes postfix use the authentication methods provided by dovecot to
      # authenticate client connect the server to send mail
      smtpd_sasl_auth_enable              = yes
      smtpd_sasl_type                     = dovecot
      smtpd_sasl_path                     = private/auth

      # makes postfix just accepts specific connections not beeing an open relay
      smtpd_recipient_restrictions        = permit_mynetworks
                                            permit_sasl_authenticated
                                            reject_unauth_destination
      smtpd_tls_auth_only                 = yes
      broken_sasl_auth_clients            = yes

      smtp_tls_session_cache_database     = btree:/var/lib/postfix/smtp_tls_session_cache
      smtp_tls_security_level             = may
      smtpd_tls_CAfile                    = /etc/postfix/ssl/smtpd.pem
      smtpd_tls_cert_file                 = /etc/postfix/ssl/smtpd.pem
      smtpd_tls_key_file                  = /etc/postfix/ssl/smtpd.pem
      smtpd_tls_received_header           = yes
      smtpd_tls_session_cache_database    = btree:/var/lib/postfix/smtpd_tls_session_cache
      tls_random_source                   = dev:/dev/urandom
      smtpd_tls_security_level            = may

      message_size_limit                  = 20480000

/etc/postfix/master.cf

      #
      # Postfix master process configuration file.  For details on the format
      # of the file, see the master(5) manual page (command: "man 5 master").
      #
      # Do not forget to execute "postfix reload" after editing this file.
      #
      # ==========================================================================
      # service type  private unpriv  chroot  wakeup  maxproc command + args
      #               (yes)   (yes)   (yes)   (never) (100)
      # ==========================================================================
      smtp      inet  n       -       -       -       -       smtpd
      #smtp      inet  n       -       -       -       1       postscreen
      #smtpd     pass  -       -       -       -       -       smtpd
      #dnsblog   unix  -       -       -       -       0       dnsblog
      #tlsproxy  unix  -       -       -       -       0       tlsproxy
      submission inet n       -       -       -       -       smtpd
        -o syslog_name=postfix/submission
        -o smtpd_tls_security_level=may
        -o smtpd_sasl_auth_enable=yes
        -o smtpd_sasl_type=dovecot
        -o smtpd_sasl_path=private/auth
        -o smtpd_sasl_local_domain=$myhostname
        -o smtpd_client_restrictions=permit_sasl_authenticated,reject
        -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject
        -o milter_macro_daemon_name=ORIGINATING
      #smtps     inet  n       -       -       -       -       smtpd
      #  -o syslog_name=postfix/smtps
      #  -o smtpd_tls_wrappermode=yes
      #  -o smtpd_sasl_auth_enable=yes
      #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
      #  -o milter_macro_daemon_name=ORIGINATING
      #628       inet  n       -       -       -       -       qmqpd
      pickup    fifo  n       -       -       60      1       pickup
      cleanup   unix  n       -       -       -       0       cleanup
      qmgr      fifo  n       -       n       300     1       qmgr
      #qmgr     fifo  n       -       n       300     1       oqmgr
      tlsmgr    unix  -       -       -       1000?   1       tlsmgr
      rewrite   unix  -       -       -       -       -       trivial-rewrite
      bounce    unix  -       -       -       -       0       bounce
      defer     unix  -       -       -       -       0       bounce
      trace     unix  -       -       -       -       0       bounce
      verify    unix  -       -       -       -       1       verify
      flush     unix  n       -       -       1000?   0       flush
      proxymap  unix  -       -       n       -       -       proxymap
      proxywrite unix -       -       n       -       1       proxymap
      smtp      unix  -       -       -       -       -       smtp
      relay     unix  -       -       -       -       -       smtp
      #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
      showq     unix  n       -       -       -       -       showq
      error     unix  -       -       -       -       -       error
      retry     unix  -       -       -       -       -       error
      discard   unix  -       -       -       -       -       discard
      local     unix  -       n       n       -       -       local
      virtual   unix  -       n       n       -       -       virtual
      lmtp      unix  -       -       -       -       -       lmtp
      anvil     unix  -       -       -       -       1       anvil
      scache    unix  -       -       -       -       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/bin/maildrop -d ${recipient}
      #
      # ====================================================================
      #
      # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
      #
      # Specify in cyrus.conf:
      #   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
      #
      # Specify in main.cf one or more of the following:
      #  mailbox_transport = lmtp:inet:localhost
      #  virtual_transport = lmtp:inet:localhost
      #
      # ====================================================================
      #
      # 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}
      #
      # ====================================================================
      # Old example of delivery via Cyrus.
      #
      #old-cyrus unix  -       n       n       -       -       pipe
      #  flags=R user=cyrus argv=/cyrus/bin/deliver -e -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/lib/bsmtp/bsmtp -t$nexthop -f$sender $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}
      dovecot   unix  -       n       n       -       -       pipe
        flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
      
/etc/mailman/mm_cfg.py

      # -*- python -*-

      # Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc.
      #
      # This program is free software; you can redistribute it and/or
      # modify it under the terms of the GNU General Public License
      # as published by the Free Software Foundation; either version 2
      # of the License, or (at your option) any later version.
      # 
      # This program is distributed in the hope that it will be useful,
      # but WITHOUT ANY WARRANTY; without even the implied warranty of
      # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      # GNU General Public License for more details.
      # 
      # You should have received a copy of the GNU General Public License
      # along with this program; if not, write to the Free Software 
      # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
      # 02110-1301 USA


      """This is the module which takes your site-specific settings.

      From a raw distribution it should be copied to mm_cfg.py.  If you
      already have an mm_cfg.py, be careful to add in only the new settings
      you want.  The complete set of distributed defaults, with annotation,
      are in ./Defaults.  In mm_cfg, override only those you want to
      change, after the

        from Defaults import *

      line (see below).

      Note that these are just default settings - many can be overridden via the
      admin and user interfaces on a per-list or per-user basis.

      Note also that some of the settings are resolved against the active list
      setting by using the value as a format string against the
      list-instance-object's dictionary - see the distributed value of
      DEFAULT_MSG_FOOTER for an example."""


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

      from Defaults import *

      ##############################################################
      # Put YOUR site-specific configuration below, in mm_cfg.py . #
      # See Defaults.py for explanations of the values.            #

      #-------------------------------------------------------------
      # The name of the list Mailman uses to send password reminders
      # and similar. Don't change if you want mailman-owner to be
      # a valid local part.
      MAILMAN_SITE_LIST = 'mailman'

      #-------------------------------------------------------------
      # If you change these, you have to configure your http server
      # accordingly (Alias and ScriptAlias directives in most httpds)
      DEFAULT_URL_PATTERN = 'http://%s/'
      IMAGE_LOGOS         = '/images/mailman/'

      #-------------------------------------------------------------
      # Default domain for email addresses of newly created MLs
      DEFAULT_EMAIL_HOST = 'lists.aplusr.at'
      #-------------------------------------------------------------
      # Default host for web interface of newly created MLs
      DEFAULT_URL_HOST   = 'lists.aplusr.at'
      #-------------------------------------------------------------
      # Required when setting any of its arguments.
      add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

      #-------------------------------------------------------------
      # The default language for this server.
      DEFAULT_SERVER_LANGUAGE = 'de'

      #-------------------------------------------------------------
      # Iirc this was used in pre 2.1, leave it for now
      USE_ENVELOPE_SENDER    = 0              # Still used?

      #-------------------------------------------------------------
      # Unset send_reminders on newly created lists
      DEFAULT_SEND_REMINDERS = 0

      #-------------------------------------------------------------
      # Uncomment this if you configured your MTA such that it
      # automatically recognizes newly created lists.
      # (see /usr/share/doc/mailman/README.Exim4.Debian or
      # /usr/share/mailman/postfix-to-mailman.py)
      # MTA=None   # Misnomer, suppresses alias output on newlist

      #-------------------------------------------------------------
      # Uncomment if you use Postfix virtual domains (but not
      # postfix-to-mailman.py), but be sure to see
      # /usr/share/doc/mailman/README.Debian first.
      MTA='Postfix'
      POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.aplusr.at']
      POSTFIX_MAP_CMD = '/etc/mailman/virtual_to_transport'

      #-------------------------------------------------------------
      # Uncomment if you want to filter mail with SpamAssassin. For
      # more information please visit this website:
      # http://www.jamesh.id.au/articles/mailman-spamassassin/
      # GLOBAL_PIPELINE.insert(1, 'SpamAssassin')

      # Note - if you're looking for something that is imported from mm_cfg, but you
      # didn't find it above, it's probably in /usr/lib/mailman/Mailman/Defaults.py.

As you can see, I was also already trying to use the workaround from

      http://wiki.list.org/display/DOC/Mailman+-+Postfix+integration+with+Mailman+generated+transport+or+other+maps

but at the moment it's not loaded because actually (!) I guess my 
current setup should work. I really searched in the net and also read 
installation and configuring instructions on mailman's wikipedia page. 
At first, everything was setup with the postfix_to_mailman.py script but 
I don't want to use it anymore because it's third party thingy. 
(Nevertheless, this one also did not work.)

Any help is very appreciated; I guess I just mixed up some stuff and no 
longer see the wood for the trees.

Niklaas

P.S.: If I should rather write to postfix' and/ or dovecot's 
mailinglist, please write me in short and I excuse for writing to this 
list.

-- 
Niklaas Baudet von Gersdorff
niklaas at kulturflatrate.net

http://www.kulturflatrate.net/niklaas


More information about the Mailman-Users mailing list