# HG changeset patch # User wolfgang.scherer@gmx.de # Date 2012-03-30 16:08:51 # Node ID 0eae87d3d1de50cd30559309d8e34d6aca8d9812 # Parent a791f3afadd24304067b9c35255db870a3abe55c test/send-test-mail.sh: send test mail through vacation. test/qp-check.php: test quoted printable. diff --git a/test/.htaccess b/test/.htaccess new file mode 100644 --- /dev/null +++ b/test/.htaccess @@ -0,0 +1,3 @@ +order allow,deny +Deny from all + diff --git a/test/00-testmail-vacation b/test/00-testmail-vacation new file mode 100644 --- /dev/null +++ b/test/00-testmail-vacation @@ -0,0 +1,18 @@ +From Wolfgang.Scherer@gmx.de Mon Oct 6 14:00:01 2008 +Return-Path: +X-Original-To: ws@sheckley.simul.de +Delivered-To: ws@sheckley.simul.de +Received: from sheckley.simul.de (sheckley.simul.de.local [127.0.0.1]) + by sheckley.simul.de (Postfix) with ESMTP id A31A5FDE4CF + for ; Mon, 6 Oct 2008 14:00:01 +0200 (CEST) +X-SP-Original-From: SIZE=646 +Received: by sheckley.simul.de (Postfix, from userid 0) + id 9D65EFDE4D0; Mon, 6 Oct 2008 14:00:01 +0200 (CEST) +From: ws@sheckley.simul.de +To: ws@sheckley.simul.de +Subject: Vacation Test Mail =?utf-8?Q?=C3=A4=C3=B6=C3=BC?= +Content-Type: text/plain; charset=ANSI_X3.4-1968 +Message-Id: <20081006120001.9D65EFDE4D0@sheckley.simul.de> +Date: Mon, 6 Oct 2008 14:00:01 +0200 (CEST) + +This is a test mail vor vacation(1) diff --git a/test/qp-check.php b/test/qp-check.php new file mode 100644 --- /dev/null +++ b/test/qp-check.php @@ -0,0 +1,87 @@ + +// Sponsored by WIEDENMANN SEILE GMBH, http://www.wiedenmannseile.de +// +// This file is part of Wiedenmann Vacation. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see , +// or write to Wolfgang Scherer, + +// $_REQUEST['_DEBUG_'] = 1; +// $_REQUEST['_DEBUG_TEST_'] = 1; +require_once(dirname(__FILE__) . '/../lib/util.php'); + +$msg = get_text('vacation'); + +echo "--------------------------------------------------\n"; +$vacationa = vacation_split($msg, False); +$subject = $vacationa[0]; +$headers = $vacationa[1]; +$body = $vacationa[2]; + +$msg = vacation_join($subject, $body, $headers); +echo $msg."\n"; + +echo "--------------------------------------------------\n"; +$vacationa = vacation_split($msg, True); +$subject = $vacationa[0]; +$headers = $vacationa[1]; +$body = $vacationa[2]; + +$msg = vacation_join($subject, $body); +echo $msg."\n"; + +echo "--------------------------------------------------\n"; +$vacationa = vacation_split($msg, True); +$subject = $vacationa[0]; +$headers = $vacationa[1]; +$body = $vacationa[2]; + +$msg = vacation_join($subject . 'äöü', $body); +echo $msg."\n"; + +echo "--------------------------------------------------\n"; +$vacationa = vacation_split($msg, True); +$subject = $vacationa[0]; +$headers = $vacationa[1]; +$body = $vacationa[2]; + +echo 'Subject: '.$subject."\n"; +echo 'Headers: '. $headers."\n"; +echo 'Body: '.$body."\n"; + +echo "--------------------------------------------------\n"; +$msg = vacation_join($subject, $body); +echo $msg."\n"; + +// +// :ide-menu: Emacs IDE Menu - Buffer @BUFFER@ +// . M-x `eIDE-menu' ()(eIDE-menu "z") +// :ide: COMPILE: PHP _DEBUG_=2 _DEBUG_TEST_=2 +// . (compile (concat "php " (file-name-nondirectory (buffer-file-name)) " _DEBUG_=2 _DEBUG_TEST_=2")) + +// :ide: QUO: $this-> +// . (insert "$this->" ) + +// :ide: COMPILE: PHP w/o args +// . (compile (concat "php " (file-name-nondirectory (buffer-file-name)) "")) + +// :ide: COMPILE: PHP _DEBUG_=1 _DEBUG_TEST_=1 +// . (compile (concat "php " (file-name-nondirectory (buffer-file-name)) " _DEBUG_=1 _DEBUG_TEST_=1")) + +// +// Local Variables: +// mode: php +// End: +?> diff --git a/test/send-test-mail.sh b/test/send-test-mail.sh new file mode 100755 --- /dev/null +++ b/test/send-test-mail.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +# send-test-mail.sh - pipe 00-testmail through vacation(1) for user ws + +# usage: send-test-mail.sh [user] + +# Copyright (C) 2012, Wolfgang Scherer, +# Sponsored by WIEDENMANN SEILE GMBH, http://www.wiedenmannseile.de +# +# This file is part of Wiedenmann Vacation. +# +: # script help +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see , +# or write to Wolfgang Scherer, + +# -------------------------------------------------- +# |||:sec:||| FUNCTIONS +# -------------------------------------------------- + +usage () +{ + script_help="script-help" + ( "${script_help}" ${1+"$@"} "${0}" ) 2>/dev/null \ + || ${SED__PROG-sed} -n '3,/^[^#]/{;/^[^#]/d;p;}' "${0}"; +} + +test x"${1+set}" = xset && \ +case "${1}" in +-\?|-h|--help) usage; exit 0;; +--docu) usage --full; exit 0;; +esac + +# -------------------------------------------------- +# |||:sec:||| MAIN +# -------------------------------------------------- + +# |:here:| + +USER="${1-ws}" + +cat 00-testmail-vacation | formail | vacation "${USER}" + +exit # |||:here:||| + +# +# :ide-menu: Emacs IDE Main Menu - Buffer @BUFFER@ +# . M-x `eIDE-menu' (eIDE-menu "z") + +# :ide: SNIP: insert OPTION LOOP +# . (snip-insert-mode "sh_b.opt-loop" nil t) + +# :ide: SHELL: Run with --docu +# . (progn (save-buffer) (shell-command (concat "sh " (file-name-nondirectory (buffer-file-name)) " --docu"))) + +# :ide: SHELL: Run with --help +# . (progn (save-buffer) (shell-command (concat "sh " (file-name-nondirectory (buffer-file-name)) " --help"))) + +# :ide: SHELL: Run w/o args +# . (progn (save-buffer) (shell-command (concat "sh " (file-name-nondirectory (buffer-file-name)) " "))) + +# +# Local Variables: +# mode: sh +# comment-start: "#" +# comment-start-skip: "#+" +# comment-column: 0 +# End: +# mmm-classes: (here-doc ide-entries)