# Mailman & Postfix: unknown user

## alexandero

I'm successfully running a mailserver as described in the virtual mail setup in the docs. Unfortunately mailman doesnt work as it should - it rejects every mail to mailman-accounts as unknown user. to be more exact, it does find the entry in /usr/local/mailman/data/virtual-mailman, resolves it, but then it seems to ignore the entry in /usr/local/mailman/data/aliases, see below:

mail.log:

```

Feb 10 14:52:57 dmz postfix/smtpd[3741]: resolve_clnt_query: `dmztest-request@sos-mitmensch.at' -> t=`virtual' h=`sos-mitmensch.at' r=`dmztest-request@sos-mitmensch.at'

Feb 10 14:52:57 dmz postfix/smtpd[3741]: ctable_locate: install entry key dmztest-request@sos-mitmensch.at

Feb 10 14:52:57 dmz postfix/smtpd[3741]: maps_find: recipient_canonical_maps: dmztest-request@sos-mitmensch.at: not found

Feb 10 14:52:57 dmz postfix/smtpd[3741]: maps_find: recipient_canonical_maps: dmztest-request: not found

Feb 10 14:52:57 dmz postfix/smtpd[3741]: maps_find: recipient_canonical_maps: @sos-mitmensch.at: not found

Feb 10 14:52:57 dmz postfix/smtpd[3741]: mail_addr_find: dmztest-request@sos-mitmensch.at -> (not found)

Feb 10 14:52:57 dmz postfix/smtpd[3741]: maps_find: canonical_maps: dmztest-request@sos-mitmensch.at: not found

Feb 10 14:52:57 dmz postfix/smtpd[3741]: maps_find: canonical_maps: dmztest-request: not found

Feb 10 14:52:57 dmz postfix/smtpd[3741]: maps_find: canonical_maps: @sos-mitmensch.at: not found

Feb 10 14:52:57 dmz postfix/smtpd[3741]: mail_addr_find: dmztest-request@sos-mitmensch.at -> (not found)

Feb 10 14:52:57 dmz postfix/smtpd[3741]: maps_find: virtual_alias_maps: hash:/usr/local/mailman/data/virtual-mailman: dmztest-request@sos-mitmensch.at = dmztest-request

Feb 10 14:52:57 dmz postfix/smtpd[3741]: mail_addr_find: dmztest-request@sos-mitmensch.at -> dmztest-request

Feb 10 14:52:57 dmz postfix/smtpd[3741]: > unknown[10.1.1.17]: 250 Ok

Feb 10 14:52:57 dmz postfix/smtpd[3741]: watchdog_pat: 0x809c478

Feb 10 14:52:57 dmz postfix/smtpd[3741]: < unknown[10.1.1.17]: DATA

Feb 10 14:52:57 dmz postfix/smtpd[3741]: > unknown[10.1.1.17]: 354 End data with <CR><LF>.<CR><LF>

Feb 10 14:52:57 dmz postfix/smtpd[3741]: public/cleanup socket: wanted attribute: status

Feb 10 14:52:57 dmz postfix/cleanup[3742]: 6301427D38: message-id=<73C1A9AB-5BD0-11D8-B501-000393488DFA@sos-mitmensch.at>

Feb 10 14:52:57 dmz postfix/smtpd[3741]: input attribute name: status

Feb 10 14:52:57 dmz postfix/smtpd[3741]: input attribute value: 0

Feb 10 14:52:57 dmz postfix/smtpd[3741]: public/cleanup socket: wanted attribute: reason

Feb 10 14:52:57 dmz postfix/qmgr[3700]: 6301427D38: from=<testuser@sos-mitmensch.at>, size=1990, nrcpt=1 (queue active)

Feb 10 14:52:57 dmz postfix/smtpd[3741]: input attribute name: reason

Feb 10 14:52:57 dmz postfix/smtpd[3741]: input attribute value: (end)

Feb 10 14:52:57 dmz postfix/smtpd[3741]: public/cleanup socket: wanted attribute: (list terminator)

Feb 10 14:52:57 dmz postfix/smtpd[3741]: input attribute name: (end)

Feb 10 14:52:57 dmz postfix/smtpd[3741]: > unknown[10.1.1.17]: 250 Ok: queued as 6301427D38

Feb 10 14:52:57 dmz postfix/smtpd[3741]: watchdog_pat: 0x809c478

