HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Postfix, Dovecot blocking Mailman user unknown error (http://www.howtoforge.com/forums/showthread.php?t=60394)

cFoo 31st January 2013 23:40

Postfix, Dovecot blocking Mailman user unknown error
 
I've followed the perfect installation instructions. I used Till's instructions to get Postfix and Dovecot to play nicely. Postfix and Dovecot are running, mailman web interface works, user subscription via the GUI works, it's all great.. except. It seems like Dovecot is blocking emails destined for mailman.


From the log, the email doesn't get to mailman. It appeared to die here:
Jan 31 14:14:25 scorponok dovecot: auth-worker: mysql(localhost): Connected to database dbispconfig
Jan 31 14:14:25 scorponok postfix/pipe[29977]: A99271D00BB1: to=<mylist@mydomain.xx>, relay=dovecot, delay=0.37, delays=0.04/0.02/0/0.31, dsn=5.1.1, status=bounced (user unknown)

dovecot.conf
Code:

protocols = imap pop3
auth_mechanisms = plain login
disable_plaintext_auth = no
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_privileged_group = vmail
ssl_cert = </etc/postfix/smtpd.cert
ssl_key = </etc/postfix/smtpd.key
passdb {
  args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
plugin {
  quota = dict:user::file:/var/vmail/%d/%n/.quotausage
  sieve=/var/vmail/%d/%n/.sieve
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0600
    user = vmail
  }
  user = root
}
protocol imap {
  mail_plugins = quota imap_quota
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
  mail_plugins = quota
}
protocol lda {
  mail_plugins = sieve quota
}

postfix/main.cf
Code:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = /usr/share/doc/postfix

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname = mydomain.host.xx
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 = mydomain.host.xx, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
smtpd_tls_security_level = may
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
smtpd_client_message_rate_limit = 100
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
virtual_transport = dovecot
header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/mime_header_checks
nested_header_checks = regexp:/etc/postfix/nested_header_checks
body_checks = regexp:/etc/postfix/body_checks
owner_request_special = no
dovecot_destination_recipient_limit = 1
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
message_size_limit = 0

mm_cfg
Code:

from Defaults import *
MAILMAN_SITE_LIST = 'mailman'
DEFAULT_URL_PATTERN = 'http://%s/cgi-bin/mailman/'
PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private'
IMAGE_LOGOS        = '/images/mailman/'
DEFAULT_EMAIL_HOST = 'mydomain.xx'
DEFAULT_URL_HOST  = 'mydomain.xx'
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
DEFAULT_SERVER_LANGUAGE = 'en'
USE_ENVELOPE_SENDER    = 0
DEFAULT_SEND_REMINDERS = 0
MTA='Postfix'
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['mydomain.xx', 'mydomain2.xx']


till 1st February 2013 11:48

Are the aliases for the mailing list which xou created in ispconfig listed in /var/lib/mailman/data/aliases ?

cFoo 1st February 2013 21:30

Yes they are. All the stanza are there.

cFoo 3rd February 2013 23:04

Solved
 
The problem is in the relay=dovecot part. What you need to do is configure your mailman transport to use local instead of dovecot. Otherwise, dovecot cannot resolve your virtual domain.

Follow these instructions:
http://wiki.list.org/display/DOC/Mai...+or+other+maps

Ignore point number (2).
Quote:

Do not put the domains in Postfix virtual_alias_domains, and do not put hash:/path/to/data/virtual_mailman in virtual_alias_maps.
You need to tell Postfix to map your virtual alias maps. So keep it in there.

till 5th February 2013 16:10

Where exactly did you change the "relay=dovecot" to local? Or do you mean to set virtual_transport = dovecot to virtual_transport = local in main.cf?

cFoo 5th February 2013 16:21

Adding the script /etc/mailman/virtual_to_transport
Code:

#!/bin/sh
sed -r -e 's/(^[^#]\S+\s+).+$/\1local/' $1 > /var/lib/mailman/data/transport-mailman
/usr/sbin/postmap /var/lib/mailman/data/transport-mailman

When you run bin/genaliases mailman will generate the transport-mailman with a list aliases mapping to local. Example,

Code:

...
# STANZA START: test
# CREATED: Sun Feb  3 12:49:43 2013
test@yourdomain.net              local
test-admin@yourdomain.net        local
test-bounces@yourdomain.net      local
test-confirm@yourdomain.net      local
..

Why this works is beyond my understanding of mailman. If you look at virtual-mailman that mapping should have picked up the mapping and directs the mail to aliases which then delivers to mailman. With the transport-mailman mapping, essentially you are sending it to the local system and letting the local services deal with it. I think.

till 5th February 2013 16:37

Ok, yes this makes sense. I will test this on my server and see how it can be integrated into the ispconfig installer so that the mailman setup works out of the box in future.

esaaix 12th June 2013 16:56

I followed this thread,
my problem was :
after trying to post a mail to mailman@mydomain.tld list I recieved an error msg with <mailman@mydomain.tld>: user unknown
and after this thread, I finished with an error msg <mailman@mydomain.tld>: user unknown "mailman"

In the postfix logs that's :
Code:

Jun 12 16:50:41 MY_DOMAIN amavis[6916]: (06916-03) Passed CLEAN, [xxx.xxx.xxx.xx] [xxx.xxx.xxx.xx] <testeur@MY_DOMAIN.tld> -> <mailman@MY_DOMAIN.tld>, Message-ID: <51B88AB8.90103@MY_DOMAIN.tld>, mail_id: ZABhkjINR28g, Hits: -1, size: 632, queued_as: 8B3C84172F, 417 ms
Jun 12 16:50:41 MY_DOMAIN postfix/smtp[9756]: 18FBF410A3: to=<mailman@MY_DOMAIN.tld>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.69, delays=0.27/0/0/0.42, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=06916-03, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 8B3C84172F)
Jun 12 16:50:41 MY_DOMAIN postfix/qmgr[29724]: 8B3C84172F: from=<testeur@MY_DOMAIN.tld>, size=1102, nrcpt=1 (queue active)
Jun 12 16:50:41 MY_DOMAIN postfix/qmgr[29724]: 18FBF410A3: removed
Jun 12 16:50:41 MY_DOMAIN postfix/local[9760]: 8B3C84172F: to=<mailman@MY_DOMAIN.tld>, relay=local, delay=0.38, delays=0.21/0.04/0/0.14, dsn=5.1.1, status=bounced (unknown user: "mailman")
Jun 12 16:50:41 MY_DOMAIN postfix/cleanup[9755]: E84544173B: message-id=<20130612145041.E84544173B@MY_DOMAIN.tld>
Jun 12 16:50:42 MY_DOMAIN postfix/bounce[9761]: 8B3C84172F: sender non-delivery notification: E84544173B
Jun 12 16:50:42 MY_DOMAIN postfix/qmgr[29724]: E84544173B: from=<>, size=2975, nrcpt=1 (queue active)
Jun 12 16:50:42 MY_DOMAIN postfix/qmgr[29724]: 8B3C84172F: removed
Jun 12 16:50:42 MY_DOMAIN postfix/pipe[9762]: E84544173B: to=<testeur@MY_DOMAIN.tld>, relay=dovecot, delay=0.36, delays=0.12/0/0/0.23, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 12 16:50:42 MY_DOMAIN postfix/qmgr[29724]: E84544173B: removed

