7 Configuration
Kailash Nadh edited this page 2020-05-13 08:33:01 +05:30

Configuration

Run ./listmonk --new-config to generate a new sample configuration file, config.toml.

Customization

All the static assets including templates for public pages and system generated e-mails are bundled into the binary. However, ./listmonk --static-dir=your/custom/path allows loading an external directory of static pages. To customize, copy the static directory to a local directory, customize the templates, and pass the path to listmonk using the --static-dir flag.

Throughput and speed

To achieve maximum throughput increase the app.concurrency and app.message_rate parameters in the config file. app.concurrency (number of thread-workers) * app.message_rate (max messages per second per worker) is the maximum number of messages that listmonk will push out to one or more SMTP servers, as long as the SMTP servers are able to process the workload.

Environment variables

Config keys in config.toml can also be provided to listmonk as environment variables prefixed by LISTMONK_ and periods are replaced by __ (double underscore). Example:

LISTMONK_db__host = "localhost"
LISTMONK_db__password = "xxxx"

List of environment variables

  • LISTMONK_app__address: Interface and port where the app will run its webserver. Default: "0.0.0.0:9000"

  • LISTMONK_app__root: Public root URL of the listmonk installation that'll be used in the messages for linking to images, unsubscribe page etc. Default: "https://listmonk.mysite.com"

  • LISTMONK_app__logo_url: (Optional) full URL to the static logo to be displayed on user facing view such as the unsubscription page. eg: https://mysite.com/images/logo.svg. Default: "https://listmonk.mysite.com/public/static/logo.png"

  • LISTMONK_app__favicon_url: (Optional) full URL to the static favicon to be displayed on user facing view such as the unsubscription page. eg: https://mysite.com/images/favicon.png. Default: "https://listmonk.mysite.com/public/static/favicon.png"

  • LISTMONK_app__from_email: The default 'from' e-mail for outgoing e-mail campaigns. Default: "listmonk <from@mail.com>"

  • LISTMONK_app__notify_emails: List of e-mail addresses to which admin notifications such as import updates, campaign completion, failure etc. should be sent. To disable notifications, set an empty list, eg: notify_emails = []. Default: ["admin1@mysite.com", "admin2@mysite.com"]

  • LISTMONK_app__concurrency: Maximum concurrent workers that will attempt to send messages simultaneously. This should depend on the number of CPUs the machine has and also the number of simultaenous e-mails the mail server will. Default: "100"

  • LISTMONK_app__max_send_errors: The number of errors (eg: SMTP timeouts while e-mailing) a running campaign should tolerate before it is paused for manual investigation or intervention. Set to 0 to never pause. Default: "1000"

  • LISTMONK_app__allow_blacklist: Allow subscribers to unsubscribe from all mailing lists and mark themselves as blacklisted? Default: "false"

  • LISTMONK_app__allow_export: Allow subscribers to export data recorded on them? Default: "false"

  • LISTMONK_app__exportable: Items to include in the data export. [profile] Subscriber's profile including custom attributes [subscriptions] Subscriber's subscription lists (private list names are masked) [campaign_views] Campaigns the subscriber has viewed and the view counts [link_clicks] Links that the subscriber has clicked and the click counts. Default: ["profile", "subscriptions", "campaign_views", "link_clicks"]

  • LISTMONK_app__allow_wipe: Allow subscribers to delete themselves from the database? This deletes the subscriber and all their subscriptions. Their association to campaign views and link clicks are also removed while views and click counts remain (with no subscriber associated to them) so that stats and analytics aren't affected. Default: "false"

  • LISTMONK_db__host: Allows you to set the Postgres host path. Default: "demo-db"

  • LISTMONK_db__port: Set the port for the Postgres connection. Default: "5432"

  • LISTMONK_db__user: Set the username for the Postgres connection. Default: "listmonk"

  • LISTMONK_db__password: Set the password for the Postgres connection. Default: "listmonk"

  • LISTMONK_db__database: Set the database name for the Postgres connection. Default: "listmonk"

  • LISTMONK_db__ssl_mode: Set the SSL mode connection. Default: "disable"

  • LISTMONK_db__max_open: Maximum active connections to pool. Default: "50"

  • LISTMONK_db__max_idle: Maximum idle connections to pool. Default: "10"

