Skip to Content.
Sympa Menu

Configure mail server: Postfix


Two ways to integrate

There are two ways to integrate Sympa into Postfix:

The former is recommended. However, if you will never have plan to manage multiple domains, the latter is easier way.

You can not mix both ways. Following sections describe these two ways by each.

Virtual domain setting

Initial setting

Steps in this section may be done once at the first time.

  1. If path of sendmail executable file is differ from the default value of sendmail parameter, /usr/sbin/sendmail, define it in sympa.conf. For example:

    sendmail /usr/local/sbin/sendmail
  2. Create list_aliases.tt2 file in $SYSCONFDIR directory with following content:

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

    and edit it as you prefer.

    Edit sympa.conf to add following lines (Note: replace $SYSCONFDIR below):

    sendmail_aliases $SYSCONFDIR/sympa_transport
    aliases_program postmap
    aliases_db_type hash

    By these settings, sympa_transport file will be updated automatically when any lists are created, closed, restored or purged.

  3. Create empty map files (Note: replace $SYSCONFDIR below):

    # touch $SYSCONFDIR/transport.sympa
    # touch $SYSCONFDIR/virtual.sympa
    # touch $SYSCONFDIR/sympa_transport
    # chmod 644 $SYSCONFDIR/sympa_transport
    # chown sympa:sympa $SYSCONFDIR/sympa_transport

    and create databases (Note: replace $SYSCONFDIR):

    # postmap hash:$SYSCONFDIR/transport.sympa
    # postmap hash:$SYSCONFDIR/virtual.sympa


    • With steps above, sympa_transport file is world-readable and people may know all of the names of existing lists. To prevent it, follow the steps below after the steps above:
      # chmod 640 $SYSCONFDIR/sympa_transport $SYSCONFDIR/sympa_transport.db
      # chgrp postfix $SYSCONFDIR/sympa_transport $SYSCONFDIR/sympa_transport.db
      where postfix is the group the service processes of Postfix belong to.
  4. Edit Postfix file to add transport definitions (Note: replace $LIBEXECDIR below):

    sympa   unix    -       n       n       -       -       pipe
      flags=hqRu null_sender= user=sympa argv=$LIBEXECDIR/queue ${nexthop}
    sympabounce unix -      n       n       -       -       pipe
      flags=hqRu null_sender= user=sympa argv=$LIBEXECDIR/bouncequeue ${nexthop}

    A few notes:

    • flags attribute has to contain R. F is unnecessary.
    • null_sender attribute with empty value is required for Postfix 2.3 or later.
  5. Edit Postfix file to add configuration for virtual domains (Note: replace $SYSCONFDIR below):

    # virtual(8) maps
    virtual_mailbox_domains = (...existing parameter value...),
    virtual_mailbox_maps = (...existing parameter value...),
    # virtual(5) maps
    virtual_alias_maps = (...existing parameter value...),
    # transport maps
    transport_maps = (...existing parameter value...),
    # For VERP
    recipient_delimiter = +


    • If mydestination parameter in file includes the virtual domain listed in virtual_mailbox_domains, Postfix outputs warnings to system log. Remove virtual domain(s) from mydestination.

Adding new domain

Steps in this section have to be done every time the new domain is added.

  1. Create directories for virtual domain configurations (Note: replace $SYSCONFDIR, $EXPLDIR and below):

    # mkdir -m 755 $SYSCONFDIR/
    # touch $SYSCONFDIR/
    # chown -R sympa:sympa $SYSCONFDIR/
    # mkdir -m 750 $EXPLDIR/
    # chown sympa:sympa $EXPLDIR/
  2. If you want to override global settings in sympa.conf (such as lang) by each domain, you can add it to robot.conf file above.

  3. If Sympa services have already been running, reload them (see "Reloading Sympa services").

  4. Add following contents to transport.sympa and virtual.sympa files and edit them as you prefer (Note: replace below).

    transport.sympa:                error:User unknown in recipient table

    virtual.sympa:  postmaster@localhost    postmaster@localhost


    • If you want some addresses of to be excluded from mailing list service, you can add them to these files.

    Then, update databases for transport map and virtual alias map (Note: replace $SYSCONFDIR below):

    # postmap hash:$SYSCONFDIR/transport.sympa
    # postmap hash:$SYSCONFDIR/virtual.sympa
  5. Reload Postfix. Then test configuration according to instruction.

Single domain setting

  1. Edit sympa.conf to add following lines (Note: replace

    aliases_program postalias
    sendmail /usr/local/sbin/sendmail  (If path is differ from the default)
  2. Save following excerpt as aliases.sympa.postfix file in $SYSCONFDIR and edit it as you prefer (Note: replace $LIBEXECDIR and below):

    # Service aliases for Sympa.
    sympa:                 "| $LIBEXECDIR/queue"
    listmaster:            "| $LIBEXECDIR/queue"
    bounce:                "| $LIBEXECDIR/bouncequeue"
    abuse-feedback-report: "| $LIBEXECDIR/bouncequeue"
    sympa-request:         postmaster
    sympa-owner:           postmaster
    #listserv:             sympa
    #listserv-request:     sympa-request
    #majordomo:            sympa
    #listserv-owner:       sympa-owner

    If $SENDMAIL_ALIASES file does not exist, create it (Note: replace $SENDMAIL_ALIASES below):

    # chmod 640 $SENDMAIL_ALIASES
    # chown sympa:sympa $SENDMAIL_ALIASES

    and create alias databases (Note: replace $SYSCONFDIR):

    # postalias hash:$SYSCONFDIR/aliases.sympa.postfix
  3. Edit Postfix file (Note: replace $SYSCONFDIR, $SENDMAIL_ALIASES and below):

    mydestination = (...existing parameter value...),
    alias_maps = (...existing parameter value...),
    alias_database = (...existing parameter value...),
    recipient_delimiter = +
  4. Reload Postfix. Then test configuration according to instruction.

Top of Page