[Popcon-developers] Bug#319273: popularity-contest: should be able to send copies to From address

Ulf Harnhammar metaur at telia.com
Wed Jul 20 20:40:30 UTC 2005


Subject: popularity-contest: should be able to send copies to From address
Package: popularity-contest
Version: 1.30
Severity: wishlist
Tags: patch

Hello,

I want to see what popularity-contest does and what information is included in the
mails that it sends. Therefore, I wrote this simple patch that sends a copy of
the e-mails to the From address, if COPYTOFROMADDRESS is set to "yes".

Please consider including this patch in the program.

// Ulf Harnhammar

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages popularity-contest depends on:
ii  debconf [debconf-2.0]         1.4.52     Debian configuration management sy

Versions of packages popularity-contest recommends:
ii  cron                          3.0pl1-87  management of regular background p
ii  exim4                         4.52-1     metapackage to ease exim MTA (v4) 
ii  exim4-daemon-light [mail-tran 4.52-1     lightweight exim MTA (v4) daemon
pn  mime-construct                <none>     (no description available)

-- debconf information:
  popularity-contest/hostid-failed:
* popularity-contest/participate: true
  popularity-contest/use-http: true
                     ^^^^^^^^^^^^^^  (huh? a bug??)

-------------- next part --------------
--- etc/cron.weekly/popularity-contest.old	2005-07-07 20:15:03.000000000 +0200
+++ etc/cron.weekly/popularity-contest	2005-07-20 20:16:31.088265344 +0200
@@ -11,6 +11,7 @@
 unset PARTICIPATE
 unset SUBMITURLS
 unset USEHTTP
+unset COPYTOFROMADDRESS
 
 # get configuration information
 . /usr/share/popularity-contest/default.conf
@@ -36,10 +37,15 @@
 
 do_sendmail()
 {
+	REALMAILTO="$MAILTO"
+	if [ "yes" = "$COPYTOFROMADDRESS" ]; then
+		REALMAILTO="$MAILTO, $MAILFROM"
+	fi
+
 	if [ -n "$MAILFROM" ]; then
-		sendmail -oi -f "$MAILFROM" "$MAILTO"
+		sendmail -oi -f "$MAILFROM" "$REALMAILTO"
 	else
-		sendmail -oi "$MAILTO"
+		sendmail -oi "$REALMAILTO"
 	fi
 }
 


More information about the Popcon-developers mailing list