{"id":36492626,"url":"https://github.com/csmith/contact-form","last_synced_at":"2026-01-12T01:57:24.404Z","repository":{"id":38463305,"uuid":"181348177","full_name":"csmith/contact-form","owner":"csmith","description":"Simple go service to serve and handle a contact form","archived":false,"fork":false,"pushed_at":"2025-11-26T11:55:18.000Z","size":224,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-29T10:15:44.608Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csmith.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-14T17:58:20.000Z","updated_at":"2025-11-27T18:31:45.000Z","dependencies_parsed_at":"2023-02-18T02:20:30.526Z","dependency_job_id":"c5da2b3f-0fec-4df9-ad0f-17b8682c95d4","html_url":"https://github.com/csmith/contact-form","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":0.4385964912280702,"last_synced_commit":"2b567f0691a5065cbce4cd3c024c83d52019a2f9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/csmith/contact-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmith%2Fcontact-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmith%2Fcontact-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmith%2Fcontact-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmith%2Fcontact-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csmith","download_url":"https://codeload.github.com/csmith/contact-form/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmith%2Fcontact-form/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-12T01:57:23.790Z","updated_at":"2026-01-12T01:57:24.398Z","avatar_url":"https://github.com/csmith.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Go contact form\n\n== About\n\nProvides a simple, tiny webservice that serves a contact form and sends responses\nvia e-mail.\n\nimage:example-form.png[Example contact form] -\u003e\nimage:example-email.png[Example email message]\n\n== Usage\n\nThe simplest way to use this is via docker. See the `examples` directory for some\nexample docker-compose files. The latest stable version of this project is published\nat `ghcr.io/csmith/contact-form:latest`.\n\nYou should place this service behind an TLS-terminating proxy such as Caddy or Traefik,\nand ensure it is requested over a secure connection.\n\n== Parameters\n\nThe application can be configured either using command line arguments\nor environmental variables (shown in square brackets, below).\n_from_, _to_, _smtp-host_, _smtp-user_, and _smtp-pass_ are required;\nother options have vaguely sensible fallbacks.\n\n----\n  -csrf-trusted-origins string\n    \t[CONTACT_CSRF_TRUSTED_ORIGINS] Comma-separated list of trusted origins to bypass CSRF checks\n  -enable-captcha\n    \t[CONTACT_ENABLE_CAPTCHA] Whether to require captchas to be completed\n  -enable-health-check\n    \t[CONTACT_ENABLE_HEALTH_CHECK] Whether to expose health checks at /_health\n  -from string\n    \t[CONTACT_FROM] address to send e-mail from\n  -log.format string\n    \t[CONTACT_LOG_FORMAT] Format of log output ('json' or 'text') (default \"text\")\n  -log.level string\n    \t[CONTACT_LOG_LEVEL] Lowest level of logs that should be output\n  -oopspam-apikey string\n    \t[CONTACT_OOPSPAM_APIKEY] API key to use for OOPSpam (disabled if not set)\n  -oopspam-block-dc\n    \t[CONTACT_OOPSPAM_BLOCK_DC] Whether to block messages routed from data centre IP ranges\n  -oopspam-block-temp-email\n    \t[CONTACT_OOPSPAM_BLOCK_TEMP_EMAIL] Whether to block temporary email addresses\n  -oopspam-block-vpn\n    \t[CONTACT_OOPSPAM_BLOCK_VPN] Whether to block messages routed via VPN providers\n  -oopspam-check-for-length\n    \t[CONTACT_OOPSPAM_CHECK_FOR_LENGTH] Whether to check minimum message length (default true)\n  -oopspam-error-handler string\n    \t[CONTACT_OOPSPAM_ERROR_HANDLER] What to do if OOPSpam check errors (captcha, allow, deny) (default \"deny\")\n  -oopspam-spam-handler string\n    \t[CONTACT_OOPSPAM_SPAM_HANDLER] What to do if OOPSpam detects spam (captcha, allow, deny) (default \"deny\")\n  -oopspam-url-friendly\n    \t[CONTACT_OOPSPAM_URL_FRIENDLY] Whether to reduce the impact of links on spam score\n  -port int\n    \t[CONTACT_PORT] port to listen on for connections (default 8080)\n  -session-path string\n    \t[CONTACT_SESSION_PATH] Path to persist session information (default \"./sessions.db\")\n  -smtp-host string\n    \t[CONTACT_SMTP_HOST] SMTP server to connect to\n  -smtp-pass string\n    \t[CONTACT_SMTP_PASS] password to supply to the SMTP server\n  -smtp-port int\n    \t[CONTACT_SMTP_PORT] port to use when connecting to the SMTP server (default 25)\n  -smtp-user string\n    \t[CONTACT_SMTP_USER] username to supply to the SMTP server\n  -subject string\n    \t[CONTACT_SUBJECT] e-mail subject (default \"Contact form submission\")\n  -to string\n    \t[CONTACT_TO] address to send e-mail to\n----\n\nYou can use any SMTP server; however I recommend using a dedicated service\nsuch as https://www.mailgun.com/[mailgun] or\nhttps://aws.amazon.com/ses/[AWS SES], both of which you can access over SMTP.\n\n== Templates\n\nAll templates are loaded from the `templates` directory, which is expected to\nbe in the current working directory. The form itself is loaded from `form.html`;\nsuccess and failure pages from `success.html` and `failure.html` respectively.\nIf captcha support is enabled, the captcha page is loaded from `captcha.html`.\nEach page is loaded as a https://golang.org/pkg/html/template/[go html.template] and\ncan use the templating syntax described there.\n\nAny query parameters passed to the form will be accessible through the `{{ .params }}` template field. The\ndefault template will include all parameters as hidden fields in the form.\n\nIf the form contains a field named `from`, it will be used in the `Reply-To` header,\nand included in log messages to help trace issues. Otherwise, no\nspecial processing is applied to any field; they are all simply written out to the message body.\nNo server-side validation is performed.\n\nWhen running from the docker image, templates are stored in `/templates`; you can\nreplace this with a volume to supply custom templates.\n\n== Static files\n\nAny files in the `static` directory will be served under the path `/static/`.\nBy default that is just a single stylesheet (`style.css`) that is used by the\ndefault templates.\n\nWhen running from the docker image, static files are stored in `/static`; you can\nreplace this with a volume to supply custom files.\n\n== OOPSpam\n\nOptional https://www.oopspam.com/[OOPSpam] integration can be enabled by setting\nthe `oopspam-apikey` flag (or `CONTACT_OOPSPAM_APIKEY` env var). By default if\nthe request to OOPSpam fails (e.g. because of server issues, or exceeding the\nrate limits) the contact attempt will be failed. You can change this with the\n`oopspam-error-handler` flag (or `CONTACT_OOPSPAM_ERROR_HANDLER` env var):\n`allow` will just send the message, `captcha` will present a captcha challenge.\n\nMessages with a score greater than or equal to 3 are considered spam, and\nthe behaviour in the `oopspam-spam-handler` flag (or\n`CONTACT_OOPSPAM_SPAM_HANDLER` env var) will determine what happens next. The\ndefault behaviour is to deny the request.\n\nThe `enable-captcha` setting is ignored if OOPSpam is enabled. Captchas will\nbe presented if the error handler or spam handler has the value `captcha`\notherwise they won't be.\n\nIf present, the `X-Forwarded-For` header will be used to determine the client's\nIP address. This is not validated in any way. It is assumed that the contact\nfor is hosted behind a TLS-terminating proxy that will ensure this header is\npassed on with valid data.\n\n== Health checks\n\nIf the `-enable-health-check` flag is present, a healthcheck endpoint will be exposed at `/_health`.\nThis implements the https://tools.ietf.org/id/draft-inadarei-api-health-check-04.html[draft-inadarei-api-health-check-04]\nspecification. Any application error that occurs when sending a mail or generating a captcha will\nresult in a failing health check until the same operation succeeds again.\n\nNote that the health check exposes error messages, which could potentially contain information\nabout the configuration of the service or parts of messages being sent. If this is a concern you\nmay wish to restrict access to the URL.\n\n== Credits\n\nDeveloped by https://chameth.com[Chris Smith]; CSS heavily based on the login form in\n https://github.com/greboid/ig[ig] by https://greboid.com[Greg Holmes].\n\nCaptchas are implemented using the https://github.com/dchest/captcha[dchest/captcha] library.\nHealth checks are implemented using https://github.com/nelkinda/health-go[nelkinda/health-go].\n\n== Licence\n\nThis software is licensed under the MIT licence. See the LICENCE.adoc file for the full text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsmith%2Fcontact-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsmith%2Fcontact-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsmith%2Fcontact-form/lists"}