Feb 10 14:52:57 dmz postfix/virtual[3746]: 6301427D38: to=<dmztest-request@sos-mitmensch.at>, relay=virtual, delay=0, status=bounced (unknown user: "dmztest-request@sos-mitmensch.at")

```

/usr/local/mailman/Mailman/Defaults.py:

```

DEFAULT_EMAIL_HOST = 'resistor.sos-mitmensch.at'

DEFAULT_URL_HOST = 'resistor.sos-mitmensch.at'

```

/usr/local/mailman/Mailman/mm_cfg.py:

```

MTA = "Postfix"

POSTFIX_STYLE_VIRTUAL_DOMAINS = ['social.at','sos-mitmensch.at']

add_virtualhost('lists.social.at', 'social.at')

add_virtualhost('dmz.sos-mitmensch.at', 'sos-mitmensch.at')

```

postconf -n (excerpts)

```

alias_database = hash:/etc/mail/aliases

alias_maps = hash:/usr/local/mailman/data/aliases, mysql:/etc/postfix/mysql-aliases.cf

broken_sasl_auth_clients = yes

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

home_mailbox = .maildir/

local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

local_transport = local

mail_owner = postfix

mydestination = $myhostname, localhost.$mydomain, dmz.$mydomain, localhost

mydomain = sos-mitmensch.at

myhostname = mail.sos-mitmensch.at

mynetworks = 10.1.1.0/24, 127.0.0.0/8

myorigin = $mydomain

newaliases_path = /usr/bin/newaliases

owner_request_special = no

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.0.16-r1/readme

recipient_delimiter = +

relocated_maps = mysql:/etc/postfix/mysql-relocated.cf

sample_directory = /etc/postfix/sample

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

unknown_local_recipient_reject_code = 550

virtual_alias_maps = hash:/usr/local/mailman/data/virtual-mailman,        mysql:/etc/postfix/mysql-virtual.cf

virtual_gid_maps = static:100

virtual_mailbox_base = /

virtual_mailbox_domains = social.at, sos-mitmensch.at

virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf

virtual_minimum_uid = 1000

virtual_transport = virtual

virtual_uid_maps = static:1003

```

I'm pretty stuck. Basically, I dont need any virtual hosts for mailman, but using dmz.mydomain as DEFAULT_URL_HOST and mydomain as DEFAULT_EMAIL_HOST didnt help either. I assumed that it is related to the fact that my domains in postfix all are virtual (setting one as local didnt work).

Any ideas? I guess I've tried every configuration (well, probably I missed at least one ;), have restarted postfix&mailmal every time and had run genaliases.

Thanks for any help...

----------

## matthew_epiphany

 *Quote:*   

> but then it seems to ignore the entry in /usr/local/mailman/data/aliases

 

I had this same irritating problem. It found the virtual aliases fine, but couldn't seem to see the local aliases they pointed to.

To fix this, I had to include an entry for my list's domain in 'mydestination' in main.cf -- even though it's a virtual domain. This seems to be because the entries in /usr/local/mailman/data/aliases are essentially local system accounts, and local delivery is based on what's in 'mydestination.'

```
mydestination = localhost, 123.123.123.163, scooby.asdfasdf.com, asdfasdf.com, domainforthemailinglist.org
```

Just remember that then local delivery takes precedence for that domain, so you can't have any accounts in that virtual domain with the same name as a local machine account.

----------

## alexandero

Thanks for your reply. I had fixed the problem some months ago, but I never posted a followup in this thread...

----------

## lostinspace2011

Without including my domain explicitely under mydestination all virtual accounts work successfully, however mailman reports user unknown

Results in mailman list user unknown error

mydomain = XXX.com

mydestination = $myhostname, localhost.$mydomain, localhost

As suggested I added the domain explicitely 

mydomain = XXX.com

mydestination = $myhostname, localhost.$mydomain, localhost, XXX.com

Now mailman works, but all virtual users are rejected with unknown user

Any suggestion on how to support both vitual users and mailman lists.

So far I have included the following settings and verified the content of hte alias databases is correct:

alias_database = hash:/etc/mail/aliases, hash:/var/lib/mailman/data/aliases

alias_maps = hash:/etc/mail/aliases, hash:/var/lib/mailman/data/aliases

virtual_alias_maps = pgsql:/etc/postfix/pgsql_virtual_alias_maps.cf, hash:/var/lib/mailman/data/virtual-mailman

----------

## lostinspace2011

Any pointers on this

----------

