aboutsummaryrefslogtreecommitdiff
path: root/mockmta.1
blob: 02036ebc10a3e27f186e7ef9849f66cf9eb4dac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
.TH MOCKMTA 1 "June 17, 2021" "MOCKMTA" "General Commands Manual"
.SH NAME
mockmta \- mock MTA server for experimental purposes
.SH SYNOPSIS
\fBmockmta\fR\
 [\fB\-dsv?\fR]\
 [\fB\-c \fICERT\fR]\
 [\fB\-a \fICA\fR]\
 [\fB\-k \fIKEY\fR]\
 [\fB\-l \fILEVEL\fR]\
 [\fB\-P \fIFILE\fR]\
 [\fB\-p [\fIIP\fB:\fR]\fIPORT\fR]\
 [\fB\-t \fISEC\fR]\
 \fIMAILBOX\fR
.SH DESCRIPTION
Starts a mock MTA, which behaves almost identically to the real one,
except that it delivers all messages, no matter their actual
recipients, to the given MAILBOX file.
.PP
No attempts are made to interpret the data supplied during the STMP
transaction, such as domain names, email addresses, etc, neither is
the material supplied in the \fBDATA\fR command verified to be a valid
email message.  Except as being written to \fIMAILBOX\fR, these data are
ignored.
.PP
\fBMockmta\fR can work both as an inetd-style process and as a standalone
daemon.  The inetd mode can be used with \fBGNU pies\fR as follows:
.PP
.EX
       component sm {
           mode inetd;
           socket inet://0.0.0.0:25;
           command "/usr/bin/mockmta /var/spool/mail/dropmail";
       }
.EE
.PP
When run as a daemon, \fBmockmta\fR starts listening on localhost port
25 by default.  Alternative port and/or IP address can be requested
using the \fB\-p\fR option.
.PP
Each incoming connection is verified using
.B /etc/hosts.allow
and
.B /etc/hosts.deny
files (daemon name \fBmockmta\fR).  See
.BR hosts_access (5),
for a detailed description of these.
.PP    
To support TLS, the program must be compiled with the \fBGnuTLS\fR library.
.PP       
To enable the \fBSTARTTLS\fR ESMTP command, supply the names of the certificate
(\fB\-c \fICERT\fR) and certificate key (\fB\-k \fIKEY\fR) files.
.SH OPTIONS
.TP
\fB\-a \fICA\fR
Name of certificate authority file.
.TP
\fB\-c \fICERT\fR
Name of the certificate file.
.TP
.B \-d
Daemon mode.
.TP
.B \-f
Remain in foreground (implies \fB\-d\fR).
.TP
\fB\-k \fIKEY\fR
Name of the certificate key file.
.TP
\fB\-l \fIPRIO\fR
Log messages of priority \fIPRIO\fR and lower.  Valid priorities
(ordered by their numeric value) are:
.BR emerg ,
.BR alert ,
.BR crit ,
.BR err ,
.BR warning ,
.BR notice ,
.BR info ,
.BR debug .
.sp
Default is \fBinfo\fR.
.TP
\fB\-P \fIFILE\fR
Write PID of the daemon process to \fIFILE\fR (with \fB\-d\fR or \fB\-f\fR).
.TP
\fB\-p [\fIIP\fB:\fR]\fIPORT\fR
Listen on this IP address and port.  If \fIIP\fR is not given, listen
on localhost.  To listen on all available interfaces, use
\fB\-p :\fIPORT\fR.
.TP
.B \-s
Use syslog (facility \fBmail\fR) for logging.  This is the default if
\fB\-d\fR or \fB\-f\fR option is given.
.TP
\fB\-t \fISEC\fR
Set SMTP timeout.
.TP
.B \-v
Print program version and exit.
.TP
.B \-?
Print short usage summary and exit.
.SH EXIT CODES
.TP
.B 0
Success.
.TP
.B 1
Failure (see stderr for details).
.TP
.B 2
Timed out waiting for I/O.
.TP
.B 3
Command line usage error.
.SH BUGS
At most 32 \fBRCPT\fR commands are allowed.
.SH SEE ALSO
.BR hosts_access (5).
.SH AUTHOR
Sergey Poznyakoff <gray@gnu.org>
.SH LICENSE
Copyright (C) 2020-2021 Sergey Poznyakoff, Inc.
.br
.na
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
.br
.ad
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH [A-Z_][A-Z0-9_.-]* [0-9] \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end:

Return to:

Send suggestions and report system problems to the System administrator.