<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=lYCzn1QolK10N8" style="display:none" height="1" width="1" alt="">

Configuration File

Overview

GreenArrow Engine originally used multiple configuration files, one for each setting in the /var/hvmail/control directory. Now, as new features are added, new configuration parameters are added as directives in /var/hvmail/control/greenarrow.conf. Eventually, all existing GreenArrow configuration files will be replaced with directives in greenarrow.conf, and it will serve as a single master configuration file.

The greenarrow.conf configuration file is a plain-text file (using UTF-8) inspired by the NGINX configuration file format.

A single directive inside of a grouping block looks like this:

general {
  system_max_smtp_connections 5000
}

Some blocks have parameters. For example, this applies a configuration to the “yahoo.com” domain name:

domain yahoo.com {
  reuse_connections yes
}

All lines whose first non-whitespace character is a pound sign (#) are treated as comments.

String Encoding

String values that consist of only letters (a-zA-Z), numbers (0-9), dashes (-), underscores (_), plus signs (+), periods (.), asterisks (*), slashes (/), backslashes (\), square brackets ([ and ]), dollar signs ($), colons (:), semicolons (;), and percentages (%) do not require quotation.

All other string values must be surrounded by quotation marks (") and may contain the same escape codes as JSON string values.

The escape codes are:

\"

Quotation mark

\\

Backslash

\/

Slash

\b

Backspace

\f

Formfeed

Newline

\r

Carriage return

\t

Horizontal tab

\uNNNN

Four hexadecimal digits representing a Unicode codepoint

The following are all valid string values:

example
example.com
other-example123
other_example.900
5000.12
09000
"example with spaces"
"example
with
control\codes
"

Boolean Encoding

Booleans may be specified as yes or no.

Duration Encoding

A time interval may be specified as a sequence of decimal numbers, each with a unit suffix. For example 25h, 300s, or 4h15m. Valid suffixes are s, m, and h.

Localpart Encoding

The localpart is the portion of an email address that appears before the @ sign. For example, the localpart of user@example.com is user. Studio’s Subscriber Record documentation goes into detail on what is valid in a localpart.

Localparts are encoded using the same rules as strings.

Grouping Contexts

The greenarrow.conf configuration file is organized hierarchically as described below:

syntax:
general { other_directives }
context:
top-level

This top-level group contains settings that do not belong in any other group.

syntax:
ip_address ip_address_name [, ... ] { other_directives }
context:
top-level

This grouping contains settings that are specific to one or more IP addresses.

This configuration grouping does not create an IP address VirtualMTA unless define_virtual_mtas_in_config_file is yes. Rather it applies settings to existing IP address VirtualMTAs and the ip_address_name must case-insensitively match the name of an IP address VirtualMTA configured through the web-interface or API.

The special IP address of a single asterisk (*) means that this context block defines settings that apply to all IP addresses in the system. Records defined for a specific IP address name take precedence over records defined for the wildcard * IP address.

For example:

ip_address smtp2, smtp3 {
  ...
}

And:

ip_address * {
  ...
}

syntax:
relay_server relay_server_name [, ... ] { other_directives }
context:
top-level

This grouping contains settings that are specific to one or more SMTP relay servers.

This configuration grouping does not create a relay server unless define_virtual_mtas_in_config_file is yes. Rather it applies settings to existing relay server VirtualMTAs and the relay_server_name must case-insensitively match the name of a relay server configured through the web-interface or API.

For example:

relay_server esp1, esp2 {
  ...
}

Wildcard (*) relay server configurations are not supported.

syntax:
domain domain_name [, ... ] { other_directives }
context:
ip_address

This context exists within an IP address (including the * wildcard entry). It contains settings for one or more remote domains. Specifying an * indicates that the settings shall be used as the default for any remote domain that does not otherwise contain a particular setting.

Domains can be defined with the following wildcards:

  • A domain that is prefixed with [*.] matches the given domain and all subdomains. For example, [*.]example.com matches example.com, subdomain.example.com, and www.subdomain.example.com.
  • A domain that is prefixed with *. matches only subdomains. For example, *.example.com matches subdomain.example.com and www.subdomain.example.com, but will not match example.com.

Settings to use for a domain are checked in this order. The first match is used:

  1. An exact IP name match and an exact domain match
  2. An exact IP name match and the wildcard domain entry
  3. The wildcard IP entry and an exact domain match
  4. The wildcard IP entry and the wildcard domain entry

For example, when looking up delivery to foo.example.com domain strings are searched for in the following order:

foo.example.com
[*.]foo.example.com
*.example.com
[*.]example.com
*.com
[*.]com
*

All name or domain matches are case-insensitive.

If define_virtual_mtas_in_config_file is enabled, the wildcard * may not be combined with any other domain names or wildcards.

ip_address ipaddr-1, ipaddr-2 {
  domain yahoo.com, ymail.com {
    ...
  }
}
ip_address * {
  domain hotmail.com {
    ...
  }
  domain gmail.com, googlemail.com {
    ...
  }
  domain * {
    ...
  }
}

syntax:
routing_rule name [, ... ] { other_directives }
context:
top-level

This context defines a Routing Rule.

The define_virtual_mtas_in_config_file directive must be enabled for this context to take effect.

routing_rule my-routing-rule-name {
  ...
}

syntax:
routing_rule_domain domain_name [, ... ] { other_directives }
context:
routing_rule

This context defines a domain rule within a Routing Rule.

The define_virtual_mtas_in_config_file directive must be enabled for this context to take effect.

Each routing_rule is required to have at least a routing_rule_domain for the * domain.

The wildcard * may not be combined with any other domain names or wildcards.

routing_rule my-routing-rule-name {
  routing_rule_domain first.example.com, second.example.com, third.example.com {
    routing_rule_destination foo
  }
  routing_rule_domain alpha.example.com, beta.example.com {
    routing_rule_destination bar
  }
  routing_rule_domain * {
    routing_rule_destination baz
  }
  ...
}

syntax:
virtual_mta_injected name [, ... ] { other_directives }
context:
top-level

This context is for configuration directives that apply to an email based off of the VirtualMTA name used to inject the message. This is the VirtualMTA name provided in the X-GreenArrow-VirtualMTA header or the GREENARROW_MTAID environment variable. This is not necessarily the same as the IP Address or Relay Server used to deliver the message.

For example, in the case where:

  • An email is injected with the VirtualMTA name of shared_pool
  • shared_pool is a Routing Rule that splits email through ip_a and ip_b
  • The actual email delivery is done on ip_a

These settings apply:

  • virtual_mta_injected "shared_pool" { }
    • This matches the injected VirtualMTA name of shared_pool.
  • virtual_mta_injected "*" { }
    • This is the default and, unless overridden by a more precise directive, applies to all messages.
  • virtual_mta "ip_a" { }
    • This is the IP on which the email was delivered.

These settings will not apply:

  • virtual_mta_injected "ip_a" { }
    • The message was injected on shared_pool, not ip_a.
  • virtual_mta "shared_pool" { }
    • The message was delivered on ip_a, not shared_pool.

All name matching is case-insensitive.

If email is injected using the numeric primary key of an IP Address, Relay Server, or Routing Rule, then a virtual_mta_injected block with a name matching the name of the IP Address, Relay Server, or Routing Rule is used.

virtual_mta_injected smtp-1, smtp-2 {
  ...
}

syntax:
database_connection name { other_directives }
context:
top-level

This context defines a Database Connection.

The define_database_connections_in_config_file directive must be enabled for this context to take effect.

database_connection my-database-name {
  ...
}

syntax:
dkim_domain domain_name [, ... ] { other_directives }
context:
top-level

This context defines what DKIM keys are available for the specified domains.

The define_dkim_keys_in_config_file directive must be enabled for this context to take effect.

This context does not support wildcard domains.

dkim_domain example.com, example.net {
  dkim_key ga "/etc/my-keys/ga.pem" default=yes
  dkim_key my-selector "/etc/my-keys/my-selector.pem"
  ...
}

syntax:
url_domain domain_name [, ... ] { other_directives }
context:
top-level

This context defines what URL domains are available.

The define_url_domains_in_config_file directive must be enabled for this context to take effect.

This context does not support wildcard domains.

url_domain example.com, example.net {
  use_ssl yes
}

syntax:
incoming_email_domain domain_name [, ... ] { other_directives }
context:
top-level

This context defines what incoming email domains and mailboxes are available.

The define_incoming_email_domains_in_config_file directive must be enabled for this context to take effect.

Each block supports a single incoming email domain. Any additional domains which you wish to use the same configuration should be specified using the domain_aliases directive.

This context does not support wildcard domains.

incoming_email_domain example.com {
  domain_aliases example.net, example.org
  ...
}

syntax:
user_mailbox localpart [, ... ] { other_directives }

This context defines a mailbox that is authorized to use SMTP AUTH and POP3.

Each block supports a single mailbox. The mailbox_is_wildcard directive allows for wildcards.

incoming_email_domain example.com {
  user_mailbox newsletter {
    mailbox_delivery_mode local
    ...
  }
}

syntax:
forwarding_mailbox localpart [, ... ] { other_directives }

This context defines a forwarding mailbox.

Each block supports a single mailbox. The mailbox_is_wildcard directive allows for wildcards.

incoming_email_domain example.com {
  forwarding_mailbox newsletter {
    mailbox_forward_to "forward@example.com"
    ...
  }
}

syntax:
throttle_program name [, ... ] { other_directives }
context:
top-level

This context defines the configuration for a Throttle Program.

The define_throttle_programs_in_config_file directive must be enabled for this context to take effect.

Each block supports a single throttle program.

throttle_program warmup {
  backoff_max_concurrent_connections 10%
  ....
}

syntax:
mail_class name [, ... ] { other_directives }
context:
top-level

This context defines the configuration for a Mail Class.

The define_mail_classes_in_config_file directive must be enabled for this context to take effect.

Each block supports a single Mail Class.

mail_class orders {
  virtual_mta smtp1
  ....
}

Configuration Directives

Directives are configuration settings that apply a specific option within a context.

syntax:
domain_macro macro_name domain1, domain2 [, ... ]
context:
top-level

This directive creates a macro that may be referenced from the strings/domains provided to a domain directive. See the example below to see how they are used.

domain_macro google gmail.com, googlemail.com
domain_macro microsoft msn, hotmail
domain_macro yahoo yahoo, ymail, rocketmail
domain_macro tlds com, net
ip_address * {
  domain $google {
    ...
  }
  domain $microsoft.com {
    ...
  }
  domain $yahoo.$tlds {
    ...
  }
}

The above example expands to the equivalent configuration below.

ip_address * {
  domain gmail.com, googlemail.com {
    ...
  }
  domain msn.com, hotmail.com {
    ...
  }
  domain yahoo.com, yahoo.net, ymail.com, ymail.net, rocketmail.com, rocketmail.net {
    ...
  }
}

Domain macros must be defined before they are used. If a macro’s definition is changed later in a configuration file, the new definition is used for subsequent directives.

syntax:
include filename
context:
top-level

This directive includes the given file to be parsed as part of the configuration file. This is useful for separating complex configurations into multiple files.

The filename given must be an absolute path (i.e., it must begin with /).

This directive can only be specified at the top-level of a file.

include /usr/local/etc/ga/ip_addresses.conf
include /usr/local/etc/ga/general.conf

Performance Tuning

GreenArrow Studio

The settings in this section pertain to GreenArrow Studio.

syntax:
studio_message_generation_processes_per_campaign integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

The number of message generation processes each campaign should start. Increasing this setting is advisable for systems that tend to send single, large campaigns.

For systems that are sending multiple simultaneous campaigns, this should remain at its default.

general {
  studio_message_generation_processes_per_campaign 2
}

syntax:
studio_workers_shared integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

The number of “shared” workers that are created to send campaigns. If there are no campaigns to send, these workers can also perform imports, exports, and other background jobs – excluding transactional email. Using this along with zero values for studio_workers_general and studio_workers_imports means that if enough campaigns are running, all imports/exports and general tasks will have to wait until the campaigns are done – which is not desirable.

We only recommend using shared workers on very low memory systems, because it is better to have a dedicated number of workers for each type of task.

general {
  studio_workers_shared 2
}

syntax:
studio_workers_campaigns integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

The number of workers that are created exclusively to send campaigns. This should generally be used in favor of studio_workers_shared.

general {
  studio_workers_campaigns 2
}

syntax:
studio_workers_general integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

The number of workers that are created to run other background jobs. These workers handle most background activity in GreenArrow Studio. The things that are not handled by these workers include imports, exports, transactional email, and campaigns.

Examples of general tasks include recording a click to the database and calculating the estimated number of recipients in a campaign.

general {
  studio_workers_general 2
}

syntax:
studio_workers_imports integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

The number of workers that are created to handle imports and exports.

general {
  studio_workers_imports 2
}

syntax:
studio_workers_transactional integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

The number of workers that are created to deliver transactional email - this includes autoresponders, campaign previews, web form confirmation, and any other non-campaign emails sent from GreenArrow Studio.

general {
  studio_workers_transactional 2
}

HTTP Server

The settings in this section are related to the Apache HTTP Server and the Passenger application server.

syntax:
passenger_max_requests_in_queue integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

This sets the PassengerMaxRequestQueueSize directive in Passenger, the maximum number of requests that can sit in Passenger’s queue waiting for an application instance.

To apply changes to this directive, run greenarrow_config reload_apache.

general {
  passenger_max_requests_in_queue 2
}

syntax:
passenger_min_application_instances integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

This sets the PassengerMinInstances directive in Passenger, the minimum number of instances of the application server which handles HTTP/HTTPS requests that should be kept running at any time.

To apply changes to this directive, run greenarrow_config reload_apache.

general {
  passenger_min_application_instances 2
}

syntax:
passenger_max_application_instances integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

This sets the PassengerMaxPoolSize directive in Passenger, the maximum number of instances of the application server which handles HTTP/HTTPS requests that should be kept running at any time. On servers that are not low on memory, we recommend keeping the minimum and maximum equal.

To apply changes to this directive, run greenarrow_config reload_apache.

general {
  passenger_max_application_instances 2
}

syntax:
apache_max_clients integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

This sets the MaxClients and ServerLimit directives in Apache. These limit the number of HTTP/HTTPS sessions that Apache can handle simultaneously.

To apply changes to this directive, run greenarrow_config reload_apache.

general {
  apache_max_clients 2
}

Database Server

syntax:
postgres_max_connections integer
default:
Automatic based upon the available CPU/RAM resources.
context:
general

The maximum number of concurrent connections allowed to be made to the PostgreSQL database server.

To apply changes to this directive, run greenarrow_config reload_postgres.

general {
  postgres_max_connections 200
}

By default, the following equation is used, rounded up to the next 100:

1.25 * (
  100 +
  (6 + studio_message_generation_processes_per_campaign) *
  (studio_workers_shared + studio_workers_campaigns) + 2 *
  (studio_workers_general + studio_workers_imports + studio_workers_transactional) +
  passenger_max_application_instances
)

System Resources

The system resources directives are normally only used to decrease GreenArrow’s view of what resources are available. For example, it could make sense to do that if you’re running non-GreenArrow applications on the same server.

syntax:
system_memory_gigabytes float
default:
The amount of RAM in the system, in gigabytes.
context:
general

This directive overrides GreenArrow’s view of how much RAM exists in this system. This causes dynamic defaults to be set based upon this amount of RAM, instead of the actual amount of RAM.

This does not cause GreenArrow to use more or less RAM, except as an effect of changed dynamic defaults.

general {
  system_memory_gigabytes 8.5
}

syntax:
system_cpu_core_count integer
default:
The number of CPU cores in the system.
context:
general

This directive overrides GreenArrow’s view of how many CPU cores exist in this system. This causes dynamic defaults to be set based upon this number of CPU cores, instead of the actual number of CPU cores.

This does not cause GreenArrow to use more or less CPU, except as an effect of changed dynamic defaults.

general {
  system_cpu_core_count 4
}

SMTP Delivery

The settings in this section control how GreenArrow delivers email via SMTP.

DNS

syntax:
max_dns_queries integer
default:
100
context:
general

The maximum number of concurrent DNS queries that may be executed. It’s extremely uncommon that this value should be changed. Set this to 0 to have no limit.

general {
  max_dns_queries 100
}

Automatic Back-off

syntax:
notify_on_backoff email_address [, ... ]
default:
none
context:
general

Whenever a throttle program begins or ends automatic back-off, these email addresses will receive a notification.

general {
  notify_on_backoff "user-1@example.com", "user2@example.com"
}

The email message when backoff mode begins looks like:

Backoff mode started

Backoff mode will last until 2018-03-21 12:39:07 CDT.

This throttle:

    https://example.com/ga/eui/virtual_mta/eng_throttles/45

IP Address:

    127.0.0.101
    ip-1.example.com
    https://example.com/ga/eui/virtual_mta/ip_addresses/74

Domains:

    first.example.com
    second.example.com
    example.com

Logged information:

    backoff mode began
    failure rate (60/120; 50.00%) exceeds limit of 20%
    combined failure and deferral rate (60/120 failures; 0/120 deferrals; 50.00%) exceeds deferral limit of 30%

The email message when backoff mode ends looks like:

Backoff mode ended

This throttle:

    https://example.com/ga/eui/virtual_mta/eng_throttles/45

IP Address:

    127.0.0.101
    ip-1.example.com
    https://example.com/ga/eui/virtual_mta/ip_addresses/74

Domains:

    first.example.com
    second.example.com
    example.com

Logged information:

    backoff mode ended

Outgoing Connections

syntax:
system_max_smtp_connections integer
default:
10000
context:
general

The maximum number of concurrent SMTP connections that may be established. Set this to 0 to have no limit.

general {
  system_max_smtp_connections 10000
}

syntax:
reuse_connections boolean
default:
no
context:
domain

By default, when sending emails, GreenArrow Engine attempts to deliver one message per SMTP session. This means that if an email provider imposes a limit on how many messages they accept per SMTP session, you don’t need to worry about exceeding that limitation.

For high volume email recipients, you can choose to enable connection reuse to send multiple messages in a single SMTP session. This can offer a significant performance boost when applied to your most common recipient domains.

With this setting enabled, connections are used so long as the previous delivery attempt succeeded. When a delivery attempt ends in any kind of non-acceptance (deferral, failure, or connection error), the connection is closed.

See reuse_connections_timeout and reuse_connections_max_messages to adjust for how long connections are reused.

# Reuse connections to Google on all IP addresses.

ip_address * {
  domain gmail.com, googlemail.com {
    reuse_connections yes
  }
}

syntax:
reuse_connections_timeout time duration
default:
1s
context:
domain

The duration for which the connection should be held open without any delivery attempts.

This value is ignored unless reuse_connections is set to yes.

# Reuse connections on "ip-addr-3" to all domains, allowing the connection to
# idle for up to 2 seconds between deliveries.

ip_address ip-addr-3 {
  domain * {
    reuse_connections yes
    reuse_connections_timeout 2s
  }
}

syntax:
reuse_connections_max_messages integer
default:
100
context:
domain

The maximum number of deliveries that should to attempt on a single open connection before closing.

This value is ignored unless reuse_connections is set to yes.

# Reuse connections on all IPs to all Domains, with a maximum of 500 messages
# per connection.

ip_address * {
  domain * {
    reuse_connections yes
    reuse_connections_max_messages 500
  }
}

Encryption

syntax:
starttls_use boolean
default:
no
context:
domain

When this directive is enabled for a domain (including the * wildcard domain), GreenArrow issues the STARTTLS command to servers that offer it.

If the server replies to STARTTLS with an error, the existing connection is used without TLS - unless starttls_require is enabled.

# Override the default to always try to use STARTTLS if it's available.
ip_address * {
  domain * {
    starttls_use yes
  }
}

# However - on this IP, we don't want to use STARTTLS to Gmail.
ip_address smtp-7 {
  domain gmail.com, googlemail.com {
    starttls_use no
  }
}

syntax:
starttls_require boolean
default:
no
context:
domain

When this directive and starttls_use are both enabled, email is not delivered unless a STARTTLS connection can be established:

  • If the remote server does not offer the STARTTLS command, the type of response is determined by the starttls_require_action directive.

  • If an error occurs while establishing a STARTTLS connection, a temporary failure is returned. This differs from GreenArrow’s standard behavior, which would result in the message being delivered without TLS.

# Override the default to always try to use STARTTLS if it's available.
ip_address * {
  domain * {
    starttls_use yes
  }

  # Don't deliver to Google unless we're in TLS.
  domain gmail.com, googlemail.com {
    starttls_require yes
  }
}

syntax:
starttls_require_action string
default:
perm_fail
context:
domain

When starttls_require is enabled, this directive determines what to do if STARTTLS is unavailable or unsuccessful.

perm_failure

A permanent failure is returned and the message is not retried.

The following message is returned:

Connected to {IP} but STARTTLS is not available, delivery attempt not made. (#5.7.10)

temp_failure

A temporary failure is returned and the message may be retried.

The following message is returned:

Connected to {IP} but STARTTLS is not available, delivery attempt not made. (#4.7.10)

discard

A fake “success” is generated to prevent the message from being retried.

The following message is returned:

Connected to {IP} but STARTTLS is not available, delivery attempt not made. (#2.7.10)

# Override the default to always try to use STARTTLS if it's available.
ip_address * {
  domain * {
    starttls_use yes
  }
}

# Discard email for Yahoo that can't be sent with TLS.
ip_address * {
  domain yahoo.com {
    starttls_require yes
    starttls_require_action discard
  }
}

Overrides

syntax:
delivery_override string
default:
none
context:
domain

Override the delivery.

none

No delivery override occurs.

perm_failure

No delivery attempt occurs; instead, a fake permanent failure is returned:

Delivery attempt prevented by local configuration. (#5.7.1)

temp_failure

No delivery attempt occurs; instead, a fake temporary failure (deferral) is returned:

Delivery attempt prevented by local configuration. (#4.7.1)

discard

No delivery attempt occurs; instead, a fake acceptance is returned:

This message was discarded by local configuration. (#2.7.1)

# Discard all email for Yahoo. Do not attempt delivery.
ip_address * {
  domain yahoo.com {
    delivery_override discard
  }
}

syntax:
smtp_route string
default:
none
context:
domain, relay_server

Override the destination to which email is delivered. The argument may include a port number following a colon. If the port number is not specified, port 25 is assumed.

Formerly, this was accomplished using the /var/hvmail/control/smtproutes file. If that file exists, it is used at a lower precedence than this smtp_route directive.

ip_address * {
  # Deliver all Yahoo mail to localhost port 2500.
  domain yahoo.com {
    smtp_route 127.0.0.1:2500
  }

  # Deliver all Microsoft mail to Google??? That's weird...
  domain msn.com, hotmail.com {
    smtp_route smtp.googlemail.com:25
  }
}

Error Handling

syntax:
message_transfer_timeout_action string
default:
temp_failure
context:
domain

Define what the delivery result should be when the delivery attempt has a connection failure (at either the TCP or SSL layer) or a timeout while the message is transferring. This directive applies until the . is sent, at which point the message_transfer_response_timeout_action directive applies.

perm_failure

A permanent failure is returned and the message is not retried.

The following message is returned:

Connected to {IP} but connection died. (#5.4.2)

temp_failure

A temporary failure is returned and the message may be retried.

The following message is returned:

Connected to {IP} but connection died. (#4.4.2)

discard

A fake “success” is generated to prevent the message from being retried.

The following message is returned:

Connected to {IP} but connection died. (#2.4.2)

ip_address * {
  # Message transfer timeouts shouldn't be retried.
  domain yahoo.com {
    message_transfer_timeout_action perm_failure
  }
}

syntax:
message_transfer_response_timeout_action string
default:
temp_failure
context:
domain

Define what the delivery result should be when the delivery attempt has a connection failure (at either the TCP or SSL layer) or a timeout after the . is sent.

This is the critical period where a timeout or disconnection can cause a duplicate message delivery.

perm_failure

A permanent failure is returned and the message is not retried.

The following message is returned:

Connected to {IP} but connection died. Possible duplicate! (#5.4.2)

temp_failure

A temporary failure is returned and the message may be retried.

The following message is returned:

Connected to {IP} but connection died. Possible duplicate! (#4.4.2)

discard

A fake “success” is generated to prevent the message from being retried.

The following message is returned:

Connected to {IP} but connection died. Possible duplicate! (#2.4.2)

ip_address * {
  domain * {
    message_transfer_response_timeout_action discard
  }
}

DKIM

syntax:
pcompat_dkim_key selector domain private_key_filename
selector

The selector to use in the DKIM signature.

domain_name

Domain name of the key.

private_key_filename

A filename containing a private key in PEM format (must be an absolute path).

This directive is to provide compatibility with the PowerMTA configuration directive domain-key to aid in migrating from PowerMTA to GreenArrow.

This specifies DKIM private keys used by the PowerMTA compatibility DKIM signing system. DKIM keys specified with this directive are not available to use by the X-GreenArrow-DKIM header.

This directive can be specified multiple times to provide multiple DKIM keys that could apply.

What domain name may be used in the signature depends on the pcompat_dkim_identity:

If there IS NOT a pcompat_dkim_identity value defined, then a DKIM key matching one of these domain names is searched for. The first match is used:

  • The domain name specified in a Sender header, if present
  • The domain name specified in the From header

If there IS a pcompat_dkim_identity value defined, then a DKIM key matching this domain name is searched for:

Searching for a DKIM key that matches a domain name is done as follows:

  • Keys defined in an exact-match virtual_mta_injected are searched before keys in a wildcard-matching (*) virtual_mta_injected block.

  • Inside of a matching virtual_mta_injected block, the first key (in the order specified in the configuration file) that contains a domain name matching one of these criteria:

    • Equal to the “search domain name”
    • A parent domain name of the “search domain name” – the domain name specified with DKIM key is used in the DKIM signature
    • A domain of * – the “search domain name” is used in the DKIM signature

Note: because domain names are matched in the order specified in the configuration file, any pcompat_dkim_key record with a domain name of * should be the last pcompat_dkim_key record in the containing virtual_mta_injected block.

virtual_mta_injected ipaddr-1 {
  pcompat_dkim_key selector example.com /path/to/private_key_filename.pem
}

syntax:
pcompat_dkim_sign boolean
default:
no

This is to provide compatibility with the PowerMTA configuration directive dkim-sign to aid in migrating from PowerMTA to GreenArrow.

If enabled, the PowerMTA compatibility DKIM signing system will add a DKIM signature to messages at the time of injection - if a matching DKIM key is found as described in pcompat_dkim_key.

Caveat - The GreenArrow PowerMTA compatibility DKIM signing system signs messages at the time of injection. It appears that PowerMTA signs messages at the time of delivery.

virtual_mta_injected * {
  pcompat_dkim_sign yes
}

syntax:
pcompat_dkim_identity domain

This is to provide compatibility with the PowerMTA configuration directive dkim-identity to aid in migrating from PowerMTA to GreenArrow.

This is used to DKIM sign an email with a domain name that is not the Sender or From header.

For a description of how this is used, see the documentation of the pcompat_dkim_key directive.

virtual_mta_injected * {
  pcompat_dkim_identity example.com
}

Logging

GreenArrow log files are automatically rotated and contain timestamps in external TAI64 format. Refer to the Service Logs documentation for more information on individual log files.

DNS

syntax:
log_dns boolean
default:
no
context:
domain

Log basic information about DNS lookups performed while GreenArrow delivers mail. This is logged to /var/hvmail/log/rspawn-limiter/current. This does not log when GreenArrow’s internal DNS cache is consulted.

greenarrow-remote.6241: dns MX lookup of mail.drh.net resulted in ["mail.drh.net. (10)"]; 0.32ms elapsed
greenarrow-remote.6241: dns A lookup of mail.drh.net. resulted in ["207.99.125.72"]; 1.04ms elapsed

When doing a DNS lookup, GreenArrow Engine will retry a DNS query if it does not receive an answer within a timeout period. Each log line represents the entire process of doing the DNS resolution, so (a) you will not see a separate line for a timeout, and (b) the time spent on timeouts and retries is included in the elapsed time logged.

ip_address * {
  domain hotmail.com, msn.com {
    log_dns yes
  }
}

SMTP

syntax:
log_smtp_connections boolean
default:
no
context:
domain

Log information about SMTP connections being opened and closed. This is logged to /var/hvmail/log/rspawn-limiter/current.

(123) attempting to deliver message: recipient=<user@mail.drh.net> sender=<foo@drh.net> mtaid=<0> sendid=<DUNNO> listid=<DUNNO> local_ip_address=<207.99.125.72>
(123) attempting to connect: domain=<mail.drh.net.> ip=<207.99.125.72>
(123) connected: domain=<mail.drh.net.> ip=<207.99.125.72>
(123) connection closed

The prefix (123) is an identifier for the connection. These identifiers are reused.

ip_address * {
  domain hotmail.com, msn.com {
    log_smtp_connections yes
  }
}

syntax:
log_smtp_commands boolean
default:
no
context:
domain

Log the SMTP commands and responses exchanged with the remote SMTP server (along with information about connections being opened/closed). This does not include message data. This is logged to /var/hvmail/log/rspawn-limiter/current.

(123) attempting to deliver message: recipient=<user@example.com> sender=<sender@example.com> mtaid=<3> sendid=<a512> listid=<a2> local_ip_address=<default>
(123) attempting to connect: domain=<mail.drh.net> ip=<207.99.125.72>
(123) connected: domain=<mail.drh.net> ip=<207.99.125.72>
(123) <<< 220 mail.drh.net ESMTP
(123) >>> EHLO localhost
(123) <<< 250-mail.drh.net
(123) <<< 250-AUTH LOGIN PLAIN
(123) <<< 250-AUTH=LOGIN PLAIN
(123) <<< 250-PIPELINING
(123) <<< 250 8BITMIME
(123) >>> MAIL FROM:<sender@example.com> BODY=8BITMIME
(123) <<< 250 ok
(123) >>> RCPT TO:<user@example.com>
(123) <<< 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
(123) >>> QUIT
(123) <<< 221 mail.drh.net
(123) connection closed

The prefix (123) is an identifier for the connection. These identifiers are reused.

ip_address * {
  domain hotmail.com, msn.com {
    log_smtp_commands yes
  }
}

syntax:
log_smtp_hexdump boolean
default:
no
context:
domain

Log the raw bytes exchanged with the remote SMTP server in a hex-dump format (along with information about connections being opened/closed). This includes message data. This is logged to /var/hvmail/log/rspawn-limiter/current.

(123) attempting to deliver message: recipient=<user@example.com> sender=<sender@example.com> mtaid=<3> sendid=<a512> listid=<a2> local_ip_address=<default>
(123) attempting to connect: domain=<mail.drh.net> ip=<207.99.125.72>
(123) connected: domain=<mail.drh.net> ip=<207.99.125.72>
(123) <<< received 24 bytes
(123) 32 32 30 20 6d 61 69 6c  2e 64 72 68 2e 6e 65 74  |220 mail.drh.net|
(123) 20 45 53 4d 54 50 0d 0a                           | ESMTP..|
(123) >>> sent 16 bytes
(123) 45 48 4c 4f 20 6c 6f 63  61 6c 68 6f 73 74 0d 0a  |EHLO localhost..|
(123) <<< received 92 bytes
(123) 32 35 30 2d 6d 61 69 6c  2e 64 72 68 2e 6e 65 74  |250-mail.drh.net|
(123) 0d 0a 32 35 30 2d 41 55  54 48 20 4c 4f 47 49 4e  |..250-AUTH LOGIN|
(123) 20 50 4c 41 49 4e 0d 0a  32 35 30 2d 41 55 54 48  | PLAIN..250-AUTH|
(123) 3d 4c 4f 47 49 4e 20 50  4c 41 49 4e 0d 0a 32 35  |=LOGIN PLAIN..25|
(123) 30 2d 50 49 50 45 4c 49  4e 49 4e 47 0d 0a 32 35  |0-PIPELINING..25|
(123) 30 20 38 42 49 54 4d 49  4d 45 0d 0a              |0 8BITMIME..|
(123) >>> sent 46 bytes
(123) 4d 41 49 4c 20 46 52 4f  4d 3a 3c 73 65 6e 64 65  |MAIL FROM:<sende|
(123) 72 40 65 78 61 6d 70 6c  65 2e 63 6f 6d 3e 20 42  |r@example.com> B|
(123) 4f 44 59 3d 38 42 49 54  4d 49 4d 45 0d 0a        |ODY=8BITMIME..|
(123) <<< received 8 bytes
(123) 32 35 30 20 6f 6b 0d 0a                           |250 ok..|
(123) >>> sent 28 bytes
(123) 52 43 50 54 20 54 4f 3a  3c 75 73 65 72 40 65 78  |RCPT TO:<user@ex|
(123) 61 6d 70 6c 65 2e 63 6f  6d 3e 0d 0a              |ample.com>..|
(123) <<< received 71 bytes
(123) 35 35 33 20 73 6f 72 72  79 2c 20 74 68 61 74 20  |553 sorry, that |
(123) 64 6f 6d 61 69 6e 20 69  73 6e 27 74 20 69 6e 20  |domain isn't in |
(123) 6d 79 20 6c 69 73 74 20  6f 66 20 61 6c 6c 6f 77  |my list of allow|
(123) 65 64 20 72 63 70 74 68  6f 73 74 73 20 28 23 35  |ed rcpthosts (#5|
(123) 2e 37 2e 31 29 0d 0a                              |.7.1)..|
(123) >>> sent 6 bytes
(123) 51 55 49 54 0d 0a                                 |QUIT..|
(123) <<< received 18 bytes
(123) 32 32 31 20 6d 61 69 6c  2e 64 72 68 2e 6e 65 74  |221 mail.drh.net|
(123) 0d 0a                                             |..|
(123) connection closed

The prefix (123) is an identifier for the connection. These identifiers are reused.

ip_address * {
  domain hotmail.com, msn.com {
    log_smtp_hexdump yes
  }
}

VirtualMTAs

syntax:
define_virtual_mtas_in_config_file boolean
default:
no
context:
general

When this directive is turned on, IP Addresses, Routing Rules, and Relay Servers in GreenArrow Engine’s internal database are replaced with those that are specified in the configuration file.

If this directive is enabled, default_virtual_mta must be specified.

general {
  define_virtual_mtas_in_config_file yes
}

To apply changes to this directive, run:

greenarrow_config reload reload_apache

syntax:
default_virtual_mta string
context:
general

The VirtualMTA to use for delivery when none is specified.

This directive only takes effect if define_virtual_mtas_in_config_file is turned on. If it is, this directive must be specified.

general {
  default_virtual_mta smtp1-1
}

syntax:
smtp_source_hostname string

The hostname to use for outgoing SMTP connections on this VirtualMTA.

This may not be specified on the * wildcard IP address.

This directive only takes effect if define_virtual_mtas_in_config_file is turned on. If it is, it then this directive must be specified.

ip_address ip-address-1 {
  smtp_source_hostname example.com
}

syntax:
smtp_source_ip string

The IP address to use for outgoing SMTP connections on this VirtualMTA.

This may not be specified on the * wildcard IP address.

This directive only takes effect if define_virtual_mtas_in_config_file is turned on. If it is, it then this directive must be specified for each ip_address and relay_server.

ip_address ip-address-1 {
  smtp_source_ip 127.0.0.101
}

syntax:
smtp_auth username password
context:
relay_server

These optional credentials are used as authentication for outgoing SMTP connections on this VirtualMTA.

This directive only takes effect if define_virtual_mtas_in_config_file is turned on.

relay-server my-relay-1 {
  smtp_auth my-username my-password
}

syntax:
max_concurrent_connections integer
default:
no limit
context:
domain, relay_server

In a domain block inside of an ip_address block, this specifies the maximum number of total concurrent connections allowed to these domains from this IP (as a group). If the domain block is for *, then this specifies the maximum number of concurrent connections allowed to any individual domain that does not have a more specific rule.

In a relay_server block this specifies the maximum number of total concurrent connections allowed by the relay server.

This may be set to zero for no limit.

ip_address ip-address-1 {
  # In the * wildcard case, any individual domain may have a total of 100 concurrent connections.
  domain * {
    max_concurrent_connections 100
  }
  # In this case, the two specified domains can jointly have a total of 500 concurrent connections.
  domain first.example.com, second.example.com {
    max_concurrent_connections 500
  }
}

syntax:
max_delivery_rate rate
default:
no limit

The maximum number of delivery attempts per unit of time allowed.

The denominator may be sec, s, min, m, hr, or h.

In a domain block inside of an ip_address block, this specifies the rate allowed to these domains from this IP (as a group). If the domain block is for * , then this specifies the rate allowed to any individual domain that does not have a more specific rule.

In a relay_server block, this specifies the rate of delivery attempts allowed by the relay server.

ip_address ip-address-1 {
  # In the * wildcard case, any individual domain may send a total of 250 messages per hour.
  domain * {
    max_delivery_rate 250/hr
  }
  # In this case, the two specified domains can jointly send a total of 20 messages per second (72,000 messages per hour).
  domain first.example.com, second.example.com {
    max_delivery_rate 20/sec
  }
}

syntax:
throttle_program string
context:
ip_address

The Throttle Program that should be used on the given domains for this VirtualMTA. The program is found by (case-insensitive) name.

This directive only takes effect if define_virtual_mtas_in_config_file is turned on.

ip_address ip-address-1 {
  domain * {
    throttle_program "automatic backoff"
  }
}

Please be aware that the above example of a throttle_program on a * domain does not set a throttle_program on “all domains not otherwise specified”. Instead, this provides a default value of throttle_program to all domain groups that contain throttling directives (max_concurrent_connections and max_delivery_rate). This is because Throttle Programs only operate on explicitly listed domain names.

syntax:
routing_rule_destination virtual_mta [percentage]

The destination to which email should be delivered by this VirtualMTA. If the percentage is not specified for one or more destinations, it is apportioned evenly from whatever is remaining from 100.

Each routing_rule_domain is required to have at least one child routing_rule_destination.

This directive only takes effect if define_virtual_mtas_in_config_file is turned on.

Limit on the number of destinations: We do not recommend adding or editing more than 10,000 destinations. While GreenArrow does not enforce a hard limit on the number of destinations, performance can suffer when exceeding this threshold.

routing_rule proxy-to-other-servers {
  routing_rule_domain * {
    # fastest-server will receive 50% of the messages
    routing_rule_destination fastest-server 50%
    # The remaining three servers will receive 16.66% of the messages each
    routing_rule_destination slower-server-1
    routing_rule_destination slower-server-2
    routing_rule_destination slower-server-3
  }
}

syntax:
randomization_type type

The method of randomization to the destinations. See the Routing Rule documentation for a more detailed explanation. The randomization type can be one of random, message_constant, or email_address_constant.

This directive only takes effect if define_virtual_mtas_in_config_file is turned on.

routing_rule proxy-to-other-servers {
  routing_rule_domain * {
    # fastest-server will receive 50% of the messages
    routing_rule_destination fastest-server 50%
    # The remaining three servers will receive 16.66% of the messages each
    routing_rule_destination slower-server-1
    routing_rule_destination slower-server-2
    routing_rule_destination slower-server-3
    randomization_type message_constant
  }
}

DNS Cache

syntax:
dns_cache_service_run boolean
default:
no
context:
general

When this directive is turned on, GreenArrow’s level 2 DNS cache is enabled. See the DNS Cache documentation for details on how to use it.

general {
  dns_cache_service_run yes
}

Database Connections

syntax:
define_database_connections_in_config_file boolean
default:
no
context:
general

When this directive is turned on, Database Connections in GreenArrow’s internal database are replaced with those specified in the configuration file.

general {
  define_database_connections_in_config_file yes
}

To apply changes to this directive, run:

greenarrow_config reload reload_apache

syntax:
database_type string

The type of database to connect to. The following values are accepted:

postgres

PostgreSQL

mysql

MySQL

mssql

Microsoft SQL Server

This directive only takes effect if define_database_connections_in_config_file is turned on.

database_connection db {
  database_type postgres
}

syntax:
database_host string

The hostname or IP address of the database server.

By default, GreenArrow connects to the following TCP ports:

postgres

5432

mysql

3306

mssql

1433

If you would rather use a non-default port, add a : suffix to the hostname or IP address, followed by the desired port number. The following configuration connects to db.example.com on port 3000:

database_connection db {
  database_host db.example.com:3000
}

This directive only takes effect if define_database_connections_in_config_file is turned on.

syntax:
database_username string

The username to login to the database with.

This directive only takes effect if define_database_connections_in_config_file is turned on.

database_connection db {
  database_username greenarrow
}

syntax:
database_password string

The password to login to the database with.

This directive only takes effect if define_database_connections_in_config_file is turned on.

database_connection db {
  database_password secret
}

syntax:
database_name string

The name of the database to login to.

This directive only takes effect if define_database_connections_in_config_file is turned on.

database_connection db {
  database_name crm
}

syntax:
is_remote boolean
default:
no

Whether GreenArrow should connect to the database server using a TCP port. This usually means that the database server is remote, but you can also set is_remote to yes, then connect to a local database server by connecting to 127.0.0.1.

This directive only takes effect if define_database_connections_in_config_file is turned on.

database_connection db {
  is_remote yes
}

syntax:
use_ssl boolean
default:
no

Whether to enable SSL when connecting to the database server.

This directive only takes effect if define_database_connections_in_config_file is turned on.

database_connection db {
  use_ssl yes
}

syntax:
extra_dsn_string string

An optional string to append to the DSN used to connect to the database. All connections are made using Perl’s DBI interface.

This directive only takes effect if define_database_connections_in_config_file is turned on.

database_connection db {
  extra_dsn_string "mysql_socket=/dev/mysql"
}

syntax:
notes string

An optional description. GreenArrow stores this value but does not act upon it.

This directive only takes effect if define_database_connections_in_config_file is turned on.

database_connection db {
  notes "CRM's MySQL server"
}

DKIM Keys

syntax:
define_dkim_keys_in_config_file boolean
default:
no
context:
general

When this directive is turned on, DKIM keys in GreenArrow’s internal database are replaced with those specified in the configuration file.

general {
  define_dkim_keys_in_config_file yes
}

To apply changes to this directive, run:

greenarrow_config reload reload_apache

syntax:
dkim_key selector private_key_filename default=boolean
context:
dkim_domain
selector

The selector to use in the DKIM signature.

private_key_filename

Absolute path to a file containing a private key in PEM format. If the file cannot be read or parsed, it causes a validation error.

default

An optional parameter which controls whether this key/selector combination is used by default for signing mail for the domains listed in the parent dkim_domain directive (the parent domains). Defaults to no.

Each instance of this directive defines a selector and private key to use for DKIM signing the parent domains’ email.

Each domain/selector combination may only appear once within the configuration file once. Duplicates cause validation errors.

GreenArrow extracts the public key from the private key that you provide. The public key must be at least 512 bits long to avoid validation errors. We recommend a minimum public key length of 1,024 bits.

An instance can be designated as the default for the parent domains. There can be only one default for any domain.

This directive only takes effect if define_dkim_keys_in_config_file is turned on.

DKIM keys specified with this directive are available to use by the X-GreenArrow-DKIM header.

See our DKIM keys doc for details on how GreenArrow decides on which DKIM keys to use for signing email.

dkim_domain example.com, example.net {
  dkim_key ga "/etc/my-keys/ga.pem" default=yes
  dkim_key my-selector "/etc/my-keys/my-selector.pem"
}

URL Domains

syntax:
define_url_domains_in_config_file boolean
default:
no
context:
general

When this directive is turned on, URL domains in GreenArrow’s internal database are replaced with those specified in the configuration file.

general {
  define_url_domains_in_config_file yes
}

To apply changes to this directive, run:

greenarrow_config reload reload_apache

syntax:
use_ssl boolean
default:
no
context:
url_domain

When this directive is turned on, click, open and unsubscribe tracking URLs that use the specified URL domain use an https://. Otherwise, they use an http:// prefix.

url_domain example.com {
  use_ssl yes
}

Incoming Email Domains

syntax:
define_incoming_email_domains_in_config_file boolean
default:
no
context:
general

When this directive is turned on, incoming email domains and mailboxes in GreenArrow’s internal database are replaced with those specified in the configuration file.

general {
  define_incoming_email_domains_in_config_file yes
}

To apply changes to this directive, run:

greenarrow_config reload reload_apache

syntax:
domain_aliases domain_name [, ... ]

This directive lists one or more incoming email domains to alias to the domain named in the parent incoming_email_domain directive. Aliased domains inherit all of the delivery rules of the domain that they’re aliased to.

syntax:
email_status string
default:
normal

This directive controls how GreenArrow delivers mail to the domain. The options are:

normal

Deliver email to the configured mailboxes.

disabled

Ignore this incoming email domain’s configuration.

defer

Defer deliveries to this domain.

syntax:
bounce_mailbox domain_name [, ... ]

This directive lists the localparts of one or more bounce mailboxes.

syntax:
spam_complaint_mailbox domain_name [, ... ]

This directive lists the localparts of one or more spam complaint mailboxes.

syntax:
mailbox_is_wildcard boolean
default:
no

By default, mailboxes receive mail for localpart@ the given domain. If mailbox_is_wildcard is set to yes, the mailbox also receives mail for localpart-*@ the given domain, where * expands to include any characters allowed in an email address, other than the @ sign.

syntax:
mailbox_forward_to email_address

This directive causes email to be forwarded to the specified addresses. If there are multiple addresses to forward to, separate them with commas.

If this directive is used in a user_mailbox context, mailbox_delivery_mode must be set to forward or forward_and_local.

syntax:
mailbox_delivery_mode string
context:
user_mailbox

This directive controls how mail that’s sent to a user_mailbox gets delivered. The options are:

local

Deliver email to a local mailbox. The mail can be retrieved using POP3.

forward

Forward email to the address specified in mailbox_forward_to.

forward_and_local

Deliver two copies of each message - one using forward logic and the other using the local logic.

dotqmail

Process incoming email according to the rules in a .qmail file.

syntax:
mailbox_dotqmail string
context:
user_mailbox

This directive is used to specify the contents of a .qmail file. See this document’s String Encoding section for how to enter a multiline file.

If this directive is used, mailbox_delivery_mode must be set to dotqmail.

syntax:
mailbox_password string
context:
user_mailbox

This directive is used to specify the password that is used to login to a mailbox via SMTP or POP3.

syntax:
mailbox_locked boolean
default:
no
context:
user_mailbox

This directive controls whether the mailbox is locked. Locked mailboxes cannot authenticate using POP3 or SMTP, but can still receive mail.

Throttle Programs

syntax:
define_throttle_programs_in_config_file boolean
default:
no
context:
general

When this directive is turned on, Throttle Programs in GreenArrow’s internal database are replaced with those specified in the configuration file.

general {
  define_throttle_programs_in_config_file yes
}

To apply changes to this directive, run:

greenarrow_config reload reload_apache

syntax:
backoff_max_concurrent_connections percentage or integer
context:
throttle_program

This directive limits the maximum number of concurrent outgoing connections while in Backoff Mode.

The value may be either an integer for a fixed limit or a percentage of the maximum number of concurrent outgoing connections allowed when not in Backoff Mode:

  • The minimum integer value is 1.
  • Valid percentage values are 1% to 100%.

throttle_program warmup {
  backoff_max_concurrent_connections 10%
}

syntax:
backoff_max_messages_per_hour percentage or integer
context:
throttle_program

This directive limits the maximum number of messages that may be sent per hour while in Backoff Mode.

The value may be either an integer for a fixed limit or a percentage of the maximum number of messages per hour allowed when not in Backoff Mode:

  • The minimum integer value is 1.
  • Valid percentage values are 1% to 100%.

throttle_program warmup {
  backoff_max_messages_per_hour 10%
}

syntax:
return_after duration
context:
throttle_program

This directive sets the amount of time to stay in Backoff Mode once it begins. The value gets rounded up to the nearest time divisible by 5 minutes (10:00 am, 10:05 am, etc.), as described in the Throttle Programs documentation.

throttle_program warmup {
  return_after 5m
}

syntax:
trigger_failure_rate percentage
context:
throttle_program

This optional directive sets the minimum percentage of delivery attempts which must result in bounces (permanent failures) before Backoff Mode is entered.

The trigger_required_attempts threshold must also be met to enter Backoff Mode. The trigger_deferral_rate setting has no impact on this directive’s behavior.

throttle_program warmup {
  trigger_failure_rate 10%
}

syntax:
trigger_deferral_rate percentage
context:
throttle_program

This optional directive sets the minimum percentage of delivery attempts which must result in deferrals or bounces (permanent failures) before Backoff Mode is entered.

The trigger_required_attempts threshold must also be met to enter Backoff Mode. The trigger_failure_rate setting has no impact on this directive’s behavior.

throttle_program warmup {
  trigger_deferral_rate 50%
}

syntax:
trigger_required_attempts integer
context:
throttle_program

This directive sets the minimum number of delivery attempts that must have taken place in the past 5 minutes to enter Backoff Mode. The trigger_deferral_rate or trigger_failure_rate threshold must also be met to enter Backoff Mode.

The minimum value is 1.

throttle_program warmup {
  trigger_required_attempts 100
}

Mail Classes

The following Mail Class attributes are not configuable via greenarrow.conf or the configuration API. You may use GreenArrow Engine’s web interface to configure them:

  • Regex Before HTML Conversion
  • Regex After HTML Conversion
  • Regex for HTML Part
  • Regex for Text Part

All other Mail Class attributes are configurable via greenarrow.conf.

syntax:
define_mail_classes_in_config_file boolean
default:
no
context:
general

When this directive is turned on, Mail Classes in GreenArrow’s internal database are replaced with those specified in the configuration file.

general {
  define_mail_classes_in_config_file yes
}

To apply changes to this directive, run:

greenarrow_config reload reload_apache

syntax:
bounce_address_external string [, ... ]
context:
general

This directive is used to specify bounce addresses on external servers which GreenArrow should consider valid when parsing the bounce_address setting for a Mail Class. Bounce mailboxes hosted on the local GreenArrow server should not be listed using this directive.

Multiple addresses can be specified by providing a comma delimited list or multiple bounce_address_external lines.

general {
  bounce_address_external "return@example.com", "return@example.net"
  bounce_address_external "return@example.org"
}

syntax:
virtual_mta string
context:
mail_class

This directive sets the VirtualMTA used by a Mail Class.

mail_class orders {
  virtual_mta smtp1-1
}

syntax:
listid string
context:
mail_class

This directive sets the ListID used by a Mail Class.

mail_class orders {
  listid widgets
}

syntax:
seed integer integer
default:
disabled
context:
mail_class

This directive causes messages to be sent to the configured seed list once a day, starting at the first message number given, and ending at the second message number. For example, the following configuration would send to the seed list between the day’s 50th and 5,000th message:

mail_class orders {
  seed 50 5000
}

syntax:
track_clicks_and_opens boolean
default:
no
context:
mail_class

This directive turns on or off click and open tracking for the Mail Class.

mail_class orders {
  track_clicks_and_opens yes
}

syntax:
manage_unsubscribe_links boolean
default:
no
context:
mail_class

This directive turns on or off unsubscribe link tracking for the Mail Class.

mail_class orders {
  manage_unsubscribe_links yes
}

syntax:
archive_sample_count integer
default:
disabled
context:
mail_class

This directive causes GreenArrow to save a copy of the first N messages each day to the PostgreSQL database. Use caution when setting this parameter because excessive use can lead to disk space exhaustion.

mail_class orders {
  archive_sample_count 10
}

syntax:
add_message_id_if_missing boolean
default:
no
context:
mail_class

Each email should contain a Message-ID header so that the receiving email client can correctly process it. This directive causes GreenArrow to verify that the header exists in each email, and if not, to insert one.

mail_class orders {
  add_message_id_if_missing yes
}

syntax:
url_domain string
default:
$CLICKTHROUGH_URL in /var/hvmail/control/simplemh-config
context:
mail_class

This directive controls the URL Domain to use for click and open tracking.

mail_class orders {
  url_domain ga.example.com
}

syntax:
bounce_address string
default:
$RETURN_PATH_OVERRIDE in /var/hvmail/control/simplemh-config
context:
mail_class

This directive controls the bounce mailbox to use for messages in this Mail Class. The specified mailbox must be either:

  1. A local bounce mailbox configured via greenarrow.conf, the configuration API, or GreenArrow’s web interface.
  2. Define in a bounce_address_external directive.

mail_class orders {
  bounce_address "return@ga.example.com"
}

syntax:
convert_textonly_to_html_do_conversion boolean
default:
no
context:
mail_class

This directive controls whether GreenArrow will convert text only messages to HTML.

mail_class orders {
  convert_textonly_to_html_do_conversion yes
}

syntax:
convert_textonly_to_html_header_to_add string
context:
mail_class

This directive causes GreenArrow to append the specified footer to the HTML body of each text message that’s converted to HTML.

The directive only takes effect if convert_textonly_to_html_do_conversion is set to yes.

mail_class orders {
  convert_textonly_to_html_header_to_add "<img src=c679ff232b68a0064f6ce4fa19a50ef8quot;https://example.com/logo.pngc679ff232b68a0064f6ce4fa19a50ef8quot;>"
}

syntax:
convert_textonly_to_html_footer_to_add string
context:
mail_class

This directive causes GreenArrow to append the specified footer to the HTML body of each text only that’s converted to HTML.

The directive only takes effect if convert_textonly_to_html_do_conversion is set to yes.

mail_class orders {
  convert_textonly_to_html_footer_to_add "<img src=483e9f4ceed269c4943145f0e8fef3d5quot;https://example.com/footer.png483e9f4ceed269c4943145f0e8fef3d5quot;>"
}

syntax:
convert_textonly_to_html_link_text string
context:
mail_class

This directive causes the specified anchor text to be used in for links that appear in emails converted to HTML.

The directive only takes effect if convert_textonly_to_html_do_conversion is set to yes.

mail_class orders {
  convert_textonly_to_html_link_text link
}

syntax:
modify_html_header string
context:
mail_class

This directive causes GreenArrow to prepend the specified header to the HTML version of each message.

mail_class orders {
  modify_html_header "<img src=957bffad660db68fece6145d2f0fee48quot;https://example.com/logo.png957bffad660db68fece6145d2f0fee48quot;>"
}

syntax:
modify_html_footer string
context:
mail_class

This directive causes GreenArrow to append the specified footer to the HTML version of each message.

mail_class orders {
  modify_html_footer "<img src=e58227971bb409a3632f6a114126f964quot;https://example.com/footer.pnge58227971bb409a3632f6a114126f964quot;>"
}

syntax:
modify_text_header string
context:
mail_class

This directive causes GreenArrow to prepend the specified header to the text part of each multipart message.

mail_class orders {
  modify_text_header "Thank you for your recent order.
"
}

syntax:
modify_text_footer string
context:
mail_class

This directive causes GreenArrow to append the specified footer to the text part of each multipart message.

mail_class orders {
  modify_text_footer "
To track your shipment, please login to https://example.com/"
}

syntax:
bounce_message_passthrough boolean
default:
no
context:
mail_class

When set to yes, this directive causes each bounce message for the Mail Class to be delivered to both the Mail Class’s configured bounce_address and the bounce address that was set for the message before it was injected into GreenArrow.

When set to no, each bounce message is delivered to just the Mail Class’s configured bounce_address.

mail_class orders {
  bounce_message_passthrough yes
}

syntax:
bcc string
default:
disabled
context:
mail_class

This directive causes SimpleMH to BCC a copy of every message in the Mail Class to the specified email address.

mail_class orders {
  bcc "user@example.com"
}

syntax:
add_email_headers string
default:
disabled
context:
mail_class

This directive adds the specified email headers to each message. Headers must follow the following rules:

  • If you specify multiple headers, separate them by newlines. Both Unix and Windows-style newlines are supported.
  • Up to 1024 characters of custom headers are supported.
  • Only the following X-Greenarrow headers are supported:
    • X-GreenArrow-DKIM-Only-Using-Domain
    • X-GreenArrow-Signing-Selector
    • X-GreenArrow-Signing-Key-Filename
    • X-GreenArrow-DKIM
  • The X-Mailer-Info header is prohibited.
  • Any other valid X-* header is allowed.

mail_class orders {
  add_email_headers "X-foo: bar
X-bar: baz"
}

Disk Space Warning Banner

syntax:
ui_disk_space_warning_threshold percentage [path]
default:
80%
context:
general

This directive controls the threshold for displaying disk usage warnings in GreenArrow’s web interfaces. You can use multiple instances of this directive:

general {
  ui_disk_space_warning_threshold 75%
  ui_disk_space_warning_threshold 80% /var/hvmail/postgres
  ui_disk_space_warning_threshold 80% /var/hvmail/log
}

The directive is used to control the monitoring of disk space only. Inode usage is not monitored.

The following filesystems are monitored by default:

  1. /.
  2. Any mounted filesystem that uses brtfs, ext3, ext4 reiserfs or xfs.

The optional path argument is used to specify the mount point of a specific filesystem. If an entry excludes the path, then it changes the threshold for all monitored filesystems which don’t have their own ui_disk_space_warning_threshold entries:

general {
  ui_disk_space_warning_threshold 85%
}

If the path argument is included, and it matches the mount point of a filesystem, the filesystem is monitored, regardless of whether it’s in the default list of monitored filesystems:

general {
  ui_disk_space_warning_threshold 85% /media/disk1
}

If no mounted filesystem uses the specified path as its mount point, the entry is ignored:

general {
  ui_disk_space_warning_threshold 70% /no/such/filesystem
}

To exclude an individual filesystem from monitoring, set its threshold to 100%:

general {
  ui_disk_space_warning_threshold 100% /media/disk1
}

To exclude all filesystems from monitoring, either set ui_disk_space_warning_threshold to 100% use the ui_disk_space_warning_hide directive, which is described in the next section:

general {
  ui_disk_space_warning_threshold 100%
}

See the Warning Banner section of Troubleshooting Disk Space Issues for more details.

syntax:
ui_disk_space_warning_hide boolean
default:
no
context:
general

If ui_disk_space_warning_hide is set to yes, then disk space usage banner is never shown, regardless of the disk usage situation:

general {
  ui_disk_space_warning_hide yes
}

See the Warning Banner section of Troubleshooting Disk Space Issues for more details.

Syntax Checker

To check if your configuration file is valid without applying its settings, run the following.

# greenarrow_config validate
No errors found. Configuration file is acceptable.

This command will let you know that the syntax of your configuration file is correct and warn you of any unknown directives.

Reload Configuration in Active Services

Anytime a service starts up, it will use whatever configuration is currently in /var/hvmail/control/greenarrow.conf. If the configuration cannot be successfully loaded, the service will not start. See the Detecting and Correcting Invalid Configuration section below for more information on troubleshooting an invalid configuration file.

To apply an update to the configuration file, there are reload commands listed below. Combined, these commands apply all of the configurations in the configuration file.

Update the configuration running on services that do not require restarts

This command will load the new configuration into services that do not require restarts or result in downtime.

This applies most directives in the configuration file. If a directive is not applied by this reload command, it will say so explicitly in the directive’s documentation.

greenarrow_config reload

Update Apache’s configuration

This command will reload Apache with the new configuration. This results in a delay (15-60 seconds depending on server speed) of servicing web requests.

greenarrow_config reload_apache

Running this command without the --force argument will require confirmation by typing y when asked.

Update PostgreSQL’s configuration

This command will reload PostgreSQL with the new configuration. This is considered a HIGH IMPACT operation and will severely disrupt all running services. This operation typically takes 60 seconds.

greenarrow_config reload_postgres

Running this command without the --force argument will require confirmation by typing y when asked.

Detecting and Correcting Invalid Configuration

If a service cannot start due to an invalid greenarrow.conf, this is how you can diagnose the problem.

Run hvmail_init status. When the configuration file is invalid, it will say so at the top of the output.

# hvmail_init status


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Errors found in configuration file (/var/hvmail/control/greenarrow.conf):
 - line 26: unknown identifier invalid_grouping_directive

This will prevent multiple services from being able to start or restart.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


     QUEUE      SERVICE STARTED       OK FILE EXISTS       RAMDISK ACTIVE
       ram                  yes                  yes                  yes
    bounce                  yes                  yes                  yes
      disk                  yes                  n/a                  n/a

LICENSE: current

SERVICES:
Name                      Primary Service Status  Log Service Status
hvmail-bounce-processor   UP                      UP
hvmail-bounce-qmail-send  UP                      UP
hvmail-config-agent       UP                      UP
hvmail-dd-dispatcher      UP                      UP
hvmail-dd-logreader       UP                      UP
hvmail-disk-qmail-send    UP                      UP
hvmail-dnscache           UP                      UP
hvmail-event-processor    UP                      UP
hvmail-httpd              STARTING
hvmail-logfile-agent      UP                      UP
hvmail-logfile-summary    UP                      UP
hvmail-logfile-writer     UP                      UP
hvmail-postgres           UP                      UP
hvmail-pure-authd-studio  UP                      UP
hvmail-pure-ftpd          UP                      UP
hvmail-qmail-pop3d        UP                      UP
hvmail-qmail-smtpd        UP                      UP
hvmail-qmail-smtpd2       UP                      UP
hvmail-qmail-smtpd3       DOWN
hvmail-ram-qmail-send     UP                      UP
hvmail-redis              UP                      UP
hvmail-redis-np           UP                      UP
hvmail-rpc                UP                      UP
hvmail-rspawn-limiter     UP                      UP
hvmail-simplemh           UP                      UP
hvmail-simplemh2          UP                      UP
hvmail-smtp-sink          UP                      UP
hvmail-studio-worker      UP                      UP

OVERALL STATUS: UP

In the example above, you’ll see the warning banner at the top of the output. Additionally, the hvmail-httpd service is stuck at a state of STARTING. If you look into the log files, you’ll see the error there as well.

# tail /var/hvmail/log/httpd/current | tai64nlocal
2018-04-13 08:10:58.148551500 error (256) while loading greenarrow configuration
2018-04-13 08:10:58.148922500 ERROR: failed to generate configuration
2018-04-13 08:10:59.159582500 /var/hvmail/bin/greenarrow_config: Errors found in configuration file (/var/hvmail/control/greenarrow.conf):
2018-04-13 08:10:59.159584500  - line 26: unknown identifier invalid_grouping_directive
2018-04-13 08:10:59.161435500 error (256) while loading greenarrow configuration
2018-04-13 08:10:59.161436500 ERROR: failed to generate configuration
2018-04-13 08:11:00.182314500 /var/hvmail/bin/greenarrow_config: Errors found in configuration file (/var/hvmail/control/greenarrow.conf):
2018-04-13 08:11:00.182317500  - line 26: unknown identifier invalid_grouping_directive
2018-04-13 08:11:00.183340500 error (256) while loading greenarrow configuration
2018-04-13 08:11:00.184608500 ERROR: failed to generate configuration

The error output should give you enough information to fix the problem in greenarrow.conf. Once the problem has been corrected, the service will automatically start up and resume normal operation.

Dynamic Defaults

Several of the configuration fields within GreenArrow Engine default to being adjusted automatically based upon the available CPU and RAM resources.

To view the values used for these fields, run the following command.

# greenarrow_config show_dynamic_defaults
Directive                                                               Default           Override
--------------------------------------------------------------------------------------------------
general.studio_message_generation_processes_per_campaign                      2                  2
general.studio_workers_shared                                                 0                  -
general.studio_workers_campaigns                                             10                 15
general.studio_workers_general                                                2                  -
general.studio_workers_imports                                                1                  -
general.studio_workers_transactional                                          1                  -
general.passenger_max_requests_in_queue                                     768                  -
general.passenger_min_application_instances                                  16                  -
general.passenger_max_application_instances                                  16                  -
general.apache_max_clients                                                 1024                  -
general.postgres_max_connections                                            300                  -

Estimated memory requirements                                           Default      As Configured
--------------------------------------------------------------------------------------------------
Passenger web processes                                                 3200 MB            3200 MB
Studio worker processes (/service/hvmail-studio-worker)                 2400 MB            3400 MB
--------------------------------------------------------------------------------------------------
The memory estimates listed above do not reflect all components within GreenArrow, but only
these specific components. See the documentation on Memory Utilization for more information:
https://www.greenarrowemail.com/docs/greenarrow-engine/Configuration/Performance-Tuning/Memory-Utilization

If you would like to “freeze” those values so that they will no longer dynamically adjust, run the following command.

greenarrow_config freeze_dynamic_defaults >> /var/hvmail/control/greenarrow.conf

If running the above command results in duplicate configuration entries, then the last of the duplicates takes precedence.

Review Per-Domain Configuration

The command greenarrow_config domain_settings is a diagnostic tool used to see, with the current configuration in /var/hvmail/control/greenarrow.conf, what settings apply to a specific IP/Domain combination.

For example, given this configuration:

ip_address * {
  domain * {
    reuse_connections yes
    reuse_connections_timeout 2s
    reuse_connections_max_messages 100
    log_smtp_commands yes
  }
  domain yahoo.com {
    log_smtp_hexdump yes
  }
}
ip_address smtp-1 {
  domain * {
    reuse_connections_max_messages 500
  }
  domain gmail.com {
    reuse_connections_max_messages 2500
    starttls_use yes
  }
}

Here are some example invocations:

# greenarrow_config domain_settings smtp-1 gmail.com
Configuration on IP "smtp-1" to domain "gmail.com":
------------------------------------------------------------------------
reuse_connections                             | true
reuse_connections_timeout                     | 2s
reuse_connections_max_messages                | 2500
starttls_use                                  | true
starttls_require                              | <default>
starttls_require_action                       | <default>
delivery_override                             | <default>
smtp_route                                    | <default>
message_transfer_timeout_action               | <default>
message_transfer_response_timeout_action      | <default>
log_dns                                       | <default>
log_smtp_connections                          | <default>
log_smtp_commands                             | true
log_smtp_hexdump                              | <default>
max_concurrent_connections                    | <default>
max_delivery_rate                             | <default>
throttle_program                              | <default>

# greenarrow_config domain_settings smtp-1 yahoo.com
Configuration on IP "smtp-1" to domain "yahoo.com":
------------------------------------------------------------------------
reuse_connections                             | true
reuse_connections_timeout                     | 2s
reuse_connections_max_messages                | 500
starttls_use                                  | <default>
starttls_require                              | <default>
starttls_require_action                       | <default>
delivery_override                             | <default>
smtp_route                                    | <default>
message_transfer_timeout_action               | <default>
message_transfer_response_timeout_action      | <default>
log_dns                                       | <default>
log_smtp_connections                          | <default>
log_smtp_commands                             | true
log_smtp_hexdump                              | true
max_concurrent_connections                    | <default>
max_delivery_rate                             | <default>
throttle_program                              | <default>

# greenarrow_config domain_settings smtp-2 gmail.com
Configuration on IP "smtp-2" to domain "gmail.com":
------------------------------------------------------------------------
reuse_connections                             | true
reuse_connections_timeout                     | 2s
reuse_connections_max_messages                | 100
starttls_use                                  | <default>
starttls_require                              | <default>
starttls_require_action                       | <default>
delivery_override                             | <default>
smtp_route                                    | <default>
message_transfer_timeout_action               | <default>
message_transfer_response_timeout_action      | <default>
log_dns                                       | <default>
log_smtp_connections                          | <default>
log_smtp_commands                             | true
log_smtp_hexdump                              | <default>
max_concurrent_connections                    | <default>
max_delivery_rate                             | <default>
throttle_program                              | <default>

# greenarrow_config domain_settings smtp-2 yahoo.com
Configuration on IP "smtp-2" to domain "yahoo.com":
------------------------------------------------------------------------
reuse_connections                             | true
reuse_connections_timeout                     | 2s
reuse_connections_max_messages                | 100
starttls_use                                  | <default>
starttls_require                              | <default>
starttls_require_action                       | <default>
delivery_override                             | <default>
smtp_route                                    | <default>
message_transfer_timeout_action               | <default>
message_transfer_response_timeout_action      | <default>
log_dns                                       | <default>
log_smtp_connections                          | <default>
log_smtp_commands                             | true
log_smtp_hexdump                              | true
max_concurrent_connections                    | <default>
max_delivery_rate                             | <default>
throttle_program                              | <default>

Example File

Here is an example file:

general {
  studio_message_generation_processes_per_campaign 1
  studio_workers_shared 5
  studio_workers_campaigns 0
  studio_workers_general 3
  studio_workers_imports 0
  studio_workers_transactional 1

  passenger_max_requests_in_queue 256
  passenger_min_application_instances 2
  passenger_max_application_instances 4

  apache_max_clients 500

  postgres_max_connections 200
}