3 # * Copyright 2007 Tristan Chabredier <wwp@claws-mail.org>
5 # * This file is free software; you can redistribute it and/or modify it
6 # * under the terms of the GNU General Public License as published by
7 # * the Free Software Foundation; either version 3 of the License, or
8 # * (at your option) any later version.
10 # * This program is distributed in the hope that it will be useful, but
11 # * WITHOUT ANY WARRANTY; without even the implied warranty of
12 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # * General Public License for more details.
15 # * You should have received a copy of the GNU General Public License
16 # * along with this program; if not, write to the Free Software
17 # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # popfile-link.sh helper script to open messages in POPFile's control center
20 # in order to edit their status
22 # Requires that POPFile is running and that the message has been processed
23 # by it (X-POPFile-Link: header present). POPFile control center opens with
24 # the web browser set in Claws Mail prefs.
29 TMPCMD
=$
(echo $OPEN_CMD |
sed "s|\"%s\"|$1|")
35 if [ "$1" = "--ask-session-id" ]
38 SESSION_ID
=$
(gxmessage
-entry -center -wrap -buttons "OK:0,Cancel:1" -default "OK" \
39 -name "popfile-link" -title "POPFile session ID" "Type in the ID of a running POPFile session to use")
40 test -z "$SESSION_ID" -o $?
-ne 0 && \
47 CM_DIR
=$
(claws-mail
--config-dir)
48 test -z "$CM_DIR" -o ! -d "$HOME/$CM_DIR" && \
51 OPEN_CMD
=$
(grep -Em 1 "^uri_open_command=" "$HOME/$CM_DIR/clawsrc" | cut
-d '=' -f 2-)
52 test -z "$OPEN_CMD" && \
57 LINK
=$
(grep -Eim 1 "^X\-POPFile\-Link: " "$1")
61 if [ -n "$SESSION_ID" ]
63 open_page
"${LINK}\\&session=$SESSION_ID"