annotate contrib/rmail @ 179:ec3fe72a3e99

Fixed an important bug with folded headers! g_strconcat() returns a *copy* of the string, but hdr->value still pointed to the old header (which probably was a memory leak, too). If the folded part had been quite small it was likely that the new string was at the same position as the old one, thus making everything go well. But if pretty long headers were folded several times it was likely that the new string was allocated somewhere else in memory, thus breaking things. In result mails to lots of recipients (folded header) were frequently only sent to the ones in the first line. Sorry for the inconvenience.
author meillo@marmaro.de
date Fri, 03 Jun 2011 09:52:17 +0200
parents 92673a185add
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
86
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
1 #!/bin/sh
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
2 #
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
3 # Dummy UUCP rmail command for postfix/qmail systems
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
4 #
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
5 # written by luciano l. mannucci <luke@nameron.smd.sublink.org>
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
6 # improved by Wietse Venema <wietse@porcupine.org>
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
7 # see:
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
8 # List: postfix-users
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
9 # Subject: Rmail: very small fix
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
10 # From: luke@nameron.smd.sublink.org (luciano l. mannucci)
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
11 # Date: 2000-09-13 14:31:30
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
12 # URL: http://marc.info/?l=postfix-users&m=96885536302087
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
13 #
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
14 # taken from postfix-2.5.5/auxiliary/rmail/rmail
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
15
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
16
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
17 SENDMAIL="/usr/sbin/sendmail"
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
18 IFS=" " read junk from junk junk junk junk junk junk junk relay
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
19
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
20 case "$from" in
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
21 *[@!]*) ;;
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
22 *) from="$from@$relay";;
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
23 esac
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
24
92673a185add added rmail script from postfix
meillo@marmaro.de
parents:
diff changeset
25 exec $SENDMAIL -i -f "$from" -- "$@"