Virtual domain (Postfix)/Real Virtual Domain

提供: Sympa-JA
移動: 案内, 検索

Japanese content: 仮想ドメイン_(Postfix)/完全な仮想ドメインにする方法

This page describes configuration for Sympa 6.1.19 or later.

If you use 6.1.17 or earlier, see Virtual domain (Postfix)/Real Virtual Domain (6.1.17 or earlier).

Advantages of this method:

  • Since Virtual domain feature provided by Postfix is used, messages bound for non-existing list addresses will be rejected during SMTP session without generating backscatter.
  • No intermediate aliases.

目次

Configuration

Sympa --- All domains are virtual

Customize list_aliases template to generate transport maps instead of alias maps. Default template is placed on /home/sympa/default/list_aliases.tt2, however, don't edit it but make the copy and edit it.

  • Place the copy on /home/sympa/etc/.

/home/sympa/etc/list_aliases.tt2

#--- [% list.name %]@[% list.domain %]: list transport map created at [% date %]
[% list.name %]@[% list.domain %] sympa:[% list.name %]@[% list.domain %]
[% list.name %]-request@[% list.domain %] sympa:[% list.name %]-request@[% list.domain %]
[% list.name %]-editor@[% list.domain %] sympa:[% list.name %]-editor@[% list.domain %]
#[% list.name %]-subscribe@[% list.domain %] sympa:[% list.name %]-subscribe@[%list.domain %]
[% list.name %]-unsubscribe@[% list.domain %] sympa:[% list.name %]-unsubscribe@[% list.domain %]
[% list.name %][% return_path_suffix %]@[% list.domain %] sympabounce:[% list.name %]@[% list.domain %]

Make sympa_tranport be updated instead of sympa_aliases, and use newaliases(1) instead of postmap(1): Edit main configuration file sympa.conf.

sympa.conf

sendmail_aliases /home/sympa/etc/sympa_transport
aliases_program postmap
aliases_db_type hash

By this setting, sympa_transport will be updated automatically when any lists are created, closed, restored or purged.

Sympa --- Particular domain(s) are virtual

Customize list_aliases template to generate transport maps instead of alias maps. Default template is placed on /home/sympa/default/list_aliases.tt2, however, don't edit it but make the copy and edit it.

  • Place the copy on /home/sympa/etc/domain/ (create directory if it doesn't exist).

/home/sympa/etc/domain/list_aliases.tt2

#--- [% list.name %]@[% list.domain %]: list transport map created at [% date %]
[% list.name %]@[% list.domain %] sympa:[% list.name %]@[% list.domain %]
[% list.name %]-request@[% list.domain %] sympa:[% list.name %]-request@[% list.domain %]
[% list.name %]-editor@[% list.domain %] sympa:[% list.name %]-editor@[% list.domain %]
#[% list.name %]-subscribe@[% list.domain %] sympa:[% list.name %]-subscribe@[%list.domain %]
[% list.name %]-unsubscribe@[% list.domain %] sympa:[% list.name %]-unsubscribe@[% list.domain %]
[% list.name %][% return_path_suffix %]@[% list.domain %] sympabounce:[% list.name %]@[% list.domain %]

Make sympa_tranport be updated instead of sympa_aliases, and use newaliases(1) instead of postmap(1): Edit robot configuration file robot.conf (create it if it doesn't exist).

/home/sympa/etc/domain/robot.conf

sendmail_aliases /home/sympa/etc/sympa_transport
aliases_program postmap
aliases_db_type hash

Postfix

Add definitions of "sympa" and "sympabounce" to master.cf. Former takes charge of posting and mail commands, and latter takes charge of bounce processing.

master.cf

# Sympa
sympa   unix    -       n       n       -       -       pipe
  flags=hqRu user=sympa argv=/home/sympa/bin/queue ${nexthop}
sympabounce unix -      n       n       -       -       pipe
  flags=hqRu user=sympa argv=/home/sympa/bin/bouncequeue ${nexthop}
  • "R" is required in flags option; "F" is unnecessary.

Add configuration for virtual domain(s).

main.cf

# virtual(8) maps
virtual_mailbox_domains = ...
  hash:/etc/postfix/transport.sympa
virtual_mailbox_maps = ...
  hash:/etc/postfix/transport.sympa,
  hash:/home/sympa/etc/sympa_transport,
  hash:/etc/postfix/virtual.sympa
# virtual(5) maps
virtual_alias_maps = ...
  hash:/etc/postfix/virtual.sympa
# transport maps
transport_maps = ...
  hash:/etc/postfix/transport.sympa,
  hash:/home/sympa/etc/sympa_transport
# For VERP
recipient_delimiter = +
Note
If mydestination parameter in main.cf includes the virtual domain listed in virtual_mailbox_domains, Postfix outputs warnings to system log. Remove virtual domain(s) from mydestination.

transport.sympa takes charge of list of virtual domains, list of addresses in virtual domains and transport map. sympa_transport takes charge of list of addresses in virtual domains and transport map. By both files right-side of maps will be used only when they are used as transport maps. And, virtual aliases not managed by Sympa sould be added to virtual.sympa.

Apache

Since Sympa itself can handle name-based virtual host, no special configuration are required for Apache. However, if the domain(s) of Web interface were virtual hosts, add configuration for new domain(s).

Adding a virtual domain

In this section, following virtual domain will be added for example.

  • The domain for e-mail interface: virtual.dom.ain
  • The domain for Web interface: www.virtual.dom.ain

Both domains may be same. In this example different domains are used for clarification.

Adding entries to DNS

Not yet translated.

Configure Sympa

Not yet translated.

Configure Postfix

Create transport.sympa and virtual.sympa described above with following contents. If you have added another virtual domain, append contents to those files.

transport.sympa

# Robot virtual.dom.ain
virtual.dom.ain                  error:User unknown in recipient table
sympa@virtual.dom.ain            sympa:sympa@virtual.dom.ain
listmaster@virtual.dom.ain       sympa:listmaster@virtual.dom.ain
bounce@virtual.dom.ain           sympabounce:sympa@virtual.dom.ain

virtual.sympa

sympa-request@virtual.dom.ain    postmaster@localhost
sympa-owner@virtual.dom.ain      postmaster@localhost

Create transport map and virtual alias map.

# postmap hash:/etc/postfix/transport.sympa
# postmap hash:/etc/postfix/virtual.sympa

Restart services

When you finished all configuration changes, restart Postfix, Sympa and Apache.

Tests

Access to Web interface with the URL [http://www.virtual.dom.ain/sympa]. A Web site with no list will be shown.

Try creating a list. etc/sympa_transport will be updated and new transports for the list will be added. For example,

#--- testlist@virtual.dom.ain: list transport map created at 15 Apr 2010
testlist@virtual.dom.ain sympa:testlist@virtual.dom.ain
testlist-request@virtual.dom.ain sympa:testlist-request@virtual.dom.ain
testlist-editor@virtual.dom.ain sympa:testlist-editor@virtual.dom.ain
#testlist-subscribe@virtual.dom.ain sympa:testlist-subscribe@virtual.dom.ain
testlist-unsubscribe@virtual.dom.ain sympa:testlist-unsubscribe@virtual.dom.ain
testlist-owner@virtual.dom.ain sympabounce:testlist@virtual.dom.ain

Move a non-virtual domain to virtual domain

Not yet translated.

個人用ツール
名前空間

変種
操作
案内
ツール