Skip to Content.
Sympa Menu

Configure mail server: OpenSMTPD


Sympa configuration parameters


Initial setting

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

  1. Edit sympa.conf to add parameters described in the section above, for example:
    aliases_program /path/to/makemap
    sendmail /path/to/sendmail

    Then create list_aliases.tt2 file in $SYSCONFDIR directory with following content, and edit it as you prefer (Note: replace $LIBEXECDIR below):

    #--- [% %]@[% list.domain %]: list virtual table created at [% date %]
    [% %]@[% list.domain %]               "| $LIBEXECDIR/queue [% %]@[% list.domain %]"
    [% %]-request@[% list.domain %]       "| $LIBEXECDIR/queue [% %]-request@[% list.domain %]"
    [% %]-editor@[% list.domain %]        "| $LIBEXECDIR/queue [% %]-editor@[% list.domain %]"
    #[% %]-subscribe@[% list.domain %]    "| $LIBEXECDIR/queue [% %]-subscribe@[%list.domain %]"
    [% %]-unsubscribe@[% list.domain %]   "| $LIBEXECDIR/queue [% %]-unsubscribe@[% list.domain %]"
    [% %][% return_path_suffix %]@[% list.domain %] "| $LIBEXECDIR/bouncequeue [% %]@[% list.domain %]"

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

  2. Create empty virtual tables (Note: replace $SYSCONFDIR and $SENDMAIL_ALIASES below):
    # touch $SYSCONFDIR/sympa_domain_aliases
    # chmod 644 $SYSCONFDIR/sympa_domain_aliases
    # chmod 640 $SENDMAIL_ALIASES
    # chown sympa:smtpd $SENDMAIL_ALIASES

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

    # makemap $SYSCONFDIR/sympa_domain_aliases

    Note that table files must be readable by smtpd (at least by smtpd group).

  3. Edit OpenSMTPD smtpd.conf file to add configuration for virtual domains (Note: replace $SYSCONFDIR and $SENDMAIL_ALIASES below):
    table sympa db:$SYSCONFIDR/sympa_domain_aliases.db
    accept from any for any recipient <sympa> virtual <sympa>
    table lists db:$SENDMAIL_ALIASES.db
    accept from any for any recipient <lists> virtual <lists>
    # Here may be the rules for addresses excluded from mailing list service.
    table sympa_domains { "" }
    reject from any for domain <sympa_domains>

    Note: In the configuration above, brackets <> and their contents are not examples: They have to be typed as shown.

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 above.

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

  4. Edit smtpd.conf file to add the new domain to sympa_domains table:
    table sympa_domains { ...existing domains..., "" }
  5. Add following content to sympa_domain_aliases file and edit them as you prefer (Note: replace $LIBEXECDIR and below):             "| $LIBEXECDIR/queue"        "| $LIBEXECDIR/queue"            "| $LIBEXECDIR/bouncequeue" "| $LIBEXECDIR/bouncequeue"     postmaster@       postmaster@

    Then, update database for virtual table (Note: replace $SYSCONFDIR below):

    # makemap $SYSCONFDIR/sympa_domain_aliases
  6. Reload OpenSMTPD. Then test configuration according to instruction.
Top of Page