aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew>2007-10-22 18:00:04 +0000
committermatthew <matthew>2007-10-22 18:00:04 +0000
commited4094cec0609ad05a599d6f5a7d7f0436442e7b (patch)
tree0ad9c3c877b4d863ca8c2a379f880ba78fe3181b
parenta4e6d6ea3544da74dc358a551db87acaa084d602 (diff)
Add missing message IDs.
-rwxr-xr-xbin/send-questionnaires4
-rwxr-xr-xbin/send-reports8
-rwxr-xr-xweb/contact.cgi6
-rwxr-xr-xweb/flickr.cgi6
4 files changed, 16 insertions, 8 deletions
diff --git a/bin/send-questionnaires b/bin/send-questionnaires
index 8bfde81d8..43267643f 100755
--- a/bin/send-questionnaires
+++ b/bin/send-questionnaires
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: send-questionnaires,v 1.5 2007-06-15 14:57:51 matthew Exp $
+# $Id: send-questionnaires,v 1.6 2007-10-22 18:00:04 matthew Exp $
use strict;
require 5.8.0;
@@ -24,6 +24,7 @@ use mySociety::DBHandle qw(dbh select_all);
use mySociety::Email;
use mySociety::MaPit;
use mySociety::EmailUtil;
+use mySociety::Random qw(random_bytes);
BEGIN {
mySociety::Config::set_file("$FindBin::Bin/../conf/general");
@@ -81,6 +82,7 @@ foreach my $row (@$unsent) {
_parameters_ => \%h,
To => [ [ $row->{email}, $row->{name} ] ],
From => [ mySociety::Config::get('CONTACT_EMAIL'), 'FixMyStreet' ],
+ 'Message-ID' => sprintf('<ques-%s-%s@mysociety.org>', time(), unpack('h*', random_bytes(5))),
});
print "Sending questionnaire $id, problem $row->{id}, token $token to $row->{email}\n" if $verbose;
diff --git a/bin/send-reports b/bin/send-reports
index f04582bd2..9664832a3 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: send-reports,v 1.47 2007-10-18 16:34:08 matthew Exp $
+# $Id: send-reports,v 1.48 2007-10-22 18:00:04 matthew Exp $
use strict;
require 5.8.0;
@@ -22,6 +22,7 @@ use mySociety::DBHandle qw(dbh select_all);
use mySociety::Email;
use mySociety::EmailUtil;
use mySociety::MaPit;
+use mySociety::Random qw(random_bytes);
BEGIN {
mySociety::Config::set_file("$FindBin::Bin/../conf/general");
@@ -54,7 +55,7 @@ foreach my $row (@$unsent) {
if (dbh()->selectrow_array('select email from abuse where lower(email)=?', {}, lc($row->{email}))) {
dbh()->do("update problem set state='hidden' where id=?", {}, $row->{id});
- dbh()->commit();
+ dbh()->commit();
next;
}
# XXX Needs locks!
@@ -129,7 +130,8 @@ If you know of an appropriate contact address, please do get in touch. ]\n\n";
_template_ => $template,
_parameters_ => \%h,
To => \@to,
- From => [ $row->{email}, $row->{name} ]
+ From => [ $row->{email}, $row->{name} ],
+ 'Message-ID' => sprintf('<report-%s-%s@mysociety.org>', time(), unpack('h*', random_bytes(5))),
});
my $result;
diff --git a/web/contact.cgi b/web/contact.cgi
index 4a0a03bd4..67c19b081 100755
--- a/web/contact.cgi
+++ b/web/contact.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: contact.cgi,v 1.23 2007-08-29 23:03:16 matthew Exp $
+# $Id: contact.cgi,v 1.24 2007-10-22 18:00:04 matthew Exp $
use strict;
use Standard;
@@ -14,6 +14,7 @@ use CrossSell;
use mySociety::Email;
use mySociety::EmailUtil;
use mySociety::Web qw(ent);
+use mySociety::Random qw(random_bytes);
# Main code for index.cgi
sub main {
@@ -60,7 +61,8 @@ sub contact_submit {
_body_ => "$message\n\n$postfix",
From => [$input{email}, $input{name}],
To => [[mySociety::Config::get('CONTACT_EMAIL'), 'FixMyStreet']],
- Subject => 'FMS message: ' . $subject
+ Subject => 'FMS message: ' . $subject,
+ 'Message-ID' => sprintf('<contact-%s-%s@mysociety.org>', time(), unpack('h*', random_bytes(5))),
});
my $result = mySociety::EmailUtil::send_email($email, $input{email}, mySociety::Config::get('CONTACT_EMAIL'));
if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) {
diff --git a/web/flickr.cgi b/web/flickr.cgi
index ac0e83d78..32b51bd7a 100755
--- a/web/flickr.cgi
+++ b/web/flickr.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: flickr.cgi,v 1.5 2007-08-29 23:03:16 matthew Exp $
+# $Id: flickr.cgi,v 1.6 2007-10-22 18:00:04 matthew Exp $
use strict;
use Standard;
@@ -14,6 +14,7 @@ use LWP::Simple;
use mySociety::AuthToken;
use mySociety::Email;
use mySociety::EmailUtil;
+use mySociety::Random qw(random_bytes);
sub main {
my $q = shift;
@@ -29,7 +30,7 @@ sub main {
$url = 'http://api.flickr.com/services/rest/?method=flickr.people.getInfo&api_key='.$key.'&user_id='.$nsid;
$result = get($url);
my ($name) = $result =~ /<realname>(.*?)<\/realname>/;
- $name ||= '';
+ $name ||= '';
my $id = dbh()->selectrow_array("select nextval('flickr_id_seq');");
dbh()->do("insert into flickr (id, nsid, name, email) values (?, ?, ?, ?)", {},
@@ -56,6 +57,7 @@ EOF
_parameters_ => \%h,
To => $email,
From => [ mySociety::Config::get('CONTACT_EMAIL'), 'FixMyStreet' ],
+ 'Message-ID' => sprintf('<flickr-%s-%s@mysociety.org>', time(), unpack('h*', random_bytes(5))),
});
my $result;