GreenArrow Email Software Documentation

Local Injection Options

When your injecting application is running on the same server as GreenArrow Engine, you have access to the same network based injection options as remote injecting systems. You also have a few additional options, which are only available with local injection.

Interfaces

sendmail Binary

GreenArrow Engine comes with a sendmail compatibility interface that can be used by injecting applications designed to work with Sendmail. To use GreenArrow Engine’s sendmail interface, point the relevant portion of your application’s configuration to the following filesystem path:

/var/hvmail/bin/sendmail

Here’s an example command line invocation of sendmail:

( echo From: [email protected] ; echo To: [email protected] ; echo Subject: sendmail Test Message ) | /var/hvmail/bin/sendmail -t -i

qmail-inject

GreenArrow Engine comes with a qmail-inject compatibility interface that can be used by injecting applications designed to work with qmail. To use GreenArrow Engine’s qmail-inject interface, point the relevent portion of your application’s configuration to the following filesystem path:

/var/hvmail/bin/qmail-inject

Here’s an example command line invocation of qmail-inject:

( echo From: [email protected] ; echo To: [email protected] ; echo Subject: qmail-inject Test Message ) | /var/hvmail/bin/qmail-inject

mailsubj

GreenArrow Engine comes with a mailsubj compatibility interface that can be used by injecting applications designed to work with qmail. To use GreenArrow Engine’s mailsubj interface, point the relevent portion of your application’s configuration to the following filesystem path:

/var/hvmail/bin/mailsubj

Here’s an example command line invocation of mailsubj:

date | /var/hvmail/bin/mailsubj "mailsubj Test Message" [email protected]

Headers and Environmental Variables

When injecting mail locally, you can still use the same Raw Injection headers and SimpleMH headers that you would normally use. In addition, some of these headers have equivalent environmental variables that you can use instead if you’d like.

Header Environmental Variable Description
NA GREENARROW_SIMPLEMH Use SimpleMH to process this message. Not needed if the GREENARROW_MAILCLASS environmental variable, or X-GreenArrow-MailClass header is also set.
X-GreenArrow-MailClass GREENARROW_MAILCLASS Specifies the SimpleMH Mail Class to use.
X-GreenArrow-MtaID GREENARROW_MTAID Specifies the Raw Injection VirtualMTA to use.
X-GreenArrow-ListID GREENARROW_LISTID Specifies the ListID to use.
X-GreenArrow-SendID GREENARROW_SENDID Specifies the Raw Injection SendID to use

SimpleMH Example #1 - Specifying a Mail Class:

date | GREENARROW_MAILCLASS=trans /var/hvmail/bin/mailsubj "SimpleMH Test Message" [email protected]

SimpleMH Example #1 - Not Specifying a Mail Class:

date | GREENARROW_SIMPLEMH="" /var/hvmail/bin/mailsubj "SimpleMH Test Message" [email protected]

Raw Injection Example #1:

date | GREENARROW_MTAID=smtp1-1 GREENARROW_LISTID=1 GREENARROW_SENDID=20120228 /var/hvmail/bin/mailsubj "Raw Injection Test Message" [email protected]

Example Implementations

PHP mail() Function

PHP’s mail() function can be configured to use qmail-inject by making the following entry in your PHP installation’s php.ini file:

sendmail_path = /var/hvmail/bin/qmail-inject

Make sure to restart your web server so that the new PHP configuration is read.

PHP mail() Function with Newline Cleanup

GreenArrow Engine expects locally injected messages to use Unix style newlines (LF). Some applications do not always follow this convention. For example, Interspire Email Marketer has been observed to use combination of Unix style (LF) and Windows style (CRLF) linefeeds within the same message. This normally doesn’t impact readability of the message, but can break DKIM authentication.

This can be corrected by either updating the injecting application, by following the steps below to sanitize its output:

  1. Install dos2unix and unix2dos if they’re not already present. For example:

    yum install dos2unix unix2dos
    

  2. Update the php.ini file’s sendmail_path variable to format newlines for you, as shown in the example below:

    sendmail_path = "/usr/bin/unix2dos | /usr/bin/dos2unix | /var/hvmail/bin/qmail-inject"
    

  3. Restart the web server to apply these changes.


Copyright © 2012–2024 GreenArrow Email