-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmbidled.1
163 lines (162 loc) · 3.36 KB
/
mbidled.1
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.TH MBIDLED "1" "May 2022"
.SH NAME
mbidled \- run command on mailbox change
.
.SH SYNOPSIS
.
.B mbidled
.B \-c
.I MBSYNC_CONFIG
[\fB-e\fR \fICOMMAND\fR]
.RI [ OPTION ]...
.
.SH DESCRIPTION
.B mbidled
runs
.I
COMMAND
on mailbox change.
.
.P
.BR "CAUTION!" " Program has not been tested outside author's setup. Use it with care."
.
.SH COMMANDS
.P
.TP
.BI \-c\ MBSYNC_CONFIG
Path to
.BR mbsync (1)
configuration file to use.
.
.TP
.BI \-e\ COMMAND
Execute shell
.I
COMMAND
on mailbox change.
.
.IP
By default, synchronize changed mailbox:
.BR "mbsync -c $MBIDLED_CONFIG $MBIDLED_CHANNEL:$MBIDLED_MAILBOX" .
.
.IP
The following environment variables are set for the executed program:
.TS
tab(|)[];
ll.
Variable|Value
$\fBMBIDLED_CONFIG\fR|Argument for \fB-c\fR.
$\fBMBIDLED_CHANNEL\fR|Name of changed Channel.
$\fBMBIDLED_MAILBOX\fR|Name of changed mailbox.
.TE
.
.TP
.B \-v
Be verbose. Note that output may contain sensitive information.
.
.TP
.B \-h
Display help and exit.
.
.SH STORES
.B mbidled
can watch for mailbox changes in the following stores.
.
.SS IMAP
IMAP configuration is read from
.B IMAPAccount
sections.
.
.P
IMAP4 IDLE command is used (RFC 2177) to watch for changes in
.B INBOX
and all mailboxes in
.B INBOX.
namespace.
.
.SS Maildir
Mailboxes having prefix of
.B MaildirStore.Path
and
.B MaildirStore.Inbox
are being watched.
.
.P
Filesystem is being watched using
.BR inotify (7)
on Linux systems (if supported) or using periodic
.BR stat (2)
calls in all other cases (refer to libev for exact details).
.
.SH CONFIGURATION
.B mbidled
has been designed to use configuration file (format) of
.BR mbsync .
.
.P
Besides standard configuration options
.BR mbidled
recognizes some extra options.
All such extension options start with a comment marker character
.RB ( # )
so they are completely ignored by
.BR mbsync .
Prefix (part before colon) is case-sensitive.
.
.SS Global
.TP
.B "#MBIDLED:StrictPropagate [None|Far|Near|Both]
Changes from stores can be registered during the execution of
.I COMMAND
but it cannot be known whether change has been properly handled by the program
or maybe it had completely missed it. For this reason, command is scheduled for
a re-run to make sure it knows about latest updates. However, in the vast
majority of cases this second run would likely be a no-op, because this change
is often generated by the started program itself.
This option specifies which sides of the channel should
schedule a new command run upon a change (thus propagating potential changes).
Optimal choice between safety and low server load can be if for
.BR PullNew " or " PushNew ,
.BR Far " or " Near
specified for this option, respectively, that means side where new mails come
from is surely re-checked.
(Default=Both)
.
.TP
.BI "#MBIDLED:StartTimeout " time
After registering a change wait this
.I time
of seconds
before starting
.IR COMMAND .
Stores may emit multiple change notifications for the
same change event thus it can be useful to wait a bit.
(Default=1)
.
.TP
.BI "#MBIDLED:StartInterval " time
Do not run
.I COMMAND
more often than this
.I time
of seconds.
(Default=30)
.
.TP
.BR "#MBIDLED:Option" " ..."
Process line as if there would be no prefix given. Can be useful to
tweak some options exclusively for
.BR mbidled .
.
.IP
Examples:
.IP
.EX
# Disable watching channel.
#MBIDLED:Sync None
# Watch specific mailboxes only.
#MBIDLED:Patterns Archive Sent
.EE
.
.SH "SEE ALSO"
.B mbsync(1)