--- mailto-1.3.2.orig/debian/NMU-Disclaimer +++ mailto-1.3.2/debian/NMU-Disclaimer @@ -0,0 +1,45 @@ +Non Maintainer Upload of this Package +------------------------------------- + +If you plan to work on an NMU for this package, read the following +closely. It can save you and me some grief. + + 1. At first, contact the maintainer (i.e. send a mail to + joey@debian.org, do not cc or bounce a mail, send a plain mail, + not copied to any mailing list or the BTS) and ask about the + status of the bug you are considering to work on. + + 2. In this mail include all information relevant for this problem, + i.e. include a description of the bug and not only its bug + number. + + 3. If the maintainer is not able or willing to fix the problem or + does not respond within four days, continue with step 4. + + 4. Work on the bug and prepare a patch. Do not upload into the + Debian archive. + + 5. Send the entire patch, together with enough explanations, to the + maintainer for reviewing and ask him for permission of an NMU + using this patch. + + 6. IF AND ONLY IF the maintainer approves the patch (or doesn't + respond within four days), upload the NMU to the incoming + directory and send the patch to the BTS. If the NMU is not + approved, go back to 4. or add the NMU to your homepage, but do + not upload it to the Debian archive. + + 7. Properly sized and well-written patches sent to the BTS are always + appreciated, even if they are rejected later. They demonstrate a + potential solution which could probably improved into a real + solution. + + 8. NEVER change the way a package is maintained in an NMU, i.e. don't + remove dh_* stuff or switch to dh_* respectively. This rule + applies to all NMU's, not only to an NMU for this package. + +These rules always apply. They even apply if somebody declares NMUs +as ok and reduces regular NMU rules to a delay of zero days. Unless +I'm on vacation or on a show I am reachable via mail, so there is +hardly a reason not to contact me. + --- mailto-1.3.2.orig/debian/changelog +++ mailto-1.3.2/debian/changelog @@ -0,0 +1,136 @@ +mailto (1.3.2-3build1) bionic; urgency=high + + * No change rebuild to pick up -fPIE compiler default + + -- Balint Reczey Tue, 03 Apr 2018 12:34:09 +0000 + +mailto (1.3.2-3) unstable; urgency=low + + * Disable included version of getline() since it is unused and produce + an FTBFS (closes: Bug#551449) + * Don't use '0' flag used with '%p' gnu_printf format [mailto.c] + + -- Joey Schulze Sat, 16 Jan 2010 20:27:45 +0100 + +mailto (1.3.2-2) unstable; urgency=low + + * Fixed typo in NMU-Disclaimer, thanks to Petter Reinholdtsen (See: + Bug#225895) + * Extract the local mail hostname from /etc/mailname (closes: + Bug#415134) + * Fixed two compiler warnings + + -- Martin Schulze Sat, 17 Mar 2007 12:55:10 +0100 + +mailto (1.3.2-1) unstable; urgency=low + + * New upstream version + * This refers to the final upstream version since upstream has abandoned + this package long ago. Only Debian seems to distribute and maintain it + * Added support for special mail headers required when delivering mail + with non-ascii character encoding + + -- Martin Schulze Sun, 12 Dec 2004 14:06:33 +0100 + +mailto (1.3.1-1) unstable; urgency=low + + * New upstream version + * Adjusted native report on Cc + * Added section about special variables for better documentation + * Added missing \r for the smtp protocol + * Added a note to the entire GPL to debian/copyright + * Removed the prerm since the /usr/share/doc conversion is done already + * Bumped the standards version + + -- Martin Schulze Sat, 11 Dec 2004 18:06:17 +0100 + +mailto (1.3-1) unstable; urgency=low + + * New upstream version + * New license: GNU GPLv2 + * Added support for new upstream Makefile + * Updated debian/copyright file according to upstream copyright + * Added documentation for carbon copy (Cc) + * Better note webmaster@ as address to send errors to + + -- Martin Schulze Thu, 9 Dec 2004 09:53:31 +0100 + +mailto (1.2.7-1) unstable; urgency=low + + * New upstream version + * Fixed format string vulnerability + + -- Martin Schulze Wed, 8 Dec 2004 21:16:14 +0100 + +mailto (1.2.6-5) unstable; urgency=low + + * Added a disclaimer for those people who plan to NMU this package + * Adjusted dependency to exim4 since it's the default MTA already + (closes: Bug#228582) + * Improved description + * Updated copyright file + * Cleaned up some code in mailto.c + * Wrote and added a small test program + * Added an UTF-8 detection rules so that valid UTF-8 characters won't be + eaten anymore + * No need for the postinst anymore since /usr/doc is gone + + -- Martin Schulze Sat, 4 Dec 2004 10:13:01 +0100 + +mailto (1.2.6-4) unstable; urgency=medium + + * Finally fixed the redirection problem that mailto had. (closes: + Bug#79570, Bug#71090) + * Added bilingual message for HTTP relocation + * Applied NMU patches from Marcelo (closes: Bug#93958, Bug#93956) + * Applied patch from Ryan Hayle to send CRLF in the + SMTP dialog instead of just LF (closes: Bug#68790) + * Corrected some German messages (not that they were used in the Debian + version... I guess I became upstream of this package, not sure though) + * Added information about potential mail lossage when the pipe to + sendmail is closed which caused an error (potential fix for Bug#54309) + + -- Martin Schulze Fri, 10 Aug 2001 23:50:01 +0200 + +mailto (1.2.6-3.2) unstable; urgency=low + + * NMU + * debian/rules Duh! Fixed check for nostrip. + * debian/control: added | apache to Depends + * debian/control: added section and priority to binary package + + -- Marcelo E. Magallon Sat, 14 Apr 2001 12:25:12 +0200 + +mailto (1.2.6-3.1) unstable; urgency=low + + * NMU + * Moved doc and man to /usr/share (closes: bug#91574) + * debian/prerm, debian/postinst, debian/rules: added first two, install them + * debian/control: Standards-Version: 3.5.2 + + -- Marcelo E. Magallon Sat, 14 Apr 2001 12:14:09 +0200 + +mailto (1.2.6-3) unstable; urgency=low, closes=53997 + + * Don't use strip for non-strippable files (closes: Bug#53997) + + -- Martin Schulze Tue, 4 Jan 2000 11:27:44 +0100 + +mailto (1.2.6-2) unstable; urgency=low, closes=37927 + + * Removed case-sensitivity of email addresses (closes: Bug#37927) + + -- Martin Schulze Tue, 26 Oct 1999 18:03:07 +0200 + +mailto (1.2.6-1) unstable; urgency=low + + * Initial release + * Extracted changelog + * Extracted usage + * Added readme + * Support for SENDER/MASTER@`hostname -f` + * Support for appropriate Redirect + * Added example + + -- Martin Schulze Tue, 29 Sep 1998 03:26:43 +0200 + --- mailto-1.3.2.orig/debian/changes +++ mailto-1.3.2/debian/changes @@ -0,0 +1,62 @@ +Version history + +Version 1.3.2 - 2.3.1999 + Conditional error-to. + +Version 1.3.1 - 2.9.1998 + Fixed carbon copy option. + +Version 1.3 - 13.8.96 + Option to send a carbon copy. (Not yet working) + +Version 1.2.7 - 12.4.96 + Added random number (pid) code to subject parsing + +Version 1.2.6 - 30.1.96 + Fixed address checking bug with addresses without realnames + +Version 1.2.5 - 29.1.96 + Added debugging output + Fixed some possible references to null-pointers + +Version 1.2.4 - 25.1.96 + Added support for machines lacking strerror(3C) + +Version 1.2.3 - 27.9.95 + Gateway identifies with Sender: instead of From: + User address now specified in From: field, Reply-To alias for From + +Version 1.2.2 - 5.9.95 + Added to the address file separators + +Version 1.2.1 - 2.8.95 + X- postfix for Addr, Host, Ident and User headers. + +Version 1.2 - 1.6.95 + Option to send a copy of the generated mail to oneself. + Fixed bug when client sends instead of only. + +Version 1.1.1 - 23.1.95 + Option to show generated mail in automatic acknowledgement page. + +Version 1.1 - 19.1.95 + Added evaluation of INPUT fields for To, Subject and Acknowledge. + Default FORM now generates INPUT fields instead of URL parameters. + +Version 1.0.2 - 23.8.94 + Fixed location bug. + Supplies default FORM on method GET now. + +Version 1.0.1 - 10.6.94 + Fixed documentation bug. + +Version 1.0 - 10.6.94 + Initial version + +Thanx for bug reports, ideas and fixes to + anr@ime.usp.br (Adriano R.) + pall@rz.uni-karlsruhe.de (Michael Pall) + otisg@cobalt.middlebury.edu (Otis Gospodnetic) + +A current version of mailto can be retrieved from + ftp://ftp.rz.uni-karlsruhe.de/pub/net/www/tools/cgi-src/mailto.tar.gz --- mailto-1.3.2.orig/debian/conffiles +++ mailto-1.3.2/debian/conffiles @@ -0,0 +1 @@ +/etc/mailto.conf --- mailto-1.3.2.orig/debian/control +++ mailto-1.3.2/debian/control @@ -0,0 +1,16 @@ +Source: mailto +Section: web +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Martin Schulze +Standards-Version: 3.6.1 + +Package: mailto +Architecture: any +Section: web +Priority: optional +Depends: apache | httpd, exim4 | mail-transport-agent, ${shlibs:Depends} +Description: WWW Forms to Mail Gateway + This package provides a CGI program that converts data submitted + via a web formular to simple mail which is sent to a given + address. --- mailto-1.3.2.orig/debian/copyright +++ mailto-1.3.2/debian/copyright @@ -0,0 +1,44 @@ +This is the Debian GNU/Linux prepackaged version of Andreas Ley's +mailto program. + +This package was put together by Martin Schulze , +from sources obtained from: + ftp://ftp.rz.uni-karlsruhe.de/pub/net/www/tools/cgi-src/mailto.tar.gz + +One mirror still seems to exist: + http://www-ftp.lip6.fr/ftp/pub/www/more-tools/cgi-src/mailto.tar.gz + +Both sites only contained mailto up to version 1.2.6. + +The upstream packages for 1.2.7, 1.3, 1.3.1 and 1.3.2 were sent to +Joey via private mail and not released to the abovely mentioned +Internet address. + +Version 1.3.2 is also the final upstream version which only exists on +a tape library archive and isn't in use anymore. Hence, the Debian +package became the new source for this package. + +mailto has been released under the GNU General Public License. + + Copyright (c) 1994-1999 by Andreas Ley + + 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The source of the Debian package is managed through CVS. It is publically +available at or as +<:pserver:anonymous@@cvs.infodrom.org/var/cvs/debian/newmail/>. --- mailto-1.3.2.orig/debian/lwp-test +++ mailto-1.3.2/debian/lwp-test @@ -0,0 +1,50 @@ +#! /usr/bin/perl + +# Copyright (c) 2004 Martin Schulze +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# This is a simple test for whether UTF-8 encodings will be destroyed +# or delivered properly. With the old mailto (per 1.2.6-5) it the +# second character would be eaten in secure(). + +use strict; +use LWP::UserAgent; + +my $server = "www.infodrom.north.de"; +my $path = "/cgi-bin/mailto"; +my $payload = "message=[".chr(193).chr(129)."]"; +my @parms = ("Reply-To=mailto-test\@infodrom.org", + "To=joey\@infodrom.north.de", + "Subject=mailto test", + "text=old: [A], new: [A.]", + $payload); + +my $user = LWP::UserAgent->new; + +$user->agent("mailto/1.2.6 "); + +my $request = HTTP::Request->new(POST => 'http://'.$server.$path); + +$request->content(join ("&", @parms)); + +my $result = $user->request($request); + +if ($result->is_success) { + print $result->content; +} else { + printf "%s\n", $result->status_line; +} + --- mailto-1.3.2.orig/debian/mailto.conf +++ mailto-1.3.2/debian/mailto.conf @@ -0,0 +1,7 @@ +# This is a template of a mailto.conf file +# +# Entries look like the following: email and optional realname of +# permitted receipant. +# +# joey@debian.org (Martin Schulze) +root --- mailto-1.3.2.orig/debian/readme.txt +++ mailto-1.3.2/debian/readme.txt @@ -0,0 +1,39 @@ +These are the sources to the CGI scripts developed and used at the +University of Karlsruhe, Germany. This is work in progress, so beware +and use at your own risk. Most of the programs won't be useful without +modification, as they represent the local status. However, if you have +patches or modifications you think could be useful for others too, feel +free to contact webmaster@rz.uni-karlsruhe.de + +The scripts usually constist of a single C file (with site-dependent +#defines at the top) .c, a language- and site-dependent include +file _.c (only German versions available now), linked +with CGI tools, Pattern Matching tools and Network Connection tools. +There often is a script update-, which is called from the main +update script which is run by cron nightly. Sometimes there's also +another C program/script used to preprocess data. + +This is the first time I distribute these programs, so may be I missed +something, forgot to include a file, etc. Please contact me if this should +be the case. + +Also, if you find this useful and want to install it at your Web site, +send me a notification - I want to see if there's public interest in +these tools; if it's worth to officially release and support them. + +util.c has been stolen from NCSA's CGI-Scripts distribution. +wildmat.c has been stolen from Rich Salz' INN library. +get_tcp_conn.h has been stolen from nntp.1.5.11 (?) + +mailto WWW Mail Gateway, replaces mailto: links since they don't work + in every browser. Has a configuration file for 'allowed' + mail addresses. + Demo: http://www.rz.uni-karlsruhe.de/cgi-bin/mailto + +Bye, Andy + +------------------------------------------------------------------------------- + Andreas Ley ! "Even when you're ! Email: ley@rz.uni-karlsruhe.de + Nelkenstr. 9 ! a genius, life is ! Voice: +49 721 84 10 36 + 76135 Karlsruhe ! a mystery!" ! RZ: +49 721 608 4038 + Germany ! Doogie Howser, M.D. ! AKK: +49 721 96 403 22 --- mailto-1.3.2.orig/debian/rules +++ mailto-1.3.2/debian/rules @@ -0,0 +1,110 @@ +#! /usr/bin/make -f + +# Copyright 1994-98 joey@infodrom.north.de (Martin Schulze) +# +# 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; version 2 dated June, 1991. +# +# 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, write to the Free Software +# Foundation Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA +SHELL=/bin/bash + +# The name and version of the source +# +source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g') +package = $(shell grep "^Package: " debian/control|head -1|sed 's/Package: \(.*\)/\1/g') +version = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g') +revision = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g') + +CFLAGS = -O2 -Wall + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +STRIP = -s +endif + +installbin = install -g root -o root -m 755 $(STRIP) +installdir = install -g root -o root -m 755 -d +installdoc = install -g root -o root -m 644 +installscript = install -g root -o root -m 755 + +build: + $(MAKE) CFLAGS="$(CFLAGS)" + touch stamp-build + +clean: debclean + rm -f stamp-build + rm -rf mailto *.o *~ + +debclean: +# Cleans debian binary directories to allow binary creation + rm -rf debian/tmp + rm -f debian/{files,substvars} + +binary-indep: +# Nothing to be done here + + binary-arch: debclean + test -f stamp-build || $(MAKE) -f debian/rules build + $(installdir) debian/tmp/DEBIAN + chown -R root.root debian/tmp + chmod -R g-ws debian/tmp + $(installdir) debian/tmp/usr/share/doc/$(package) + $(installdoc) debian/conffiles debian/tmp/DEBIAN/ + # + $(installdoc) debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian + $(installdoc) debian/copyright debian/tmp/usr/share/doc/$(package) + # + $(installdoc) debian/changes debian/tmp/usr/share/doc/$(package)/changelog + $(installdoc) debian/{readme,usage}.txt debian/tmp/usr/share/doc/$(package) + gzip -9f debian/tmp/usr/share/doc/$(package)/{changelog{,.Debian},{readme,usage}.txt} + # + $(installdir) debian/tmp/etc + $(installdoc) debian/mailto.conf debian/tmp/etc + # + $(installdir) debian/tmp/usr/lib/cgi-bin + $(installbin) mailto debian/tmp/usr/lib/cgi-bin + # +# $(installdir) debian/tmp/usr/share/man/man{5,8} +# $(installdoc) syslog.conf.5 debian/tmp/usr/share/man/man5 +# $(installdoc) {sysklogd,syslogd,klogd,debian/syslogd-listfiles}.8 debian/tmp/usr/share/man/man8 +# gzip -9 debian/tmp/usr/share/man/man?/* +# # + dpkg-shlibdeps debian/tmp/usr/lib/cgi-bin/mailto + dpkg-gencontrol -isp + dpkg --build debian/tmp .. + +binary: binary-indep binary-arch + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b' or dsc; false + +dsc: + -test -d debian/tmp && $(MAKE) -f debian/rules clean + if [ ! -f ../$(source)_$(version).orig.tar.gz -a -f ../orig/$(source)_$(version).orig.tar.gz ]; \ + then \ + ln -s orig/$(source)_$(version).orig.tar.gz ../$(source)_$(version).orig.tar.gz; \ + touch /tmp/stamp-$(source)-link; \ + fi; \ + cd .. && dpkg-source -b $(source)-$(version) + if [ -f /tmp/stamp-$(source)-link ]; then \ + rm ../$(source)_$(version).orig.tar.gz /tmp/stamp-$(source)-link; \ + fi + +checkroot: + $(checkdir) + test root = "`whoami`" + +dist: binary dsc + +.PHONY: binary binary-arch binary-indep clean checkroot + --- mailto-1.3.2.orig/debian/usage.txt +++ mailto-1.3.2/debian/usage.txt @@ -0,0 +1,89 @@ + A WWW FORMs to Mail gateway + + Copyright (c) 10.6.94 by Andreas Ley + + Permission to use, copy, modify, and distribute this software for any + purpose and without fee is hereby granted, provided that the above + copyright notice appears in all copies. This software is provided "as is" + and without any express or implied warranties. + + Usage: + + - Since WWW is anonymous, mail sent through the WWW Mail Gateway + is anonymous, too. Some people don't like to get anonymous mail, + that's why mailto can be used with an access configuration file, + which specifies who is enabled to get mail through the WWW Mail + Gateway. If you don't need access control, just undefine ADDRESSES, + otherwise point it to a configuration file with entries: +
() + is optional. + + - Calling /cgi-bin/mailto/
// gives you a template + mail FORM.
is the recipients email address, is + a predefined subject and is the URL of an acknowledgement page. + Any of the parameters may be skipped; since address and subject + are required, mailto will generate input fields if they're + missing. + + You may also call it from within a simple shell and you'll get + an example as well. + + - Create your own customized/beautified FORM with METHOD=POST and + ACTION=/cgi-bin/mailto/
//. As above,
+ is the recipients email address, is a predefined subject and + is the URL of an acknowledgement page. You can replace any of + these parameters by INPUTs with NAME= "To", "Subject" or "Acknowledge" + respectivly, which may also be of TYPE=hidden (recommended for the + acknowledgement URL). These INPUTs will be treated special, as will + be NAME="From" (NAME="Reply-To" provides the same functionality but + is obsolete and it's use is discouraged) and NAME="Copy-Self". They + all have precedence over the URL parameters. Use of the INPUTs is + recommended. + When the FORM is submitted, the
(or the VALUE of the + NAME="To" field) will be checked against the configuration file, the + contents will be converted into a mail message and the message will be + sent to
() with (or the VALUE of the + NAME="Subject" field) as the subject. Input fields will be listed as + ": " for one-line-contents and as + ":." for multi-line-contents + with leading periods preceeded by another period. + If an INPUT with TYPE="checkbox" and NAME="Copy-Self" has been checked, + a copy of the message will be sent to the originator of the message + as specified in the NAME="From" (or NAME="Reply-To") field. + If (or a field with NAME="Acknowledge") was specified, it will + be sent back as a confirmation to the sender. + + - Only addresses that are listed in /etc/mailto.conf are valid + and will be delivered. + +A common example would look like + +
+ E-Mail :

+ Copy :

+ Blind Copy:

+ Self Copy :

+ Hotlink :
+ + + + + . +

+ +Special variables +----------------- + +The following variables have a special meaning when they are part of +the form data which is sent to the web server and eventually to the +CGI program mailto. The field names are case sensitive. They won't +end up in the mail body but will be used for constructing and +delivering the resulting mail. + + Acknowledge Web page for redirection on success + Subject Subject of the sent mail + Reply-To | From Submitter address, will be used as From: line + Cc Send a copy to, visible in the header + Bcc Send a copy to, invisible in the header + Copy-Self Send a blind copy to the submitter + To Receipient of the mail, should be submitted as .../address --- mailto-1.3.2.orig/mailto.c +++ mailto-1.3.2/mailto.c @@ -3,7 +3,8 @@ ** ** A WWW FORMs to Mail gateway ** -** Copyright (c) 10.6.94 by Andreas Ley +** Copyright (c) 1994-1999 by Andreas Ley +** Copyright (c) 1998,2004 by Martin Schulze ** ** Permission to use, copy, modify, and distribute this software for any ** purpose and without fee is hereby granted, provided that the above @@ -32,7 +33,7 @@ ** - Create your own customized/beautified FORM with METHOD=POST and ** ACTION=/cgi-bin/mailto/
//. As above,
** is the recipients email address, is a predefined subject and -*** is the URL of an acknowledgement page. You can replace any of +** is the URL of an acknowledgement page. You can replace any of ** these parameters by INPUTs with NAME= "To", "Subject" or "Acknowledge" ** respectivly, which may also be of TYPE=hidden (recommended for the ** acknowledgement URL). These INPUTs will be treated special, as will @@ -115,31 +116,31 @@ ** anr@ime.usp.br (Adriano R.) ** pall@rz.uni-karlsruhe.de (Michael Pall) ** otisg@cobalt.middlebury.edu (Otis Gospodnetic) +** joey@infodrom.org (Martin Schulze) ** ** A current version of mailto can be retrieved from ** ftp://ftp.rz.uni-karlsruhe.de/pub/net/www/tools/cgi-src/mailto.tar.gz */ -char header[]="mailto v1.3.2\n(c) 1994-1998 by Andreas Ley (Andreas.Ley@rz.uni-karlsruhe.de)\n"; +char header[]="mailto v1.3.2\n(c) 1994-1999 by Andreas Ley \n"; /* General definitions */ -#define MASTER "webmaster@rz.uni-karlsruhe.de" -#define SENDER "www@rz.uni-karlsruhe.de (" TITLE ")" -#define ERRORS_TO "null@rz.uni-karlsruhe.de" +#define MASTER "root" /* we add the local host part */ +#define SENDER "not-for-mail" +#define ERRORS_TO "webmaster" #define SENDMAIL_SMTP /* There's no other method yet */ #define FULL_ACKNOWLEDGE /* Define this if you want an automatic full acknowledgement page */ -/* #define NEED_STRERROR /* Define this if you don't have strerr */ +/* #define NEED_STRERROR / * Define this if you don't have strerr */ /* File locations */ -/* -#define ADDRESSES "/usr/local/etc/httpd/config/mailto.conf" -*/ +#define ADDRESSES "/etc/mailto.conf" #include #include #include +#include #include #include #include @@ -173,10 +174,13 @@ /* Global variables */ char master[]=MASTER; +char hostname[255]; char *htag[1024],*hval[1024]; int max,debug=0; +#define ENC_8859_1 "ÄäÖöÜüßÅåÆæø" + /* Prints header of a HTML-Request */ void show_header(char *subtitle, char *description) { @@ -184,7 +188,7 @@ if (debug) (void)fprintf(stderr,"show_header(\"%s\",\"%s\")\n",subtitle,description); - while (ptr=strchr(header,'\n')) + while ((ptr=strchr(header,'\n'))) *ptr=' '; (void)printf("Content-type: text/html\n\n"); (void)printf("\n"); @@ -197,7 +201,7 @@ (void)printf("\n"); (void)printf("

%s

\n",subtitle?subtitle:TITLE); if (description) { - (void)printf(description,master); + (void)printf(description,master,hostname); (void)printf("

\n"); } } @@ -233,7 +237,7 @@ if (debug) (void)fprintf(stderr,"show_fatal(\"%s\")\n",error); show_header(ERROR,error); - (void)printf(ERROR_FATAL,master); + (void)printf(ERROR_FATAL,master,hostname); (void)printf("

\n"); show_trailer(); exit(0); @@ -246,8 +250,13 @@ { if (debug) (void)fprintf(stderr,"show_location(\"%s\")\n",location); - (void)printf("Location: %s\n",location); - (void)printf("URI: %s\n\n",location); + + (void)printf("Content-type: text/html\n"); + (void)printf("Content-length: %ld\n", (long) (strlen (REDIRECT)-4+2*strlen (location))); + (void)printf("Status: 302 Temporal Relocation\n"); + (void)printf("Location: %s\n\n", location); + + (void)printf(REDIRECT, location, location); } @@ -257,7 +266,7 @@ int cnt; if (debug) - (void)fprintf(stderr,"tagindex(0x%08lx,08lx,\"%s\")\n",htag,max,tagname); + (void)fprintf(stderr,"tagindex(%p,%08x,\"%s\")\n",htag,max,tagname); for (cnt=0;cnt=0x20) - *dest++=*src; + for (src=text,dest=text;*src;) + /* + * Linkname: Table demonstrating the UTF-8 encoding + * URL: http://www1.tip.nl/~t876506/utf8tbl.html + * + * If z is between and including 0 - 127, then there is 1 byte + * + * If z is between and including 192 - 223, then there are 2 bytes + * + * If z is between and including 224 - 239, then there are 3 bytes + * + * If z is between and including 240 - 247, then there are 4 bytes + * + * If z is between and including 248 - 251, then there are 5 bytes + * + * If z is 252 or 253, then there are 6 bytes + * + * If z = 254 or 255 then there is something wrong! + */ + if ((*src&0xE0)>=0xC0 && + *(src+1) && (*(src+1) & 0xC0) == 0x80) + for (i=0;i<2;i++) + *dest++=*src++; + else if ((*src&0xD0)>=0xD0 && + *(src+1) && (*(src+1) & 0xC0) == 0x80 && + *(src+2) && (*(src+2) & 0xC0) == 0x80) + for (i=0;i<3;i++) + *dest++=*src++; + else if ((*src&0xF0)>=0xF0 && + *(src+1) && (*(src+1) & 0xC0) == 0x80 && + *(src+2) && (*(src+2) & 0xC0) == 0x80 && + *(src+3) && (*(src+3) & 0xC0) == 0x80) + for (i=0;i<4;i++) + *dest++=*src++; + else if ((*src&0xF8)>=0xF8 && + *(src+1) && (*(src+1) & 0xC0) == 0x80 && + *(src+2) && (*(src+2) & 0xC0) == 0x80 && + *(src+3) && (*(src+3) & 0xC0) == 0x80 && + *(src+4) && (*(src+4) & 0xC0) == 0x80) + for (i=0;i<5;i++) + *dest++=*src++; + else if ((*src&0xFC)>=0xFC && + *(src+1) && (*(src+1) & 0xC0) == 0x80 && + *(src+2) && (*(src+2) & 0xC0) == 0x80 && + *(src+3) && (*(src+3) & 0xC0) == 0x80 && + *(src+4) && (*(src+4) & 0xC0) == 0x80 && + *(src+5) && (*(src+5) & 0xC0) == 0x80) + for (i=0;i<6;i++) + *dest++=*src++; + else if ((*src&0x7f)>=0x20) + *dest++=*src++; + else + src++; *dest='\0'; } if (debug) - (void)fprintf(stderr,"secure()=0x%08lx\n",text); + (void)fprintf(stderr,"secure()=%p\n",text); return(text); } @@ -319,7 +379,7 @@ *ptr='\0'; if (debug) (void)fprintf(stderr,"checkaccess: \"%s\"\n",buffer); - if ((!strncmp(buffer,address,(size_t)len))&&(buffer[len]==' '||buffer[len]=='\t'||buffer[len]=='\0')) { + if ((!strncasecmp(buffer,address,(size_t)len))&&(buffer[len]==' '||buffer[len]=='\t'||buffer[len]=='\0')) { (void)fclose(src); if (debug) (void)fprintf(stderr,"checkaccess: valid \"%s\"\n",buffer); @@ -328,7 +388,7 @@ } (void)fclose(src); if (check) { - (void)sprintf(buffer,BAD_ADDRESS,address,master); + (void)sprintf(buffer,BAD_ADDRESS,address,master,hostname); show_error(buffer); } else @@ -337,12 +397,77 @@ else show_fatal(ERROR_READ); /*NOTREACHED*/ -#else /* ADDRESSES */ - return(address); #endif /* ADDRESSES */ + return(address); } +char *encoding() +{ + int cnt; + char *cp; + static char enc[10]; + + for (cnt=0; cnt=0xC0 && + *(cp+1) && (*(cp+1) & 0xC0) == 0x80){ + strcpy(enc, "utf-8"); + return enc; + } else if ((*cp&0xD0)>=0xD0 && + *(cp+1) && (*(cp+1) & 0xC0) == 0x80 && + *(cp+2) && (*(cp+2) & 0xC0) == 0x80) { + strcpy(enc, "utf-8"); + return enc; + } else if ((*cp&0xF0)>=0xF0 && + *(cp+1) && (*(cp+1) & 0xC0) == 0x80 && + *(cp+2) && (*(cp+2) & 0xC0) == 0x80 && + *(cp+3) && (*(cp+3) & 0xC0) == 0x80) { + strcpy(enc, "utf-8"); + return enc; + } else if ((*cp&0xF8)>=0xF8 && + *(cp+1) && (*(cp+1) & 0xC0) == 0x80 && + *(cp+2) && (*(cp+2) & 0xC0) == 0x80 && + *(cp+3) && (*(cp+3) & 0xC0) == 0x80 && + *(cp+4) && (*(cp+4) & 0xC0) == 0x80) { + strcpy(enc, "utf-8"); + return enc; + } else if ((*cp&0xFC)>=0xFC && + *(cp+1) && (*(cp+1) & 0xC0) == 0x80 && + *(cp+2) && (*(cp+2) & 0xC0) == 0x80 && + *(cp+3) && (*(cp+3) & 0xC0) == 0x80 && + *(cp+4) && (*(cp+4) & 0xC0) == 0x80 && + *(cp+5) && (*(cp+5) & 0xC0) == 0x80) { + strcpy(enc, "utf-8"); + return enc; + } else if ((*cp&0x7f)>=0x20 && + strchr(ENC_8859_1, *cp) != NULL) { + strcpy(enc, "iso-8859-1"); + return enc; + } + } + + return NULL; +} + /* Actually send mail to recipient */ void mailto(char *address, char *fulladdress, char *cc, char *bcc, char *subject, char *from, int copyself) @@ -350,40 +475,46 @@ char buffer[1024],error[2048],*ptr,*nptr; int cnt,retval; FILE *dest; + char *enc; if (debug) (void)fprintf(stderr,"mailto(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%d)\n",address,fulladdress,cc,bcc,subject,from,copyself); #ifdef SENDMAIL_SMTP - (void)sprintf(buffer,MAILCMD,address); + strcpy(buffer,MAILCMD); if ((dest=popen(buffer,"w"))) { - (void)fprintf(dest,"HELO\n"); - (void)fprintf(dest,"MAIL FROM:<%s>\n",SENDER); - (void)fprintf(dest,"RCPT TO:<%s>\n",address); + (void)fprintf(dest,"HELO localhost\r\n"); + (void)fprintf(dest,"MAIL FROM:<%s@%s>\r\n",SENDER,hostname); + (void)fprintf(dest,"RCPT TO:<%s>\r\n",address); if (cc) - (void)fprintf(dest,"RCPT TO:<%s>\n",cc); + (void)fprintf(dest,"RCPT TO:<%s>\r\n",cc); if (bcc) - (void)fprintf(dest,"RCPT TO:<%s>\n",bcc); + (void)fprintf(dest,"RCPT TO:<%s>\r\n",bcc); if (copyself) - (void)fprintf(dest,"RCPT TO:<%s>\n",from); - (void)fprintf(dest,"DATA\n"); - (void)fprintf(dest,"From: %s\n",from); - (void)fprintf(dest,"Subject: %s\n",subject); - (void)fprintf(dest,"Sender: %s\n",SENDER); + (void)fprintf(dest,"RCPT TO:<%s>\r\n",from); + (void)fprintf(dest,"DATA\r\n"); + (void)fprintf(dest,"From: %s\r\n",from); + (void)fprintf(dest,"Subject: %s\r\n",subject); + (void)fprintf(dest,"Sender: %s@%s\r\n",SENDER,hostname); #ifdef ERRORS_TO - (void)fprintf(dest,"Errors-To: %s\n",ERRORS_TO); + (void)fprintf(dest,"Errors-To: %s@%s\r\n",ERRORS_TO,hostname); #endif - (void)fprintf(dest,"To: %s\n",fulladdress); + (void)fprintf(dest,"To: %s\r\n",fulladdress); + if ((enc = encoding()) != NULL) { + (void)fprintf(dest,"Content-Type: text/plain; charset=%s\r\n", enc); + (void)fprintf(dest,"Content-Disposition: inline\r\n"); + (void)fprintf(dest,"Content-Transfer-Encoding: 8bit\r\n"); + } if (cc) - (void)fprintf(dest,"Cc: %s\n",cc); + (void)fprintf(dest,"Cc: %s\r\n",cc); if ((ptr=getenv("REMOTE_ADDR"))&&*ptr) - (void)fprintf(dest,"X-Addr: %s\n",ptr); + (void)fprintf(dest,"X-Addr: %s\r\n",ptr); if ((ptr=getenv("REMOTE_HOST"))&&*ptr) - (void)fprintf(dest,"X-Host: %s\n",ptr); + (void)fprintf(dest,"X-Host: %s\r\n",ptr); if ((ptr=getenv("REMOTE_IDENT"))&&*ptr) - (void)fprintf(dest,"X-Ident: %s\n",ptr); + (void)fprintf(dest,"X-Ident: %s\r\n",ptr); if ((ptr=getenv("REMOTE_USER"))&&*ptr) - (void)fprintf(dest,"X-User: %s\n",ptr); - (void)fprintf(dest,"\n"); + (void)fprintf(dest,"X-User: %s\r\n",ptr); + (void)fprintf(dest,"\r\n"); /* Print all the fields preceeded by their name */ for (cnt=0;cnth_name); + else + snprintf(hostname, sizeof(hostname), "%s", localhost); + } + } + ptr=getenv("PATH_INFO"); if (debug) (void)fprintf(stderr,"PATH_INFO=\"%s\"\n",ptr); @@ -475,7 +635,7 @@ *subject++='\0'; if ((location=strchr(subject,'/'))) { *location++='\0'; - if ((ptr=strchr(location,':'))&&ptr[1]=='/') + if ((ptr=strchr(location,':'))&&ptr[1]=='/') { if (ptr[2]!='/') { nptr=malloc(strlen(location)+2); (void)strncpy(nptr,location,(size_t)(ptr-location)+2); @@ -483,6 +643,7 @@ location=nptr; } else if (ptr[3]=='/') (void)strcpy(ptr+2,ptr+3); + } } } } @@ -500,7 +661,7 @@ (void)fprintf(stderr,"REQUEST_METHOD=\"%s\"\n",ptr); if (!ptr||strcmp(ptr,"POST")) { show_header(NULL,NULL); - (void)printf(DEFAULT_FORM_HEADER,getenv("SCRIPT_NAME")); + (void)printf(DEFAULT_FORM_HEADER,"/cgi-bin/mailto"); (void)printf(address?DEFAULT_FORM_HIDDEN:DEFAULT_FORM_ADDRESS,"To",address); (void)printf(DEFAULT_FORM_CC,"Cc"); (void)printf(subject?DEFAULT_FORM_HIDDEN:DEFAULT_FORM_SUBJECT,"Subject",subject); @@ -580,8 +741,12 @@ /* Add pid to subject */ if (strstr(subject,"%d")) { + val = strstr(subject,"%d"); ptr=malloc(strlen(subject)+16); - (void)sprintf(ptr,subject,getpid()); + cnt = strlen(subject)+16; + *val = 0; + val += 2; + (void)snprintf(ptr,cnt,"%s%d%s",subject,getpid(),val); if (debug) (void)fprintf(stderr,"Subject: \"%s\" -> \"%s\"\n",subject,ptr); subject=ptr; @@ -612,14 +777,14 @@ (void)printf(SUCCESS_COPY,checkaccess(bcc,FALSE)); } else - (void)printf(SUCCESS_COPY,checkaccess(from,FALSE)); + (void)printf(SUCCESS_COPY,checkaccess(cc,FALSE)); } else - (void)printf(SUCCESS_DESC,fulladdress); + (void)printf(SUCCESS_DESC); #ifdef FULL_ACKNOWLEDGE (void)printf(SUCCESS_FROM,from); (void)printf(SUCCESS_SUBJECT,subject); - (void)printf(SUCCESS_SENDER,SENDER); + (void)printf(SUCCESS_SENDER,SENDER,hostname); (void)printf(SUCCESS_TO,fulladdress); if (cc) (void)printf(SUCCESS_CC,cc); --- mailto-1.3.2.orig/mailto_english.h +++ mailto-1.3.2/mailto_english.h @@ -24,7 +24,7 @@ #define SUCCESS_COPY " and a copy to %s.\n" #define SUCCESS_FROM "

From: %s\n" #define SUCCESS_SUBJECT "
Subject: %s\n" -#define SUCCESS_SENDER "
Sender: %s\n" +#define SUCCESS_SENDER "
Sender: %s@%s\n" #define SUCCESS_TO "
To: %s\n" #define SUCCESS_CC "
Cc: %s\n" #define SUCCESS_BCC "
Bcc: %s\n" @@ -40,12 +40,21 @@ /* Error messages */ #define ERROR "Error" -#define ERROR_FATAL "

This shouldn't occur. Please contact %s, describing from which page you got this error and what you did enter. Your software environment could be interesting, too." +#define ERROR_FATAL "

This shouldn't occur. Please contact %s@%s, describing from which page you got this error and what you did enter. Your software environment could be interesting, too." #define ERROR_REQUEST_METHOD "Wrong REQUEST_METHOD (%s), expected %s." #define ERROR_CONTENT_TYPE "Wrong CONTENT_TYPE (%s), expected %s." #define ERROR_CONTENT_LENGTH "CONTENT_LENGTH is zero." #define ERROR_ADDRESS "Missing recipient or subject information." #define ERROR_READ "Error accessing the addresses file." #define ERROR_POPEN "Error sending the mail:

popen(\"%s\"): %s" -#define ERROR_PCLOSE "Error sending the mail:

%s returns exit code %d." -#define BAD_ADDRESS "Address %s isn't listed in the addresses file. To protect our users from anonymous mails, addresses have to be registered with %s first." +#define ERROR_PCLOSE "Error sending the mail:

%s returns exit code %d. Mail could be lost." +#define BAD_ADDRESS "Address %s isn't listed in the addresses file. To protect our users from anonymous mails, addresses have to be registered with %s@%s first." + +/* Redirection */ + +#define REDIRECT "\r\n\ +\r\n\ +The page has been moved to %s\r\n\ +\r\n\ +\r\n\ +" --- mailto-1.3.2.orig/mailto_german.h +++ mailto-1.3.2/mailto_german.h @@ -18,13 +18,13 @@ /* Everything's fine */ #define SUCCESS_HEADER NULL -#define SUCCESS_DESC "Ihre Meldung wurde abgeschickt.\n" -#define SUCCESS_SENT "Ihre Meldung wurde an %s" +#define SUCCESS_DESC "Ihre Meldung wurde abgeschickt." +#define SUCCESS_SELF "Ihre Meldung wurde an %s und eine Kopie an %s abgeschickt." #define SUCCESS_ALSO ", %s" #define SUCCESS_COPY " und eine Kopie an %s abgeschickt.\n" #define SUCCESS_FROM "

From: %s\n" #define SUCCESS_SUBJECT "
Subject: %s\n" -#define SUCCESS_SENDER "
Sender: %s\n" +#define SUCCESS_SENDER "
Sender: %s@%s\n" #define SUCCESS_TO "
To: %s\n" #define SUCCESS_CC "
Cc: %s\n" #define SUCCESS_BCC "
Bcc: %s\n" @@ -40,12 +40,21 @@ /* Error messages */ #define ERROR "Fehler" -#define ERROR_FATAL "

Ein solcher Fehler darf eigentlich nicht auftreten. Bitte setzen Sie sich mit %s in Verbindung und erläutern Sie, wie es zu diesem Fehler gekommen ist. Interessant ist insbesondere, von welcher Seite Sie diese Fehlermeldung erhalten, was Sie eingegeben haben und welche Software Sie verwenden." +#define ERROR_FATAL "

Ein solcher Fehler darf eigentlich nicht auftreten. Bitte setzen Sie sich mit %s@%s in Verbindung und erläutern Sie, wie es zu diesem Fehler gekommen ist. Interessant ist insbesondere, von welcher Seite Sie diese Fehlermeldung erhalten, was Sie eingegeben haben und welche Software Sie verwenden." #define ERROR_REQUEST_METHOD "Es wurde ein falscher REQUEST_METHOD-Aufruf (%s) verwendet, erwartet wurde %s." #define ERROR_CONTENT_TYPE "Es wurde ein falscher CONTENT_TYPE (%s) übergeben, erwartet wurde %s." #define ERROR_CONTENT_LENGTH "CONTENT_LENGTH ist null." #define ERROR_ADDRESS "Es fehlen die Angaben über Mail-Adresse und Subject." #define ERROR_READ "Fehler beim Lesen der Adressdatei." -#define ERROR_POPEN "Fehler beim Verschicken der Meldung:

popen(\"%s\"): %s" -#define ERROR_PCLOSE "Fehler beim Verschicken der Meldung:

%s liefert exit code %d." -#define BAD_ADDRESS "Die angegebene Adresse %s ist nicht in der Liste der erlaubten Adressen eingetragen. Um die Benutzer vor anonymen Mails zu schützen, müssen potentielle Empfänger sich (via Email an %s) in diese Liste eintragen lassen." +#define ERROR_POPEN "Fehler beim Versenden der Meldung:

popen(\"%s\"): %s" +#define ERROR_PCLOSE "Fehler beim Versenden der Meldung:

%s liefert exit code %d. Mail kann verloren gegangen sein." +#define BAD_ADDRESS "Die angegebene Adresse %s ist nicht in der Liste der erlaubten Adressen eingetragen. Um die Benutzer vor anonymen Mails zu schützen, müssen potentielle Empfänger sich (via Email an %s@%s) in diese Liste eintragen lassen." + +/* Redirection */ + +#define REDIRECT "\r\n\ +\r\n\ +Die Seite wurde nach %s verschoben\r\n\ +\r\n\ +\r\n\ +" --- mailto-1.3.2.orig/util.c +++ mailto-1.3.2/util.c @@ -5,6 +5,8 @@ #define LF 10 #define CR 13 +#define HAS_GETLINE /* Don't include included getline function */ + void getword(char *word, char *line, char stop) { int x = 0,y; @@ -93,6 +95,7 @@ return -1; } +#ifndef HAS_GETLINE int getline(char *s, int n, FILE *f) { register int i=0; @@ -109,6 +112,7 @@ ++i; } } +#endif void send_fd(FILE *f, FILE *fd) {