If you expect a ready to use SMTP server, you need both the Pliant SMTP server and a sample /etc/pliant/mail or /pliant_security/mail file (see samples below).
pliant module /pliant/protocol/smtp/server.pli command smtp_server
The Pliant confidential configurations files can be stored in /pliant_security/ or /etc/pliant/ directory (these paths refer to the operating system root, not to Pliant root).
The default access control files for the SMTP server is named mail.
The access control control file is a pliant program that decides if the submitted mail is accepted, and where it must be stored.
constant mycorp_domain "mycorp.com"
constant mycorp_ip "10.0.0.0/255.0.0.0"
constant mycorp_mails_path "/mycorp/mail/"
if (to parse any:(var Str user) "@" any:(var Str domain)) and domain=mycorp_domain
# the mail is for a user inside our domain
if (file_query mycorp_mails_path+user+"/" standard)=defined and user<>"forward" and user<>"archive"
# the mailbox directory exists
# we also have a mail archives directory
archive mycorp_mails_path+"archive/"+(string received_on:year)+(right (string received_on:month) 2 "0")+"/"+(right (string received_on:day) 2 "0")+"/"
reject "There is no "+to+" mailbox here"
# the mail is for a user outside our domain
if (ip is_inside_ip_domain mycorp_ip) or (ip is_inside_ip_domain "127.0.0.0/255.255.255.0")
# the client was in our domain, so we are not an open relay
reject "This is not an open relay"
The control function is called saveral times while the client provides informations to the server.If the mail has several recipients, the control function will be called several times with stage=stage_to.