OK, this is getting off-topic for pkg-exim4-devel, let's move away
from that list. It is also off-topic for bug #396537, so let's move
the discussion to [EMAIL PROTECTED]; (please
keep CCing me personal copies.)

On Wed, Dec 10, 2008 at 09:53:07PM +0100, Tomas Pospisek wrote:
> On Wed, 10 Dec 2008, Lionel Elie Mamane wrote:
>> On Wed, Dec 10, 2008 at 09:16:46PM +0100, Lionel Elie Mamane wrote:
>>> On Wed, Dec 10, 2008 at 09:00:37PM +0100, Tomas Pospisek wrote:

>>>> (I do not understand how the condition line finds out that to which
>>>> domain a list belongs to)

>>> When routing email address [EMAIL PROTECTED] (or [EMAIL PROTECTED] or 
>>> [EMAIL PROTECTED]
>>> or ...), it looks in that file for a line that starts with "[EMAIL 
>>> PROTECTED]"
>>> and then whitespace or a ":" or end-of-line.

> The reason I asked for the aliases example is that I migrated from a
> exim3/old_mailman to exim4/new_mailman system and had to take
> everything with me.

> Thus I was completely at odds what should be put into the aliases
> file and I wasn't able to steer google in the right direction
> either.

You don't have to put anything there, it is generated by
mailman... when you create / delete a list. Run
MAILMAN_HOME/bin/genaliases to force regeneration right now. I added
that to the README.Exim4.Debian also.

> If you'd add the example you sent me to the README then that would
> be very helpful.

It is useful in a how-does-it-work-under-the-hood kind of way, but not
to get things running; not supposed to edit it by hand. It is more
"implementation documentation" than "user/administration
documentation", that's why I did not mention it there.

> Could you send me the new README. If you don't mind I'll look at it
> and criticise/improve it?

Attached.

-- 
Lionel
Here's a way to integrate mailman with Exim4 that will automatically
play nice with mailman's virtual domains support and VERP. It does not
require dedicating domain(s) to mailman.

Configure your Mailman (in /etc/mailman/mm_cfg.py) with:

MTA = 'Postfix'
POSTFIX_ALIAS_CMD = '/bin/true'
POSTFIX_MAP_CMD = 'chgrp Debian-exim'

and list all your Mailman domains in "POSTFIX_STYLE_VIRTUAL_DOMAINS":

POSTFIX_STYLE_VIRTUAL_DOMAINS = [ 'example.com', 'example.org' ]

Please note that the chgrp command above will not work when creating a
list in the web interface: the user www-data will not be allowed to do
this. You can circumvent this problem by creating new lists with the
'newlist' command line command or using instead:
POSTFIX_MAP_CMD = 'chmod o+r'
This will allow local users (with shell access to the list server) to
see the list of all Mailman mailing lists, but not much more.

If you have created lists before making those changes to mm_cfg.py
(and you are not going to create others before running the system in
production), you need to run /var/lib/mailman/bin/genaliases once; it
will be done automatically every time you create / delete a mailing
list in the future.


Put this in your exim4 main configuration (if you use a split config,
for example /etc/exim4/conf.d/main/04_local_mailman_macros)

---------------------- BEGIN EXIM4 MAIN   ----------------------------
# Home dir for your Mailman installation -- aka Mailman's prefix
# directory.
MAILMAN_HOME=/var/lib/mailman
MAILMAN_WRAP=MAILMAN_HOME/mail/mailman

# User and group for Mailman, should match your --with-mail-gid
# switch to Mailman's configure script.
MAILMAN_USER=list
MAILMAN_GROUP=list
----------------------  END EXIM4 MAIN    ----------------------------


Put this in your exim4 router configuration (if you use a split
config, then for example /etc/exim4/conf.d/router/970_local_mailman)

---------------------- BEGIN EXIM4 ROUTER ----------------------------
# Messages get sent out with
# envelope from "[EMAIL PROTECTED]"
# But mailman doesn't put such addresses
# in the aliases. Recognise these here.
mailman_workaround:
  domains = +local_domains
  require_files = MAILMAN_HOME/lists/$local_part/config.pck
  driver = accept
  local_parts = mailman
  local_part_suffix_optional
  local_part_suffix = -bounces : -bounces+* : \
           -confirm+* : -join : -leave : \
           -subscribe : -unsubscribe : \
           -owner : -request : -admin : -loop
  transport = mailman_transport
  group = MAILMAN_GROUP

# Mailman lists
mailman_router:
  domains = +local_domains
  condition = [EMAIL PROTECTED]/data/virtual-mailman}{1}{0}}
  require_files = MAILMAN_HOME/lists/$local_part/config.pck
  driver = accept
  local_part_suffix_optional
  local_part_suffix = -bounces : -bounces+* : \
                      -confirm+* : -join : -leave : \
                      -subscribe : -unsubscribe : \
                      -owner : -request : -admin : -loop
  transport = mailman_transport
  group = MAILMAN_GROUP
----------------------  END EXIM4 ROUTER  ----------------------------

Put this in your exim4 transport configuration (if you use a split
config, then for example /etc/exim4/conf.d/transport/40_local_mailman)

---------------------- BEGIN EXIM4 TRANSPORT -------------------------
mailman_transport:
  driver = pipe
  command = MAILMAN_WRAP \
            '${if def:local_part_suffix \
                  {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
                  {post}}' \
            $local_part
  current_directory = MAILMAN_HOME
  home_directory = MAILMAN_HOME
  user = MAILMAN_USER
  group = MAILMAN_GROUP
  freeze_exec_fail = true
----------------------  END EXIM4 TRANSPORT  -------------------------

You are done!

 -- Lionel Elie Mamane <[EMAIL PROTECTED]>, Wed, 10 Dec 2008 22:03:31 +0100

Reply via email to