+ /*
+ ** .pp
+ ** When \fIset\fP, Madmutt will qualify all local addresses (ones without the
+ ** @host portion) with the value of ``$$hostname''. If \fIunset\fP, no
+ ** addresses will be qualified.
+ */
+ bool use_domain = 1;
+
+ /*
+ ** .pp
+ ** \fIThis is a read-only system property and, at runtime,
+ ** specifies the current working directory of the madmutt
+ ** binary.\fP
+ */
+ const string_t pwd(void) {
+ char path[_POSIX_PATH_MAX];
+ getcwd(path, sizeof(path));
+ RETURN(path);
+ };
+
+ /*
+ ** .pp
+ ** \fIThis is a read-only system property and, at runtime,
+ ** specifies the full path or URI of the folder currently
+ ** open (if any).\fP
+ */
+ const string_t folder_path(void) {
+ RETURN(CurrentFolder);
+ };
+
+ /*
+ ** .pp
+ ** \fIThis is a read-only system property and, at runtime,
+ ** specifies the actual name of the folder as far as it could
+ ** be detected.\fP
+ ** .pp
+ ** For detection, $$$folder is first taken into account
+ ** and simply stripped to form the result when a match is found. For
+ ** example, with $$$folder being \fTimap://host\fP and the folder is
+ ** \fTimap://host/INBOX/foo\fP, $$$madmutt_folder_name will be just
+ ** \fTINBOX/foo\fP.)
+ ** .pp
+ ** Second, if the initial portion of a name is not $$$folder,
+ ** the result will be everything after the last ``/''.
+ ** .pp
+ ** Third and last, the result will be just the name if neither
+ ** $$$folder nor a ``/'' were found in the name.
+ */
+ const string_t folder_name(void) {
+ const char *p;
+
+ if (!m_strisempty(Maildir)
+ && m_strstart(CurrentFolder, Maildir, &p) && *p) {
+ while (*p == '/')
+ p++;
+ RETURN(p);
+ } else {
+ p = strchr(CurrentFolder ?: "", '/');
+ RETURN(p ? p + 1 : (CurrentFolder ?: ""));
+ }
+ };
+};
+
+@package MTransport {
+ /*
+ ** .pp
+ ** Specifies the program and arguments used to deliver mail sent by Madmutt.
+ ** Madmutt expects that the specified program interprets additional
+ ** arguments as recipient addresses.
+ */
+ path_t sendmail = m_strdup(SENDMAIL " -eom -oi");
+
+ /*
+ ** .pp
+ ** \fBNote:\fP you should not enable this unless you are using Sendmail
+ ** 8.8.x or greater or in connection with the SMTP support via libESMTP.
+ ** .pp
+ ** This variable sets the request for when notification is returned. The
+ ** string consists of a comma separated list (no spaces!) of one or more
+ ** of the following: \fInever\fP, to never request notification,
+ ** \fIfailure\fP, to request notification on transmission failure,
+ ** \fIdelay\fP, to be notified of message delays, \fIsuccess\fP, to be
+ ** notified of successful transmission.
+ ** .pp
+ ** Example: \fTset dsn_notify="failure,delay"\fP
+ */
+ /* TODO: check it's NULL, hdrs or full */
+ string_t dsn_notify = NULL;
+
+ /*
+ ** .pp
+ ** \fBNote:\fP you should not enable this unless you are using Sendmail
+ ** 8.8.x or greater or in connection with the SMTP support via libESMTP.
+ ** .pp
+ ** This variable controls how much of your message is returned in DSN
+ ** messages. It may be set to either \fIhdrs\fP to return just the
+ ** message header, or \fIfull\fP to return the full message.
+ ** .pp
+ ** Example: \fTset dsn_return=hdrs\fP
+ */
+ /* TODO: check it's never, delay, failure, success with ',' */
+ string_t dsn_return = NULL;
+
+ /*
+ ** .pp
+ ** Specifies the number of seconds to wait for the ``$$sendmail'' process
+ ** to finish before giving up and putting delivery in the background.
+ ** .pp
+ ** Madmutt interprets the value of this variable as follows:
+ ** .dl
+ ** .dt >0 .dd number of seconds to wait for sendmail to finish before continuing
+ ** .dt 0 .dd wait forever for sendmail to finish
+ ** .dt <0 .dd always put sendmail in the background without waiting
+ ** .de
+ ** .pp
+ ** Note that if you specify a value other than 0, the output of the child
+ ** process will be put in a temporary file. If there is some error, you
+ ** will be informed as to where to find the output.
+ */
+ int sendmail_wait = 0;
+ /*
+ ** .pp
+ ** \fBWarning:\fP do not set this variable unless you are using a version
+ ** of sendmail which supports the \fT-B8BITMIME\fP flag (such as sendmail
+ ** 8.8.x) or in connection with the SMTP support via libESMTP.
+ ** Otherwise you may not be able to send mail.
+ ** .pp
+ ** When \fIset\fP, Madmutt will either invoke ``$$sendmail'' with the \fT-B8BITMIME\fP
+ ** flag when sending 8-bit messages to enable ESMTP negotiation or tell
+ ** libESMTP to do so.
+ */
+ bool use_8bitmime = 0;
+
+ /*
+ ** .pp
+ ** When \fIset\fP, Madmutt will use ``$$envelope_from_address'' as the
+ ** \fIenvelope\fP sender if that is set, otherwise it will attempt to
+ ** derive it from the "From:" header.
+ **
+ ** .pp
+ ** \fBNote:\fP This information is passed
+ ** to sendmail command using the "-f" command line switch and
+ ** passed to the SMTP server for libESMTP (if support is compiled in).
+ */
+ bool use_envelope_from = 0;
+
+ /*
+ ** .pp
+ ** Manually sets the \fIenvelope\fP sender for outgoing messages.
+ ** This value is ignored if ``$$use_envelope_from'' is unset.
+ */
+ address_t envelope_from_address = NULL;
+};