is not given, then the configuration process will search for the
command `more' and use it as the default.
---with-smtpservers='SMTPSERVER1[ SMTPSERVER2...]' (DEFAULT is localhost)
- If this option is not specified, the mts.conf file will contain
- the line "servers: localhost", which may be manually edited later.
- You may find it convenient to specify a value at configure-time,
- however, so that each time nmh is reinstalled, the right value will be
- there.
-
- See the mh-tailor(5) man page for full documentation of "servers:".
-
--
The nmh team
nmh-workers@nongnu.org
pagerpath="$with_pager"
fi
-dnl What should be the default mail server(s)?
-AC_ARG_WITH(smtpservers,
- AS_HELP_STRING([--with-smtpservers='SMTPSERVER1@<:@ SMTPSERVER2...@:>@'],
- [specify the default SMTP server(s) @<:@localhost@:>@]))
-if test -n "$with_smtpservers"; then
- smtpservers="$with_smtpservers"
-else
- smtpservers="localhost"
-fi
-AC_SUBST(smtpservers)dnl
-
dnl ----------------------------------------------------
dnl Default location is /usr/local/mmh/{bin,etc,lib,share/man}
dnl ----------------------------------------------------
backup prefix : ${backup_prefix}
transport system : ${MTS}
file locking type : ${LOCKTYPE}
-default smtp servers : ${smtpservers}
default editor : ${editorpath}
default pager : ${pagerpath}
email address masquerading : ${masquerade}
MTS = @MTS@
mailspool = @mailspool@
masquerade = @masquerade@
-smtpservers = @smtpservers@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
$(SED) -e 's,%mts%,$(MTS),' \
-e 's,%mailspool%,$(mailspool),' \
-e 's,%etcdir%,$(etcdir),' \
- -e 's,%masquerade%,$(masquerade),' \
- -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
+ -e 's,%masquerade%,$(masquerade),' < $(srcdir)/mts.conf.in > $@
sendfiles: $(srcdir)/sendfiles.in Makefile
rm -f $@
# When `sendmail', nmh will pipe messages directly to the sendmail program.
mts: %mts%
-# The exceptions file for /etc/hosts used by
-# `post' to try to find official names.
-hostable: %etcdir%/hosts
-
# Name that nmh considers `local'. If not set, nmh will
# query the system for this value (gethostname, etc...).
#localname: foo.bar.com
# The name of the maildrop file in the directory where maildrops
# are kept. If this is empty, the user's login name is used.
mmdflfil:
-
-# List of smtp servers to try if using smtp support
-servers: %smtpservers%
#define MTS_SENDMAIL 1
extern int sm_mts;
-extern char *hostable;
extern char *sendmail;
#endif
* SMTP stuff
*/
extern char *clientname;
-extern char *servers;
/*
* Global MailDelivery File
login shell equivalent to the given value (e.g., \*(lq/bin/csh\*(rq)
indicates that mail for \*(lqeveryone\*(rq should not be sent to them.
This is useful for handling admin, dummy, and guest logins.
-.RE
-.SS "SMTP support"
-These options are only available if you set
-.B mts
-to
-.BR smtp .
-.PP
-.BR hostable :
-%etcdir%/hosts
-.RS 5
-The exceptions file for /etc/hosts used by
-.B post
-to try to find
-official names. The format of this file is quite simple:
-.PP
-.IP 1. 4
-Comments are surrounded by sharp (`#') and newline.
-.IP 2. 4
-Words are surrounded by white space.
-.IP 3. 4
-The first word on the line is the official name of a host.
-.IP 4. 4
-All words following the official names are aliases for that host.
-.RE
-.PP
-.BR servers :
-localhost
-.RS 5
-A lists of hosts and networks which to look for SMTP servers when
-posting local mail. It turns out this is a major win for hosts which
-don't run an message transport system. The value of
-.B servers
-should be one or more items. Each item is the name of a host which
-is (hopefully) running a SMTP server.
.SS "SendMail"
This option is only available if you set
.B mts
The pathname to the
.B sendmail
program.
-.RE
-\" .SS "BBoards Delivery"
-\" This option is only available if you compiled \fInmh\fP with
-\" \*(lqbbdelivery:\ on\*(rq.
-\" .PP
-\" .BR bbdomain :
-\" .RS 5
-\" The local BBoards domain (a UCI hack).
-\" .RE
-
.SS "File Locking"
A few words on locking:
.B nmh
#include <h/mts.h>
#include <netdb.h>
-static struct host {
- char *h_name;
- char **h_aliases;
- struct host *h_next;
-} hosts;
-
-
-/*
- * static prototypes
- */
-static int init_hs(void);
-
char *
OfficialName (char *name)
struct addrinfo hints, *res;
static char buffer[BUFSIZ];
- char **r;
- struct host *h;
for (p = name, q = site; *p && (q - site < sizeof(site) - 1); p++, q++)
*q = isupper (*p) ? tolower (*p) : *p;
freeaddrinfo(res);
return buffer;
}
- if (hosts.h_name || init_hs ()) {
- for (h = hosts.h_next; h; h = h->h_next)
- if (!mh_strcasecmp (h->h_name, q)) {
- return h->h_name;
- } else {
- for (r = h->h_aliases; *r; r++)
- if (!mh_strcasecmp (*r, q))
- return h->h_name;
- }
- }
strncpy (buffer, site, sizeof(buffer));
return buffer;
}
-
-/*
- * Use hostable as an exception file for those hosts that aren't
- * on the Internet (listed in /etc/hosts). These are usually
- * PhoneNet and UUCP sites.
- */
-
-#define NALIASES 50
-
-static int
-init_hs (void)
-{
- unsigned char *cp;
- char *dp, **q, **r;
- char buffer[BUFSIZ], *aliases[NALIASES];
- register struct host *h;
- register FILE *fp;
-
- if ((fp = fopen (hostable, "r")) == NULL)
- return 0;
-
- h = &hosts;
- while (fgets (buffer, sizeof(buffer), fp) != NULL) {
- if ((cp = strchr(buffer, '#')))
- *cp = 0;
- if ((cp = strchr(buffer, '\n')))
- *cp = 0;
- for (cp = buffer; *cp; cp++)
- if (isspace (*cp))
- *cp = ' ';
- for (cp = buffer; isspace (*cp); cp++)
- continue;
- if (*cp == 0)
- continue;
-
- q = aliases;
- if ((cp = strchr(dp = cp, ' '))) {
- *cp = 0;
- for (cp++; *cp; cp++) {
- while (isspace (*cp))
- cp++;
- if (*cp == 0)
- break;
- if ((cp = strchr(*q++ = cp, ' ')))
- *cp = 0;
- else
- break;
- if (q >= aliases + NALIASES)
- break;
- }
- }
-
- *q = 0;
-
- h->h_next = (struct host *) calloc (1, sizeof(*h));
- h = h->h_next;
- h->h_name = getcpy (dp);
- r = h->h_aliases =
- (char **) calloc ((size_t) (q - aliases + 1), sizeof(*q));
- for (q = aliases; *q; q++)
- *r++ = getcpy (*q);
- *r = 0;
- }
-
- fclose (fp);
- return 1;
-}
if (args != NULL && *args != 0) {
ap = client_copyip (client_brkstring (client_getcpy (args), " ", "\n"),
ap, MAXARGS);
- } else {
- if (servers != NULL && *servers != 0)
- ap = client_copyip (client_brkstring (client_getcpy (servers), " ", "\n"),
- ap, MAXARGS);
}
if (ap == arguments) {
*ap++ = client_getcpy ("localhost");
#if defined(SMTPMTS)
static char *sm_method = "sendmail";
int sm_mts = MTS_SENDMAIL;
-char *hostable = nmhetcdir(/hosts);
char *sendmail = SENDMAILPATH;
#endif
* SMTP stuff
*/
char *clientname = NULL;
-char *servers = "localhost \01localnet";
/*
* Global MailDelivery file
#if defined(SMTPMTS)
{ "mts", &sm_method },
- { "hostable", &hostable },
{ "sendmail", &sendmail },
#endif
{ "clientname", &clientname },
- { "servers", &servers },
{ "maildelivery", &maildelivery },
{ "everyone", &everyone },