Specifying Multiple SMTP servers allows listmonk to send emails using multiple SMTP servers for increasing throughput.

  • LISTMONK_smtp__my0__enable: Enable or disable this SMTP account. Default: "true"

  • LISTMONK_smtp__my0__host: Allows you to set the host for the SMTP gateway. Default: "my.smtp.server"

  • LISTMONK_smtp__my0__port: Allows you to set the port for the SMTP gateway. Default: "25"

  • LISTMONK_smtp__my0__auth_protocol: Authentication type (cram | plain | empty for no auth). Default: "cram"

  • LISTMONK_smtp__my0__username: Allows you to set the username for the SMTP gateway. Default: "xxxx"

  • LISTMONK_smtp__my0__password: Set the password for the SMTP gateway. Default: ""

  • LISTMONK_smtp__my0__hello_hostname: Optional. Some SMTP servers require a FQDN in the hostname. By default, HELLOs go with "localhost". Set this if a custom hostname should be used. Default: ""

  • LISTMONK_smtp__my0__send_timeout: Maximum time (milliseconds) to wait per e-mail push. Default: "5000"

  • LISTMONK_smtp__my0__max_conns: Maximum concurrent connections to the SMTP server. Default: "10"

  • LISTMONK_smtp__postal__enable: Enable or disable this SMTP account. Default: "false"

  • LISTMONK_smtp__postal__host: Allows you to set the host for the SMTP gateway. Default: "my.smtp.server2"

  • LISTMONK_smtp__postal__port: Allows you to set the port for the SMTP gateway. Default: "25"

  • LISTMONK_smtp__postal__auth_protocol: Authentication type (cram | plain | empty for no auth). Default: "plain"

  • LISTMONK_smtp__postal__username: Allows you to set the username for the SMTP gateway. Default: "xxxx"

  • LISTMONK_smtp__postal__password: Set the password for the SMTP gateway. Default: ""

  • LISTMONK_smtp__postal__hello_hostname: Optional. Some SMTP servers require a FQDN in the hostname. By default, HELLOs go with "localhost". Set this if a custom hostname should be used. Default: ""

  • LISTMONK_smtp__postal__send_timeout: Maximum time (milliseconds) to wait per e-mail push. Default: "5000"

  • LISTMONK_smtp__postal__max_conns: Maximum concurrent connections to the SMTP server. Default: "10"

Upload settings

  • LISTMONK_upload__provider: Provider which will be used to host uploaded media. Bundled providers are "filesystem" and "s3". Default: "filesystem"

S3 Provider settings

  • LISTMONK_upload__s3__aws_access_key_id: (Optional). AWS Access Key and Secret Key for the user to access the bucket. Leaving it empty would default to use instance IAM role. Default: ""

  • LISTMONK_upload__s3__aws_secret_access_key: Allows you to set the s3 AWS seceret access key. Default: ""

  • LISTMONK_upload__s3__aws_default_region: AWS Region where S3 bucket is hosted. Default: "ap-south-1"

  • LISTMONK_upload__s3__bucket: Specify bucket name. Default: ""

  • LISTMONK_upload__s3__bucket_path: Path where the files will be stored inside bucket. Empty value ("") means the root of bucket. Default: ""

  • LISTMONK_upload__s3__bucket_type: Bucket type can be "private" or "public". Default: "public"

  • LISTMONK_upload__s3__expiry: (Optional) Specify TTL (in seconds) for the generated presigned URL. Expiry value is used only if the bucket is private. Default: "86400"

Filesystem provider settings

  • LISTMONK_upload__filesystem__upload_path: Path to the uploads directory where media will be uploaded. Leaving it empty ("") means current working directory. Default: ""
  • LISTMONK_upload__filesystem__upload_uri: Upload URI that's visible to the outside world. The media uploaded to upload_path will be made available publicly under this URI, for instance, list.yoursite.com/uploads. Default: "/uploads"