[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#636599: lintian: warning for using (bouncing) maintainer addresses



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

tags 636599 +patch
thanks

Hello,
I'm proposing two new tags for Lintian:

* maintainer-address-causes-mail-loops-or-bounces
* upload-address-causes-mail-loops-or-bounces
(also known as "paultag-tribute-tag")

They do both the same for the Maintainer and Uploaders field
respectively. They check whether the e-mail addresses causes a mail
loop, e.g. by setting either maintainer address to
package@packages.debian.org.

Moreover, while I was at it, Niels also pointed me to this bug which is
somehow related and fixed along by introducing a new data store of known
addresses which bounce back mails.

The patch is disabled in the Ubuntu profile by default.

- -- 
with kind regards,
Arno Töll
IRC: daemonkeeper on Freenode/OFTC
GnuPG Key-ID: 0x9D80F36D
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOtbJ2AAoJEMcrUe6dgPNtpisP+wQyFLcFiSlenHuip5uwbMiv
a+1H5pEHRmcZK2btjGpQNz+yq+kKD2dPar62gH+gac8ZWhp/TzvXu1MKZNQAwBEY
msFHgETIjsf0UPplGfpSim+433FFZp2jfjqnXshUO9uBTdykZwUeiICTsr7OFE+b
CNYBF2yRgV0eEHa05Bxj0KmEEv5WtM5+OlLaqPawhq9KPn/tsYaYImsMSgxAbhpB
TIb2Cg/nebOEUKt4hgCyb8OXd43qFYZcnWZraV5WRCEpiZnRRHVxZHZTTrFG75FN
EhIGEnBZ2vbql3scGmwiNpYfgKntwm9lQZe7UUuBdLLkIpLfFpaSYDji6rOP8yvg
+d1KTpPu15C/T8cvSj/xcI2X+I2QcVY31rcCAS2371aACprnldoQSn5qSwwgapjU
3me+4/wYEjDdpHGzsj3+wKH8pFJSsB0CkvBkB9/kWQR2e+nPqrSVG1U9bEqsOCIp
K9r4cFPQbaTj96pKtOPHThlOk5UGleVaGwI3NpATbrt1MIrneixj7ho2x7Ly23Zo
+ILuigfapSVWoEFAB90rsOjs/iZdh0KAlzw8tVyS7jSaoWIxFjzMw6zQBnyRwdW9
NJBMCdWad1e/H74CD4xL/Eidn1dBw1J2OveWCJ/2Wzeczw3cl4/u6LIVVGUlLOrs
oeCuj2Yf9g8tjq97Kjxj
=dloz
-----END PGP SIGNATURE-----
>From 722b9e2726e5392df83f22c9eb975e9dc0a366a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arno=20T=C3=B6ll?= <debian@toell.net>
Date: Sat, 5 Nov 2011 22:51:28 +0100
Subject: [PATCH] Add
 (maintainer|uploader)-address-causes-mail-loops-or-bounces
 tags which warns the user if the maintainer address is set
 to the Debian QA package aliases, or, alternatively is set
 to a mailing list which is known to bounce Debian role
 mails (Closes #636599).

---
 checks/fields.desc                                 |   26 ++++++++++++++++++++
 data/fields/bounceaddresses                        |    4 +++
 lib/Lintian/Check.pm                               |   16 ++++++++++++
 profiles/ubuntu/main.profile                       |    2 +
 t/scripts/implemented-tags.t                       |    1 +
 .../debian/debian/control.in                       |   18 +++++++++++++
 t/tests/fields-maintainer-bounces/desc             |    7 +++++
 t/tests/fields-maintainer-bounces/tags             |    6 ++++
 .../debian/debian/control.in                       |    1 +
 t/tests/fields-maintainer-general/desc             |    2 +-
 t/tests/fields-maintainer-general/tags             |    1 +
 11 files changed, 83 insertions(+), 1 deletions(-)
 create mode 100644 data/fields/bounceaddresses
 create mode 100644 t/tests/fields-maintainer-bounces/debian/debian/control.in
 create mode 100644 t/tests/fields-maintainer-bounces/desc
 create mode 100644 t/tests/fields-maintainer-bounces/tags

diff --git a/checks/fields.desc b/checks/fields.desc
index 7334b34..1aadcc0 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -186,6 +186,19 @@ Info: The maintainer address includes localhost(.localdomain), which is
  an invalid e-mail address.
 Ref: policy 5.6.2
 
+Tag: maintainer-address-causes-mail-loops-or-bounces
+Severity: serious
+Certainty: certain
+Info: The maintainer e-mail address either loops back to itself because
+ it is set to package@packages.debian.org or
+ package@qa.packages.debian.org  or references an email address
+ (typically a mailing list) which is  known to bounce mails. Policy
+ states: The email address given in the Maintainer control field must
+ accept  mail from those role accounts in Debian used to send automated
+ mails  regarding the package. This includes non-spam mail from the bug-
+ tracking system.
+Ref: policy 3.3
+
 Tag: uploader-name-missing
 Severity: serious
 Certainty: certain
@@ -227,6 +240,19 @@ Info: The uploader address includes localhost(.localdomain), which is
  an invalid e-mail address.
 Ref: policy 5.6.3
 
+Tag: uploader-address-causes-mail-loops-or-bounces
+Severity: serious
+Certainty: certain
+Info: The maintainer e-mail address either loops back to itself because
+ it is set to package@packages.debian.org or
+ package@qa.packages.debian.org  or references an email address
+ (typically a mailing list) which is  known to bounce mails. Policy
+ states: The email address given in the Maintainer control field must
+ accept  mail from those role accounts in Debian used to send automated
+ mails  regarding the package. This includes non-spam mail from the bug-
+ tracking system.
+Ref: policy 3.3
+
 Tag: wrong-debian-qa-address-set-as-maintainer
 Severity: important
 Certainty: certain
diff --git a/data/fields/bounceaddresses b/data/fields/bounceaddresses
new file mode 100644
index 0000000..cb84fed
--- /dev/null
+++ b/data/fields/bounceaddresses
@@ -0,0 +1,4 @@
+# Manually maintained list of known e-mail addresses which bounce e-mails from
+# role accounts.
+
+ubuntu-devel-discuss@lists.ubuntu.com
diff --git a/lib/Lintian/Check.pm b/lib/Lintian/Check.pm
index 5050843..acbc4c1 100644
--- a/lib/Lintian/Check.pm
+++ b/lib/Lintian/Check.pm
@@ -28,6 +28,8 @@ use Email::Valid;
 use Lintian::Data;
 use Lintian::Tags qw(tag);
 
+our $KNOWN_BOUNCE_ADDRESSES = Lintian::Data->new('fields/bounceaddresses');
+
 our @ISA    = qw(Exporter);
 our @EXPORT = qw(check_maintainer check_spelling check_spelling_picky $known_shells_regex);
 
@@ -79,6 +81,14 @@ the tags below will be replaced with the value of FIELD.
 The e-mail address portion of MAINTAINER is at C<localhost> or some other
 similar domain.
 
+=item %s-address-causes-mail-loops-or-bounces
+
+The e-mail address portion of MAINTAINER or UPLOADER refers to the PTS
+e-mail addresses  C<package@packages.debian.org> or
+C<package@packages.qa.debian.org>, or, alternatively refers to a mailing
+list which is known to bounce off-list mails sent by Debian role accounts.
+
+
 =item %s-address-looks-weird
 
 MAINTAINER may be syntactically correct, but it isn't conventionally
@@ -177,6 +187,12 @@ sub check_maintainer {
             tag "$field-address-is-on-localhost", $maintainer;
         }
 
+        if (($field ne 'changed-by') and
+            ($mail =~ /\@packages\.(|qa\.)debian\.org/i or $KNOWN_BOUNCE_ADDRESSES->known($mail))) {
+            tag "$field-address-causes-mail-loops-or-bounces", $maintainer
+        }
+
+
         # Some additional checks that we only do for maintainer fields.
         if ($field eq 'maintainer') {
             if (($mail eq 'debian-qa@lists.debian.org') or
diff --git a/profiles/ubuntu/main.profile b/profiles/ubuntu/main.profile
index 95443a9..cddf355 100644
--- a/profiles/ubuntu/main.profile
+++ b/profiles/ubuntu/main.profile
@@ -2,4 +2,6 @@
 Profile: ubuntu/main
 Extends: debian/main
 Disable-Tags: debian-changelog-file-is-a-symlink,
+ maintainer-address-causes-mail-loops-or-bounces,
+ uploader-address-causes-mail-loops-or-bounces,
  upstart-job-in-etc-init.d-not-registered-via-update-rc.d
diff --git a/t/scripts/implemented-tags.t b/t/scripts/implemented-tags.t
index 455721f..3f18c7a 100755
--- a/t/scripts/implemented-tags.t
+++ b/t/scripts/implemented-tags.t
@@ -36,6 +36,7 @@ our $EXCLUDE =
                  .*-not-full-name$
                  .*-address-looks-weird$
                  .*-address-is-on-localhost$
+		 .*-address-causes-mail-loops-or-bounces$
                  ^wrong-debian-qa-address-set-as-maintainer$
                  ^wrong-debian-qa-group-name$
                  ^malformed-override$
diff --git a/t/tests/fields-maintainer-bounces/debian/debian/control.in b/t/tests/fields-maintainer-bounces/debian/debian/control.in
new file mode 100644
index 0000000..e2ed3ff
--- /dev/null
+++ b/t/tests/fields-maintainer-bounces/debian/debian/control.in
@@ -0,0 +1,18 @@
+Source: {$srcpkg}
+Priority: extra
+Section: devel
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+Uploaders: I Will Loop <fields-maintainer-bounces@packages.debian.org>,
+ I Will Loop Too <fields-maintainer-bounces@PACKAGES.QA.DEBIAN.ORG>
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 7)
+
+Package: {$srcpkg}
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description}
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.  It may
+ be an empty package.
+
diff --git a/t/tests/fields-maintainer-bounces/desc b/t/tests/fields-maintainer-bounces/desc
new file mode 100644
index 0000000..9909d9d
--- /dev/null
+++ b/t/tests/fields-maintainer-bounces/desc
@@ -0,0 +1,7 @@
+Testname: fields-maintainer-bounces
+Sequence: 6000
+Version: 1.0
+Description: test e-mail addresses which are known to bounce e-mails
+Test-For:
+ uploader-address-causes-mail-loops-or-bounces
+ maintainer-address-causes-mail-loops-or-bounces
diff --git a/t/tests/fields-maintainer-bounces/tags b/t/tests/fields-maintainer-bounces/tags
new file mode 100644
index 0000000..c36d2bd
--- /dev/null
+++ b/t/tests/fields-maintainer-bounces/tags
@@ -0,0 +1,6 @@
+E: fields-maintainer-bounces source: maintainer-address-causes-mail-loops-or-bounces Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+E: fields-maintainer-bounces source: uploader-address-causes-mail-loops-or-bounces I Will Loop <fields-maintainer-bounces@packages.debian.org>
+E: fields-maintainer-bounces source: uploader-address-causes-mail-loops-or-bounces I Will Loop Too <fields-maintainer-bounces@PACKAGES.QA.DEBIAN.ORG>
+E: fields-maintainer-bounces: maintainer-address-causes-mail-loops-or-bounces Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+W: fields-maintainer-bounces source: changelog-should-mention-nmu
+W: fields-maintainer-bounces source: source-nmu-has-incorrect-version-number 1.0
diff --git a/t/tests/fields-maintainer-general/debian/debian/control.in b/t/tests/fields-maintainer-general/debian/debian/control.in
index 68df25e..3eaf05a 100644
--- a/t/tests/fields-maintainer-general/debian/debian/control.in
+++ b/t/tests/fields-maintainer-general/debian/debian/control.in
@@ -4,6 +4,7 @@ Section: {$section}
 Maintainer: <lintian-maint@debian.org>
 Uploaders: <lintian-maint@debian.org>, Russ Allbery <rra@debian.org>,
  Russ Allbery <rra@debian.org>,
+ I L. Oop  <fields-maintainer-general@packages.qa.debian.org>,
  Mr. Missing Comma <mrmc@comma.com>
  Mrs. Missing Comma <mrsmc@comma.com>
 Standards-Version: {$standards_version}
diff --git a/t/tests/fields-maintainer-general/desc b/t/tests/fields-maintainer-general/desc
index 579b26e..6eb6bfc 100644
--- a/t/tests/fields-maintainer-general/desc
+++ b/t/tests/fields-maintainer-general/desc
@@ -8,4 +8,4 @@ Test-For:
  maintainer-name-missing
  uploader-address-malformed
  uploader-name-missing
-
+ uploader-address-causes-mail-loops-or-bounces
diff --git a/t/tests/fields-maintainer-general/tags b/t/tests/fields-maintainer-general/tags
index dea236f..3eb787c 100644
--- a/t/tests/fields-maintainer-general/tags
+++ b/t/tests/fields-maintainer-general/tags
@@ -1,4 +1,5 @@
 E: fields-maintainer-general source: maintainer-name-missing <lintian-maint@debian.org>
+E: fields-maintainer-general source: uploader-address-causes-mail-loops-or-bounces I L. Oop  <fields-maintainer-general@packages.qa.debian.org>
 E: fields-maintainer-general source: uploader-address-malformed Mr. Missing Comma <mrmc@comma.com> Mrs. Missing Comma <mrsmc@comma.com>
 E: fields-maintainer-general source: uploader-name-missing <lintian-maint@debian.org>
 E: fields-maintainer-general: maintainer-name-missing <lintian-maint@debian.org>
-- 
1.7.7.1


Reply to: