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

Bug#631868: marked as done (mailping: patch to add support for subject prefix)



Your message dated Wed, 21 Nov 2018 21:51:32 +0000
with message-id <[🔎] E1gPaPE-0005Gf-Al@fasolo.debian.org>
and subject line Bug#914073: Removed package(s) from unstable
has caused the Debian Bug report #631868,
regarding mailping: patch to add support for subject prefix
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
631868: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631868
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: mailping
Version: 0.0.4-2
Severity: wishlist
Tags: patch

Hi,

Please consider adopting the attached patch to avoid the classification of
mailping emails as junk when the email subject gets a prefix (eg. as is
commonly the case when an email goes through a mailing list).

This optional feature can be configured using the subject-prefix file in the
circuit directory.

Cheers,
Serafeim

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.38-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages mailping depends on:
ii  adduser                       3.112+nmu2 add and remove users and groups
ii  munin-node                    1.4.5-3    network-wide graphing framework (n
ii  python                        2.6.6-14   interactive high-level object-orie
ii  python-support                1.0.13     automated rebuilding support for P

mailping recommends no packages.

mailping suggests no packages.

-- no debconf information
diff -Nurp mailping-0.0.4.orig//bin/mailping-cron mailping-0.0.4/bin/mailping-cron
--- mailping-0.0.4.orig//bin/mailping-cron	2004-04-16 17:47:36.000000000 +0200
+++ mailping-0.0.4/bin/mailping-cron	2011-06-04 17:15:54.000000000 +0200
@@ -37,6 +37,7 @@ def main():
 
         fromAddress = config.getEmail(configPath, 'from', None)
         toAddress = config.getEmail(configPath, 'to', None)
+        subjectPrefix = config.getSubjectPrefix(configPath, 'subject-prefix', '')
         if fromAddress is None or toAddress is None:
             user = pwd.getpwuid(os.getuid()).pw_name
             host = socket.getfqdn()
@@ -49,7 +50,7 @@ def main():
         curtime = time.time()
 
         if os.path.isdir(os.path.join(statePath, 'incoming')):
-            incoming.process(statePath)
+            incoming.process(statePath, subjectPrefix)
         probe.process(statePath, interval, curtime,
                       fromAddress, toAddress, adminAddress)
 
diff -Nurp mailping-0.0.4.orig//MailPing/config.py mailping-0.0.4/MailPing/config.py
--- mailping-0.0.4.orig//MailPing/config.py	2004-04-16 19:36:08.000000000 +0200
+++ mailping-0.0.4/MailPing/config.py	2011-06-04 17:15:54.000000000 +0200
@@ -33,6 +33,24 @@ def getEmail(configdir, name, default=_N
     l=l.strip()
     return l
 
+def getSubjectPrefix(configdir, name, default=_NoDefault):
+    path = os.path.join(configdir, name)
+    try:
+        f=file(path)
+    except IOError, e:
+        if e.errno == errno.ENOENT:
+            if default is _NoDefault:
+                raise NoSuchConfigItem, name
+            else:
+                return default
+        else:
+            raise
+
+    l=f.readline()
+    l=l.strip()
+    return l
+
+
 DEFAULT_CONFIGDIR = '/etc/mailping'
 DEFAULT_STATEDIR = '/var/lib/mailping'
 
diff -Nurp mailping-0.0.4.orig//MailPing/incoming.py mailping-0.0.4/MailPing/incoming.py
--- mailping-0.0.4.orig//MailPing/incoming.py	2011-06-04 17:15:39.000000000 +0200
+++ mailping-0.0.4/MailPing/incoming.py	2011-06-04 17:15:54.000000000 +0200
@@ -1,9 +1,9 @@
 import os, shutil
 from MailPing import mail, maildir, fileutil
 
-def process(statedir):
+def process(statedir, subjectPrefix):
     def _processEmail(subdir, filename):
-        ident = mail.getID(os.path.join(subdir, filename))
+        ident = mail.getID(os.path.join(subdir, filename), subjectPrefix)
         if ident is None:
             maildir.create(os.path.normpath(os.path.join(subdir, '..', '..', 'junk')))
             shutil.move(os.path.join(subdir, filename),
diff -Nurp mailping-0.0.4.orig//MailPing/mail.py mailping-0.0.4/MailPing/mail.py
--- mailping-0.0.4.orig//MailPing/mail.py	2004-04-16 19:26:25.000000000 +0200
+++ mailping-0.0.4/MailPing/mail.py	2011-06-04 17:15:54.000000000 +0200
@@ -1,6 +1,6 @@
 from email.Parser import Parser as EmailParser
 
-def getID(path):
+def getID(path, subjectPrefix=''):
     f = file(path)
     p = EmailParser()
     msg = p.parse(f, True)
@@ -8,8 +8,9 @@ def getID(path):
 
     subj = msg.get('Subject')
     if subj is not None:
-        if subj.startswith('Mail ping '):
-            subj = subj[len('Mail ping '):]
+        pingString = '%sMail ping ' % subjectPrefix
+        if subj.startswith(pingString):
+            subj = subj[len(pingString):]
         else:
             subj = None
     return subj
diff -Nurp mailping-0.0.4.orig//man/mailping-cron.1.xml mailping-0.0.4/man/mailping-cron.1.xml
--- mailping-0.0.4.orig//man/mailping-cron.1.xml	2011-06-04 17:15:39.000000000 +0200
+++ mailping-0.0.4/man/mailping-cron.1.xml	2011-06-04 17:15:54.000000000 +0200
@@ -88,6 +88,12 @@
 	    <filename>to</filename> there, containing the sender and
 	    recipient addresses suitable for the circuit.
 	  </para>
+      <para>
+        If the tested email address goes through a gateway (eg. a mailing list)
+        that adds a prefix to the subject, test emails will be classified as
+        junk. To avoid that, declare the prefix in
+        <filename>subject-prefix</filename> in the circuit directory.
+      </para>
 	</step>
 
 	<step>

--- End Message ---
--- Begin Message ---
Version: 0.0.4-4+rm

Dear submitter,

as the package mailping has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/914073

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)

--- End Message ---

Reply to: