1 diff -Naur cyrus-imapd-2.2.12.orig/doc/man/imapd.conf.5.html cyrus-imapd-2.2.12/doc/man/imapd.conf.5.html
2 --- cyrus-imapd-2.2.12.orig/doc/man/imapd.conf.5.html 2005-02-14 19:02:18.000000000 +0100
3 +++ cyrus-imapd-2.2.12/doc/man/imapd.conf.5.html 2005-08-16 13:32:36.000000000 +0200
5 <tr valign="top" align="left">
8 +<p><b>sendsms:</b> /usr/bin/sendsms</p></td>
11 +<table width="100%" border=0 rules="none" frame="void"
12 + cols="2" cellspacing="0" cellpadding="0">
13 +<tr valign="top" align="left">
14 +<td width="19%"></td>
16 +<p>The pathname of the sendsms executable. Sieve invokes
17 +sendsms for sending SMS notifications.</p>
21 +<p><table width="100%" border=0 rules="none" frame="void"
22 + cols="2" cellspacing="0" cellpadding="0">
23 +<tr valign="top" align="left">
24 +<td width="10%"></td>
26 <p><b>servername:</b> <none></p></td>
29 diff -Naur cyrus-imapd-2.2.12.orig/doc/man/notifyd.8.html cyrus-imapd-2.2.12/doc/man/notifyd.8.html
30 --- cyrus-imapd-2.2.12.orig/doc/man/notifyd.8.html 2005-02-14 19:02:19.000000000 +0100
31 +++ cyrus-imapd-2.2.12/doc/man/notifyd.8.html 2005-08-16 13:17:33.000000000 +0200
40 +<p>Send the notification as SMS. This method can ONLY be used in
41 +a Sieve ’notify’ action as it requires a
42 +<i>sms:</i> URL to be specified as an <i>:option</i>.</p>
44 +<tr valign="top" align="left">
45 +<td width="11%"></td>
51 diff -Naur cyrus-imapd-2.2.12.orig/lib/imapoptions cyrus-imapd-2.2.12/lib/imapoptions
52 --- cyrus-imapd-2.2.12.orig/lib/imapoptions 2004-07-21 21:07:45.000000000 +0200
53 +++ cyrus-imapd-2.2.12/lib/imapoptions 2005-08-16 13:27:08.000000000 +0200
55 /* The pathname of the sendmail executable. Sieve invokes sendmail
56 for sending rejections, redirects and vacation responses. */
58 +{ "sendsms", "/usr/bin/sendsms", STRING }
59 +/* The pathname of the sendsms executable. Sieve invokes sendsms
60 + for sending SMS notifications. */
62 { "servername", NULL, STRING }
63 /* This is the hostname visible in the greeting messages of the POP,
64 IMAP and LMTP daemons. If it is unset, then the result returned
65 diff -Naur cyrus-imapd-2.2.12.orig/man/imapd.conf.5 cyrus-imapd-2.2.12/man/imapd.conf.5
66 --- cyrus-imapd-2.2.12.orig/man/imapd.conf.5 2005-02-14 19:02:16.000000000 +0100
67 +++ cyrus-imapd-2.2.12/man/imapd.conf.5 2005-08-16 13:35:40.000000000 +0200
69 .IP "\fBsendmail:\fR /usr/lib/sendmail" 5
70 The pathname of the sendmail executable. Sieve invokes sendmail
71 for sending rejections, redirects and vacation responses.
72 +.IP "\fBsendsms:\fR /usr/bin/sendsms" 5
73 +The pathname of the sendsms executable. Sieve invokes sendsms
74 +for sending SMS notifications.
75 .IP "\fBservername:\fR <none>" 5
76 This is the hostname visible in the greeting messages of the POP,
77 IMAP and LMTP daemons. If it is unset, then the result returned
78 diff -Naur cyrus-imapd-2.2.12.orig/man/notifyd.8 cyrus-imapd-2.2.12/man/notifyd.8
79 --- cyrus-imapd-2.2.12.orig/man/notifyd.8 2003-08-10 01:43:14.000000000 +0200
80 +++ cyrus-imapd-2.2.12/man/notifyd.8 2005-08-16 13:18:03.000000000 +0200
82 Sieve 'notify' action as it requires a \fImailto:\fR URL to be
83 specified as an \fI:option\fR.
86 +Send the notification as SMS. This method can ONLY be used in a
87 +Sieve 'notify' action as it requires a \fIsms:\fR URL to be
88 +specified as an \fI:option\fR.
91 Send the notification as a zephyrgram. If used in a Sieve 'notify'
92 action, additional recipients can be specified as \fI:options\fR.
93 diff -Naur cyrus-imapd-2.2.12.orig/notifyd/Makefile.in cyrus-imapd-2.2.12/notifyd/Makefile.in
94 --- cyrus-imapd-2.2.12.orig/notifyd/Makefile.in 2004-05-28 20:03:06.000000000 +0200
95 +++ cyrus-imapd-2.2.12/notifyd/Makefile.in 2005-08-16 15:18:45.000000000 +0200
98 $(INSTALL) -m 755 notifyd $(DESTDIR)$(service_path)
100 -OBJS= notifyd.o notify_null.o notify_log.o notify_mailto.o notify_zephyr.o
101 +OBJS= notifyd.o notify_null.o notify_log.o notify_mailto.o notify_sms.o notify_zephyr.o
103 notifytest: notifytest.o
104 $(CC) $(LDFLAGS) -o notifytest \
105 diff -Naur cyrus-imapd-2.2.12.orig/notifyd/notifyd.h cyrus-imapd-2.2.12/notifyd/notifyd.h
106 --- cyrus-imapd-2.2.12.orig/notifyd/notifyd.h 2003-02-13 21:15:48.000000000 +0100
107 +++ cyrus-imapd-2.2.12/notifyd/notifyd.h 2005-08-16 12:58:17.000000000 +0200
109 #include "notify_null.h"
110 #include "notify_log.h"
111 #include "notify_mailto.h"
112 +#include "notify_sms.h"
113 #include "notify_zephyr.h"
115 /* Notify method dispatch table definition */
117 { "null", notify_null }, /* do nothing */
118 { "log", notify_log }, /* use syslog (for testing) */
119 { "mailto", notify_mailto }, /* send an email */
120 + { "sms", notify_sms }, /* send an sms */
122 { "zephyr", notify_zephyr }, /* send a zephyrgram */
124 diff -Naur cyrus-imapd-2.2.12.orig/notifyd/notify_sms.c cyrus-imapd-2.2.12/notifyd/notify_sms.c
125 --- cyrus-imapd-2.2.12.orig/notifyd/notify_sms.c 1970-01-01 01:00:00.000000000 +0100
126 +++ cyrus-imapd-2.2.12/notifyd/notify_sms.c 2005-08-16 18:43:56.000000000 +0200
128 +/* notify_sms.c -- SMS notification method
132 + * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
134 + * Redistribution and use in source and binary forms, with or without
135 + * modification, are permitted provided that the following conditions
138 + * 1. Redistributions of source code must retain the above copyright
139 + * notice, this list of conditions and the following disclaimer.
141 + * 2. Redistributions in binary form must reproduce the above copyright
142 + * notice, this list of conditions and the following disclaimer in
143 + * the documentation and/or other materials provided with the
146 + * 3. The name "Carnegie Mellon University" must not be used to
147 + * endorse or promote products derived from this software without
148 + * prior written permission. For permission or any other legal
149 + * details, please contact
150 + * Office of Technology Transfer
151 + * Carnegie Mellon University
152 + * 5000 Forbes Avenue
153 + * Pittsburgh, PA 15213-3890
154 + * (412) 268-4387, fax: (412) 268-7395
155 + * tech-transfer@andrew.cmu.edu
157 + * 4. Redistributions of any form whatsoever must retain the following
159 + * "This product includes software developed by Computing Services
160 + * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
162 + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
163 + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
164 + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
165 + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
166 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
167 + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
168 + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
170 + * notify_sms is based on code from notify_mailto by Ken Murchison.
171 + * Copyright (c) 2005 Simon Matter, Invoca Systems.
172 + * Release 2005081600/2.2.12
177 +#include "notify_sms.h"
182 +#include <sys/types.h>
183 +#include <sys/wait.h>
186 +#include "libconfig.h"
187 +#include "sieve_interface.h"
189 +static int global_outgoing_count = 0;
191 +char* notify_sms(const char *class __attribute__((unused)),
192 + const char *priority __attribute__((unused)),
193 + const char *user __attribute__((unused)),
194 + const char *mailbox __attribute__((unused)),
195 + int nopt, char **options,
196 + const char *message)
199 + const char *smbuf[10];
204 + /* XXX check/parse options (sms URI) */
206 + return strdup("NO sms URI not specified");
208 + smbuf[0] = "sendsms";
209 + smbuf[1] = options[0];
213 + if ((sm_pid = fork()) == 0) {
214 + /* i'm the child! run sendsms! */
216 + /* make the pipe be stdin */
218 + execv(config_getstring(IMAPOPT_SENDSMS), (char **) smbuf);
220 + /* if we're here we suck */
221 + return strdup("NO sms couldn't exec");
223 + /* i'm the parent */
225 + sm = fdopen(fds[1], "w");
228 + return strdup("NO sms could not spawn sendsms process");
230 + fprintf(sm, message);
233 + while (waitpid(sm_pid, &sm_stat, 0) < 0);
235 + /* XXX check for sendsms exit code */
237 + return strdup("OK sms notification successful");
239 diff -Naur cyrus-imapd-2.2.12.orig/notifyd/notify_sms.h cyrus-imapd-2.2.12/notifyd/notify_sms.h
240 --- cyrus-imapd-2.2.12.orig/notifyd/notify_sms.h 1970-01-01 01:00:00.000000000 +0100
241 +++ cyrus-imapd-2.2.12/notifyd/notify_sms.h 2005-08-16 14:57:16.000000000 +0200
243 +/* notify_sms.h -- SMS notification method
247 + * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
249 + * Redistribution and use in source and binary forms, with or without
250 + * modification, are permitted provided that the following conditions
253 + * 1. Redistributions of source code must retain the above copyright
254 + * notice, this list of conditions and the following disclaimer.
256 + * 2. Redistributions in binary form must reproduce the above copyright
257 + * notice, this list of conditions and the following disclaimer in
258 + * the documentation and/or other materials provided with the
261 + * 3. The name "Carnegie Mellon University" must not be used to
262 + * endorse or promote products derived from this software without
263 + * prior written permission. For permission or any other legal
264 + * details, please contact
265 + * Office of Technology Transfer
266 + * Carnegie Mellon University
267 + * 5000 Forbes Avenue
268 + * Pittsburgh, PA 15213-3890
269 + * (412) 268-4387, fax: (412) 268-7395
270 + * tech-transfer@andrew.cmu.edu
272 + * 4. Redistributions of any form whatsoever must retain the following
274 + * "This product includes software developed by Computing Services
275 + * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
277 + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
278 + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
279 + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
280 + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
281 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
282 + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
283 + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
285 + * notify_sms is based on code from notify_mailto by Ken Murchison.
286 + * Copyright (c) 2005 Simon Matter, Invoca Systems.
287 + * Release 2005081600/2.2.12
291 +#ifndef _NOTIFY_SMS_H_
292 +#define _NOTIFY_SMS_H_
296 +/* the only option should be a sms URI */
297 +char* notify_sms(const char *class __attribute__((unused)),
298 + const char *priority __attribute__((unused)),
299 + const char *user __attribute__((unused)),
300 + const char *mailbox __attribute__((unused)),
301 + int nopt, char **options,
302 + const char *message);
304 +#endif /* _NOTIFY_SMS_H_ */