postfix & mailman @debian8

Discussion in 'Server Operation' started by derWalter, Jan 28, 2016.

  1. derWalter

    derWalter New Member

    hey guys

    our server is up and running for around three years now and postfix never made problems.

    three days ago I installed mailman, following this tutorial:
    https://www.howtoforge.com/how-to-install-and-configure-mailman-with-postfix-on-debian-squeeze

    but it never worked. The mails never came to mailman.
    so i switched over from transport to virtual_maps, as we are using virtual domains in our environment.

    right now i get the following errors:
    when sending a mail to the list from an internal emailaddress from the same server i get:
    <[email protected]> (expanded from <[email protected]>): host
    mail.ifkuk.org[private/dovecot-lmtp] said: 550 5.1.1 <[email protected]> User
    doesn't exist: [email protected] (in reply to RCPT TO command)

    if i send an email from gmail i get: 554 5.7.1 <[email protected]>: Relay access denied

    /etc/postfix/main.conf
    Code:
      GNU nano 2.2.6                                                                                       File: /etc/postfix/main.cf                                
    #See /usr/share/postfix/main.cf.dist for a commented, more complete version
    inet_interfaces = all
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP (Debian/GNU)
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    readme_directory = /usr/share/doc/postfix
    
    # TLS parameters
    #smtpd_tls_cert_file=/etc/ssl/certs/mailserver.cert.pem
    #smtpd_tls_key_file=/etc/ssl/private/mailserver.key.pem
    smtpd_tls_cert_file=/etc/letsencrypt/live/mail.ifkuk.org/fullchain.pem
    #smtp_tls_cert_file=/etc/letsencrypt/live/mail.ifkuk.org/fullchain.pem
    smtpd_tls_key_file=/etc/letsencrypt/live/mail.ifkuk.org/privkey.pem
    #smtp_tls_key_file=/etc/letsencrypt/live/mail.ifkuk.org/privkey.pem
    
    
    smtpd_use_tls=yes
    smtpd_tls_auth_only = yes
    #smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    #smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    
    #Enabling SMTP for authenticated users, and handing off authentication to Dovecot
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_type = dovecot
    smtpd_sasl_path = private/auth
    queue_directory = /var/spool/postfix
    broken_sasl_auth_clients = yes
    #smtpd_recipient_restrictions = permit_sasl_authenticated reject_unauth_destination
    #smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_sender_login_mismatch
    #smtpd_relay_restrictions =
    #    permit_mynetworks
    #    permit_sasl_authenticated
    #    reject_unauth_destination
    smtpd_recipient_restrictions =
            permit_sasl_authenticated,
            permit_mynetworks,
            reject_unauth_destination
    #smtpd_recipient_restrictions = reject_non_fqdn_recipient, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unlisted_recipient, reject_non_fqdn_sender, permit
    smtpd_sender_restrictions = permit_sasl_authenticated,
        permit_mynetworks,
    
    #smtpd_recipient_restrictions = permit
    #smtpd_sender_restrictions = permit
    
    #smtpd_milters = unix:/spamass/spamass.sock
    #milter_connect_macros = j {daemon_name} v {if_name} _
    #milter_default_action = tempfail
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    
    myhostname = mail.ifkuk.org
    mydomain = ifkuk.org
    alias_maps = hash:/etc/aliases,hash:/var/lib/mailman/data/aliases
    #alias_database = hash:/etc/aliases,hash:/var/lib/mailman/data/aliases
    myorigin = /etc/mailname
    
    mydestination = localhost,localhost.localdomain,$myhostname,localhost.$mydomain
    #relayhost =
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    
    #settings especially important for mailman - walter
    #relay_domains = lists.ifkuk.org
    relay_recipient_maps = hash:/var/lib/mailman/data/virtual-mailman
    #transport_maps = hash:/etc/postfix/transport, pgsql:/etc/postfix/pgsql-virtual_transports.cf
    #mailman_destination_recipient_limit = 1
    
    #Handing off local delivery to Dovecot's LMTP, and telling it where to store mail
    virtual_transport = lmtp:unix:private/dovecot-lmtp
    #transport_maps = pgsql:/etc/postfix/pgsql-virtual_transports.cf
    virtual_alias_domains =
    virtual_alias_maps = proxy:pgsql:/etc/postfix/pgsql-virtual_forwardings.cf,pgsql:/etc/postfix/pgsql-virtual_email2email.cf,hash:/var/lib/mailman/data/virtual-mailman
    virtual_email2email = hash:/var/lib/mailman/data/virtual-mailman
    virtual_mailbox_domains = proxy:pgsql:/etc/postfix/pgsql-virtual_domains.cf
    virtual_mailbox_maps = proxy:pgsql:/etc/postfix/pgsql-virtual_mailboxes.cf
    #virtual_mailbox_base = /var/mail
    #virtual_uid_maps = static:5000
    #virtual_gid_maps = static:5000
    
    #virtual_transport=dovecot
    #dovecot_destination_recipient_limit=1
    
    #smtpd_sasl_auth_enable = yes
    #smtpd_sasl_security_options = noanonymous
    #smtpd_sasl_local_domain = $myhostname
    #smtpd_sasl_application_name = smtpd
    #broken_sasl_auth_clients = yes
    
    #smtpd_recipient_restrictions =
    #   permit_sasl_authenticated,
    #   permit_mynetworks,
    #   check_relay_domains
    #html_directory = /usr/share/doc/postfix/html
    html_directory = /usr/share/doc/postfix/html
    smtpd_relay_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
    
    in /etc/postfix/master.cfg
    Code:
    #mailman   unix  -       n       n       -       -       pipe
    #  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}
    
    /etc/mailman/mm_cfg.py
    Code:
    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.ifkuk.org'
    #-------------------------------------------------------------
    # Default host for web interface of newly created MLs
    DEFAULT_URL_HOST   = 'lists.ifkuk.org'
    #-------------------------------------------------------------
    # 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'
    
    #-------------------------------------------------------------
    # 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.
    
    
    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.ifkuk.org']
    
    

    I hope everything is there to get this topic going, I've invested over two days now and cant find out why postfix is not forwarding the mails to mailman.
     
  2. derWalter

    derWalter New Member

    Hey guys, has really NO ONE a clue?
    i am curious if this input is correct, as in this tutorial
    http://www.ungelesen.net/_/mailman-und-postfix-eine-alternative-konfiguration/
    the content of the two files seems to be interchanged

    /var/lib/mailman/data/aliases
    Code:
    # This file is generated by Mailman, and is kept in sync with the
    
    # binary hash file aliases.db.  YOU SHOULD NOT MANUALLY EDIT THIS FILE
    # unless you know what you're doing, and can keep the two files properly
    # in sync.  If you screw it up, you're on your own.
    
    # The ultimate loop stopper address
    mailman-loop: /var/lib/mailman/data/owner-bounces.mbox
    
    # STANZA START: mailman
    # CREATED: Thu Jan 28 19:56:43 2016
    mailman:             "|/var/lib/mailman/mail/mailman post mailman"
    mailman-admin:       "|/var/lib/mailman/mail/mailman admin mailman"
    mailman-bounces:     "|/var/lib/mailman/mail/mailman bounces mailman"
    mailman-confirm:     "|/var/lib/mailman/mail/mailman confirm mailman"
    mailman-join:        "|/var/lib/mailman/mail/mailman join mailman"
    mailman-leave:       "|/var/lib/mailman/mail/mailman leave mailman"
    mailman-owner:       "|/var/lib/mailman/mail/mailman owner mailman"
    mailman-request:     "|/var/lib/mailman/mail/mailman request mailman"
    mailman-subscribe:   "|/var/lib/mailman/mail/mailman subscribe mailman"
    mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"
    # STANZA END: mailman
    
    # STANZA START: test
    # CREATED: Thu Jan 28 19:56:43 2016
    test:             "|/var/lib/mailman/mail/mailman post test"
    test-admin:       "|/var/lib/mailman/mail/mailman admin test"
    test-bounces:     "|/var/lib/mailman/mail/mailman bounces test"
    test-confirm:     "|/var/lib/mailman/mail/mailman confirm test"
    test-join:        "|/var/lib/mailman/mail/mailman join test"
    test-leave:       "|/var/lib/mailman/mail/mailman leave test"
    test-owner:       "|/var/lib/mailman/mail/mailman owner test"
    test-request:     "|/var/lib/mailman/mail/mailman request test"
    test-subscribe:   "|/var/lib/mailman/mail/mailman subscribe test"
    test-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe test"
    # STANZA END: test

    /var/lib/mailman/data/virtual-mailman
    Code:
    # This file is generated by Mailman, and is kept in sync with the binary hash
    # file virtual-mailman.db.  YOU SHOULD NOT MANUALLY EDIT THIS FILE unless you
    # know what you're doing, and can keep the two files properly in sync.  If you
    # screw it up, you're on your own.
    #
    # Note that you should already have this virtual domain set up properly in
    # your Postfix installation.  See README.POSTFIX for details.
    
    # LOOP ADDRESSES START
    [email protected]    mailman-loop
    # LOOP ADDRESSES END
    
    # STANZA START: mailman
    # CREATED: Thu Jan 28 19:56:43 2016
    [email protected]              mailman
    [email protected]        mailman-admin
    [email protected]      mailman-bounces
    [email protected]      mailman-confirm
    [email protected]         mailman-join
    [email protected]        mailman-leave
    [email protected]        mailman-owner
    [email protected]      mailman-request
    [email protected]    mailman-subscribe
    [email protected]  mailman-unsubscribe
    # STANZA END: mailman
    
    # STANZA START: test
    # CREATED: Thu Jan 28 19:56:43 2016
    [email protected]              test
    [email protected]        test-admin
    [email protected]      test-bounces
    [email protected]      test-confirm
    [email protected]         test-join
    [email protected]        test-leave
    [email protected]        test-owner
    [email protected]      test-request
    [email protected]    test-subscribe
    [email protected]  test-unsubscribe
    # STANZA END: test
     
  3. vsolmyr

    vsolmyr New Member

    I hope this will help you:
    1. after editing the following file: /var/lib/mailman/data/virtual-mailman
      run this command: postmap /var/lib/mailman/data/virtual-mailman
    2. after editing the following file: /var/lib/mailman/data/aliases
      run this command: postalias /var/lib/mailman/data/aliases
    3. Check/Edit you postfix main config:
      relay_recipient_maps = hash: path-to-postfix/postfix/relay_recipients
      transport_maps = hash: path-to-postfix/postfix/transport
      Create the above files:
      relay_recipients:
      Code:
      <nameOfList>@<domain.com> OK
      <nameOfList>-admin@<domain.com> OK
      <nameOfList>-bounces@<domain.com> OK
      <nameOfList>-confirm@<domain.com> OK
      <nameOfList>-join@<domain.com> OK
      <nameOfList>-leave@<domain.com> OK
      <nameOfList>-owner@<domain.com> OK
      <nameOfList>-request@<domain.com> OK
      <nameOfList>-subscribe@<domain.com> OK
      <nameOfList>-unsubscribe@<domain.com> OK
      transport:
      Code:
      <nameOfList>@<domain.com> mailman:
      <nameOfList>-bounces@<domain.com> mailman:
      <nameOfList>-owner@<domain.com> mailman:
      <nameOfList>-confirm@<domain.com> mailman:
      <nameOfList>-request@<domain.com> mailman:
      Then run the following: postmap path-to-postfix/postfix/relay_recipients , postmap path-to-postfix/postfix/transport
    4. master.cf:
      Code:
      mailman  unix  -  n  n  -  -  pipe
        flags=FR user=mailman:mailman argv=path-to-mailman/mailman/postfix-to-mailman.py ${nexthop} ${user}
     
  4. derWalter

    derWalter New Member

    thanks for your kind reply
     
  5. derWalter

    derWalter New Member

    vsolmyr and ztk.me like this.
  6. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    you could add [solved] to your original posts title, well and if not ... someone who reads this should know by now you solved your issue.
     
  7. derWalter

    derWalter New Member

    How can i change the title?

    Didn't find the option for it.
     
  8. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    to be honest, never checked if this is actually possible here - and you don't have to mark it, just let it be :)
     

Share This Page