what's wrong ?

the main.cf is
Code:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
default_transport = smtp
delay_warning_time = 1h
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 51200000
mydestination = localhost
myhostname = MY_DOMAIN.tld
mynetworks = 127.0.0.0/8 MY_DOMAIN_P.0/24 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
relay_transport = relay
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = permit_mynetworks,  permit_sasl_authenticated,  reject_non_fqdn_hostname,  reject_non_fqdn_sender,  reject_non_fqdn_recipient,  reject_unauth_destination,  reject_unauth_pipelining,  check_policy_service inet:127.0.0.1:10023,  reject_invalid_hostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/var/lib/mailman/data/transport-mailman
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf,hash:/var/lib/mailman/data/virtual-mailman
virtual_gid_maps = static:3000
virtual_mailbox_base = /home/facteur
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = dovecot
virtual_uid_maps = static:3000

and the mm_cfg.py
Code:

MAILMAN_SITE_LIST = 'mailman'
DEFAULT_URL_PATTERN = 'http://%s/adm_listes/'
PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private'
IMAGE_LOGOS        = '/images/mailman/'
DEFAULT_EMAIL_HOST = 'MY_DOMAIN.tld'
DEFAULT_URL_HOST  = 'MY_DOMAIN.tld'
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['MY_DOMAIN.tld']
POSTFIX_MAP_CMD = '/var/lib/mailman/data/virtual_to_transport'
MTA='Postfix'
GLOBAL_PIPELINE.insert(1, 'SpamAssassin')

all the mailman aliases, virtual-mailman and transport-mailman are up-to-date and well-formed.
mailman-request and mailman-bounces can send mails with no problem.

thanks for the help.


All times are GMT +2. The time now is 09:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.