Copyright 2026 Hidekazu Konishi (https://hidekazu-konishi.com/)

This product includes software developed by Hidekazu Konishi
(https://hidekazu-konishi.com/).

Licensed under the Gratilaus Attribution License, Version 1.0 (the "License");
you may not use these files except in compliance with the License. You may
obtain a copy of the License in the accompanying LICENSE file. The License is
derived from the Apache License, Version 2.0, and differs from it: Section 4A
requires a credit on websites whose forms this software processes.

Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.


===============================================================================
THE CREDIT (LICENSE, SECTION 4A)
===============================================================================

If you Publish a website whose forms this backend processes, or that includes
`frontend/mailform.js` (or any part of it), the pages that contain such a form
or load mailform.js (directly, through another script, or as a bundled,
minified or renamed copy; markup and styles copied from examples/contact.html
count as part of it) have to show a credit. (A site that also includes other
front-end files of a work under the License, such as a site built with
Gratilaus Site, shows it on every page; Gratilaus Site does that in its
footer.) The credit contains "Gratilaus" and "H.K." (Hidekazu Konishi, the
author), written as they are, with a link whose text includes "H.K." or
"Gratilaus" and that points to https://hidekazu-konishi.com/. It has to be
visible in the page as delivered, on every screen size and color scheme the
page supports and without a click or hover, not hidden by your CSS or scripts,
no smaller than the smallest other text around it, and with a contrast of at
least 4.5:1 against its background (WCAG 2.2, 1.4.3). Its link has to work: a
visitor who follows it reaches https://hidekazu-konishi.com/. Nothing in this
project adds the credit
to your pages for you; put it under the form, as examples/contact.html does:

    <p class="mailform-credit">Gratilaus Form by
    <a href="https://hidekazu-konishi.com/" rel="nofollow">H.K.</a></p>

It does not have to be under the form: if every page with the form already
shows a credit that meets these rules (for example, "Built with Gratilaus by
H.K." in your own footer), you need no second line.

You may reword or translate the credit and add your own words, keeping
"Gratilaus" and "H.K." as they are, as long as the result does not disparage
the software or its author and does not state or imply that the author
endorses, sponsors or is responsible for your site. The rel attribute of the
link is your choice; rel="nofollow" is recommended.

One credit that contains "Gratilaus" counts for every work released under the
License with the same attribution URL on the same site, on each page where it
is shown: a site built with Gratilaus Site already shows one in the footer of
every page, form pages included. A credit shown only on the form page does not
cover the other pages of such a site.

Exemption: no credit is needed while a page of the site that visitors can reach
from the home page by following links, without signing in, visibly shows a
link to https://hidekazu-konishi.com/ whose text is exactly
"hidekazu-konishi.com", or an image link that shows the image given in Exhibit
A of the License, unaltered and at least 32 by 32 CSS pixels, with alternative
text that includes "hidekazu-konishi.com" (you may host your own copy of the
image). The size, contrast and wording rules of the credit apply to that link
too, the link has to work, and its rel attribute is your choice.

A site is not "Published" in the License's sense, and needs no credit yet,
while only the people who build, maintain, test, review or approve it, or only
your own employees and contractors (on an intranet, for example), can use it,
and it requires signing in, is reachable only through a private network or a
VPN, or is marked to be excluded from search engines ("noindex", or a
robots.txt rule). A site that is offered or promoted to the public is
published, whatever it is called.

If you run this backend for forms on sites that you do not publish yourself,
tell the people who publish those sites about Section 4A. Until a site
complies, the License treats it as one you publish.

If you hand a site, or its files, to someone else, give them the License and
tell them about Section 4A: from then on the credit is theirs to keep, and you
are not responsible for the site unless you go on publishing it for them, or
did not both give them the License and tell them about Section 4A.

A site that does not comply is not covered by the License for using the
software on or for that site until it complies. The License is not revoked,
and your other uses and the patent grant are not affected. A failure fixed
within 30 days of the author's first notice to you (about any of your sites) is
excused, and so is one you fix before any notice if no notice follows within 60
days; that second route ends once you have been notified about any site. A site
moved to another host name or path counts as the same site, and a notice may
come by any reasonable means, such as email to an address shown on the site or
its contact form.

The author may ask you to remove the credit and the exemption link from a
particular site. From then on, that site needs neither, and from 30 days after
the request you may use the names on that site only as Section 6 of the
License allows.

You may use "Gratilaus", the product names and "H.K." in the credit, in the
exemption link, and to say truthfully that a site or a derivative is built with
or based on this software, but not as, or as part of, the name of your own
product, derivative or site, or in a way that states or implies that the author
endorses, sponsors or is responsible for it. A derivative must not be presented
as released by the author.

If you redistribute this software or a derivative of it, the License has to go
with it unchanged, including Section 4A and Exhibit A, together with this NOTICE
file and the copyright and attribution notices in the source files. Serving
mailform.js to visitors' browsers as part of a site is not redistribution in
this sense, as long as you keep the copyright and license notices in it (or,
if a minifier or bundler removes them, keep them in a file served with the site
that it or its pages refer to). Offering it for download is still
redistribution.


===============================================================================
RESPONSIBILITY FOR WEBSITES
===============================================================================

Whoever publishes a website built with or using this software is responsible
for it and its content. The author is not responsible for websites, services or
content that others build, run or publish with this software, and the credit
does not make the author responsible for them. See Sections 7 and 8 of the
License and the Downloadable Software Disclaimer:
https://hidekazu-konishi.com/entry/privacy_policy.html#downloadable-software-disclaimer


===============================================================================
THIRD-PARTY MATERIAL
===============================================================================

None. Every file in this project is original work.

The Lambda function imports `boto3` / `botocore` (Apache License 2.0), which the
AWS Lambda Python runtime provides. They are not vendored here and are not redistributed by this
project. `requirements.txt` lists them only so local test runs and editors can
resolve the imports.

The CloudFormation template attaches the AWS managed policy
`AmazonAPIGatewayPushToCloudWatchLogs` by ARN. That is a reference to a policy
owned by AWS, not a copy of it.


===============================================================================
RELATIONSHIP TO Gratilaus Site
===============================================================================

`frontend/mailform.js` is the reference client for this backend and the
canonical definition of the request/response contract. The same file also ships
inside Gratilaus Site (and any site generated from it) as
`assets/js/mailform.js`.

They are byte-identical on purpose. `tests/test_contract.py` checks that the
field names in `frontend/mailform.js` and `lambda/handler.py` still agree, so a
rename on one side cannot silently ship. If you change the contract, change
both sides together, and keep any copy of mailform.js in your sites in step.

Neither project is required to use the other. This backend accepts a POST from
any client that speaks the contract; Gratilaus Site's form works against any
endpoint that answers it.
