Configure mail server: OpenSMTPD
Requirements
-
A mail domain name for the mailing list service. See also “Requirements”.
In the instructions below,
mail.example.orgwill be used for example. -
If you are planning to use message tracking feature, smtpc. See the description to get and install it.
Sympa configuration parameters
-
This parameter must be set to full path to makemap(1) utility bundled in OpenSMTPD:
aliases_program /path/to/makemapNote that setting a keyword
makemapwill not work. -
- If you are planning to use
message tracking
feature, add these lines:
sendmail /path/to/sympa_smtpc sendmail_args --esmtp localhostNote that smtpd daemon must listen on
localhost. - Otherwise, add this line:
sendmail /path/to/sendmailIf the full path to sendmail(1) utility bundled in OpenSMTPD is the same as default of Sympa,
/usr/sbin/sendmail, the line above may not be added.
- If you are planning to use
message tracking
feature, add these lines:
Setup
Initial setting
Steps in this section may be done once at the first time.
- Edit
sympa.confto add parameters described in the section above, for example:aliases_program /path/to/makemap sendmail /path/to/sendmailThen create
list_aliases.tt2file in$SYSCONFDIRdirectory with following content, and edit it as you prefer (Note: replace$LIBEXECDIRbelow):#--- [% list.name %]@[% list.domain %]: list virtual table created at [% date %] [% list.name %]@[% list.domain %] "| $LIBEXECDIR/queue [% list.name %]@[% list.domain %]" [% list.name %]-request@[% list.domain %] "| $LIBEXECDIR/queue [% list.name %]-request@[% list.domain %]" [% list.name %]-editor@[% list.domain %] "| $LIBEXECDIR/queue [% list.name %]-editor@[% list.domain %]" #[% list.name %]-subscribe@[% list.domain %] "| $LIBEXECDIR/queue [% list.name %]-subscribe@[%list.domain %]" [% list.name %]-unsubscribe@[% list.domain %] "| $LIBEXECDIR/queue [% list.name %]-unsubscribe@[% list.domain %]" [% list.name %][% return_path_suffix %]@[% list.domain %] "| $LIBEXECDIR/bouncequeue [% list.name %]@[% list.domain %]"By these settings,
$SENDMAIL_ALIASESfile will be updated automatically when any lists are created, closed, restored or purged. - Create empty virtual tables (Note:
replace
$SYSCONFDIRand$SENDMAIL_ALIASESbelow):# touch $SYSCONFDIR/sympa_domain_aliases # chmod 644 $SYSCONFDIR/sympa_domain_aliases # touch $SENDMAIL_ALIASES # chmod 640 $SENDMAIL_ALIASES # chown sympa:smtpd $SENDMAIL_ALIASESand create databases (Note: replace
$SYSCONFDIRbelow):# makemap $SYSCONFDIR/sympa_domain_aliases # sympa_newaliases.plNote that table files must be readable by smtpd (at least by
smtpdgroup). - Edit OpenSMTPD
smtpd.conffile to add configuration for virtual domains (Note: replace$SYSCONFDIRand$SENDMAIL_ALIASESbelow):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 { "mail.example.org" } 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.
- Create directories for virtual domain configurations (Note:
replace
$SYSCONFDIR,$EXPLDIRandmail.example.orgbelow):# mkdir -m 755 $SYSCONFDIR/mail.example.org # touch $SYSCONFDIR/mail.example.org/robot.conf # chown -r sympa:sympa $SYSCONFDIR/mail.example.org # mkdir -m 750 $EXPLDIR/mail.example.org # chown sympa:sympa $EXPLDIR/mail.example.org -
If you want to override global settings in
sympa.conf(such aslang) by each domain, you can add it torobot.confabove. -
If Sympa services have already been running, reload them (see “Reloading Sympa services”).
- Edit
smtpd.conffile to add the new domain tosympa_domainstable:... table sympa_domains { ...existing domains..., "mail.example.org" } ... - Add following content to
sympa_domain_aliasesfile and edit them as you prefer (Note: replace$LIBEXECDIRandmail.example.orgbelow):sympa@mail.example.org "| $LIBEXECDIR/queue sympa@mail.example.org" listmaster@mail.example.org "| $LIBEXECDIR/queue listmaster@mail.example.org" bounce@mail.example.org "| $LIBEXECDIR/bouncequeue sympa@mail.example.org" abuse-feedback-report@mail.example.org "| $LIBEXECDIR/bouncequeue sympa@mail.example.org" sympa-request@mail.example.org postmaster@ sympa-owner@mail.example.org postmaster@ #listserv@mail.example.org sympa@mail.example.org #listserv-request@mail.example.org sympa-request@mail.example.org #majordomo@mail.example.org sympa@mail.example.org #listserv-owner@mail.example.org sympa-owner@mail.example.orgThen, update database for virtual table (Note: replace
$SYSCONFDIRbelow):# makemap $SYSCONFDIR/sympa_domain_aliases - Reload OpenSMTPD. Then test configuration according to instruction.