Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mailbox.Maildir should ignore files named with a leading dot #65559

Closed
liw mannequin opened this issue Apr 26, 2014 · 4 comments
Closed

mailbox.Maildir should ignore files named with a leading dot #65559

liw mannequin opened this issue Apr 26, 2014 · 4 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir topic-email type-bug An unexpected behavior, bug, or error

Comments

@liw
Copy link
Mannequin

liw mannequin commented Apr 26, 2014

BPO 21360
Nosy @warsaw, @bitdancer, @maxking, @ZackerySpytz
PRs
  • bpo-21360: mailbox.Maildir now ignores files with a leading dot #11833
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2014-04-26.22:06:43.614>
    labels = ['3.7', '3.8', 'type-bug', 'library', 'expert-email']
    title = 'mailbox.Maildir should ignore files named with a leading dot'
    updated_at = <Date 2019-10-06.19:49:27.458>
    user = 'https://bugs.python.org/liw'

    bugs.python.org fields:

    activity = <Date 2019-10-06.19:49:27.458>
    actor = 'maxking'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'email']
    creation = <Date 2014-04-26.22:06:43.614>
    creator = 'liw'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 21360
    keywords = ['patch']
    message_count = 4.0
    messages = ['217221', '218557', '335375', '354046']
    nosy_count = 7.0
    nosy_names = ['barry', 'r.david.murray', 'liw', 'mdengler', 'Vincentdavis', 'maxking', 'ZackerySpytz']
    pr_nums = ['11833']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21360'
    versions = ['Python 2.7', 'Python 3.7', 'Python 3.8']

    @liw
    Copy link
    Mannequin Author

    liw mannequin commented Apr 26, 2014

    The maildir format specification
    (see http://cr.yp.to/proto/maildir.html) is clear that files named with leading dots should be ignore:

    Unless you're writing messages to a maildir, the format of a unique
    name is none of your business. A unique name can be anything that
    doesn't contain a colon (or slash) and doesn't start with a dot. Do not
    try to extract information from unique names.

    Test case:

    liw@havelock$ find Maildir -ls
    8921206 4 drwxrwxr-x 5 liw liw 4096 Apr 26 23:03 Maildir
    8921207 4 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/cur
    8921209 4 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/tmp
    8921208 4 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/new
    8913523 0 -rw-rw-r-- 1 liw liw 0 Apr 26 23:03 Maildir/new/.foo
    liw@havelock$ python -c 'import mailbox
    maildir = mailbox.Maildir("Maildir")
    print maildir.keys()
    '
    ['.foo']
    liw@havelock$

    The correct output would be the empty list.

    "mutt -f Maildir" correctly shows now messages in that folder.

    @liw liw mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 26, 2014
    @bitdancer
    Copy link
    Member

    I wonder if changing this would break any working programs. I'd like to think not, but it is certainly possible for someone to be actually depending this bug.

    @ZackerySpytz
    Copy link
    Mannequin

    ZackerySpytz mannequin commented Feb 12, 2019

    I've created a PR for this issue.

    @ZackerySpytz ZackerySpytz mannequin added 3.7 (EOL) end of life 3.8 only security fixes labels Feb 12, 2019
    @maxking
    Copy link
    Contributor

    maxking commented Oct 6, 2019

    David: How do you propose we move forward on this?

    Should we provide a switch to keep the original behaviour (which is off by default) so if there is someone depending on this bug, they could still continue to do it with relatively small change?

    It is a change of behaviour, so probably isn't going to be back ported if it gets merged in 3.9 window.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir topic-email type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants