no way to set scopes for incoming mail

Bug #810290 reported by Martin Pool
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Won't Fix
Low
Unassigned

Bug Description

It could be useful to turn on features depending on attributes of incoming mail messages, but this isn't possible at present.

Related branches

Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Martin Pool (mbp) wrote :

qa plan: this will need losa help:

 * check <https://qastaging.launchpad.net/+feature-info> shows the feature scope (it does, though the formatting is a bit off wacky)
 * send mail from gmail using a gmail from address (therefore validly dkim signed) to qastaging.l.n
 * losa run incoming.py
 * observe the mail effect (eg bug is created)
 * read the mail log just to confirm it did dkim auth
 * losa add the rule
   mail.dkim_authentication.disabled mail_header:from:martinpool 1 true

(or similar for whoever's testing it)
 * send mail again
 * it should bounce complaining the message is not authenticated
 * the logs should tell you why

Revision history for this message
Martin Pool (mbp) wrote :

... and, at the end of qa, of course remove the rule again.

Gavin Panella (allenap)
tags: added: qa-bad
removed: qa-needstesting
Revision history for this message
Gavin Panella (allenap) wrote :

With the feature rule in place process-mail.py OOPSed:
https://pastebin.canonical.com/50633/ (sorry, internal only, and via
pastebin because it doesn't seem to be available at the usual
place). Here's the traceback though:

    Traceback (most recent call last):
      Module lp.services.mail.incoming, line 380, in handleMail
        signature_timestamp_checker)
      Module lp.services.mail.incoming, line 458, in handle_one_mail
        mail, signature_timestamp_checker)
      Module lp.services.mail.incoming, line 218, in authenticateEmail
        dkim_result = _authenticateDkim(mail)
      Module lp.services.mail.incoming, line 130, in _authenticateDkim
        if getFeatureFlag('mail.dkim_authentication.disabled'):
      Module lp.services.features, line 237, in getFeatureFlag
        return features.getFlag(flag)
      Module lp.services.features.flags, line 229, in getFlag
        return self._known_flags.lookup(flag)
      Module lp.services.features.flags, line 149, in lookup
        v = self._calc(key)
      Module lp.services.features.flags, line 235, in _checkFlag
        if self._known_scopes.lookup(scope):
      Module lp.services.features.flags, line 149, in lookup
        v = self._calc(key)
    TypeError: 'ScopesForMail' object is not callable

I've attached the original message.

Revision history for this message
William Grant (wgrant) wrote :

Rolled back in r13590.

Changed in launchpad:
status: Fix Committed → Triaged
William Grant (wgrant)
tags: added: bad-commit-r13574
tags: added: bad-commit-13574
removed: bad-commit-r13574
Martin Pool (mbp)
Changed in launchpad:
assignee: Martin Pool (mbp) → nobody
William Grant (wgrant)
tags: removed: qa-bad
Jürgen Gmach (jugmac00)
Changed in launchpad:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.