1# Table chaining23The table.chain module allows chaining together multiple table modules4by using value returned by a previous table as an input for the second5table.67Example:8```9table.chain {10 step regexp "(.+)(\\+[^+"@]+)?@example.org" "$1@example.org"11 step file /etc/maddy/emails12}13```14This will strip +prefix from mailbox before looking it up15in /etc/maddy/emails list.1617## Configuration directives1819### step _table_2021Adds a table module to the chain. If input value is not in the table22(e.g. file) - return "not exists" error.2324---2526### optional_step _table_2728Same as step but if input value is not in the table - it is passed to the29next step without changes.3031Example:32Something like this can be used to map emails to usernames33after translating them via aliases map:3435```36table.chain {37 optional_step file /etc/maddy/aliases38 step regexp "(.+)@(.+)" "$1"39}40```41