~futatuki/mailman/2.1-ja-translation

« back to all changes in this revision

Viewing changes to Mailman/Handlers/Scrubber.py

  • Committer: Yasuhito FUTATSUKI at POEM
  • Date: 2021-10-14 20:39:36 UTC
  • mfrom: (1610.1.261 2.1)
  • Revision ID: futatuki@poem.co.jp-20211014203936-kud5anwq28cxnl0x
sync merge lp:mailman/2.1 up to 1871

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
    if ctype.lower == 'application/octet-stream':
91
91
        # For this type, all[0] is '.obj'. '.bin' is better.
92
92
        return '.bin'
 
93
    if ctype.lower == 'text/plain':
 
94
        # For this type, all[0] is '.ksh'. '.txt' is better.
 
95
        return '.txt'
93
96
    return all and all[0]
94
97
 
95
98
 
196
199
                format = part.get_param('format')
197
200
                delsp = part.get_param('delsp')
198
201
            # TK: if part is attached then check charset and scrub if none
199
 
            if part.get('content-disposition') and \
200
 
               not part.get_content_charset():
 
202
            # MAS: Content-Disposition is not a good test for 'attached'.
 
203
            # RFC 2183 sec. 2.10 allows Content-Disposition on the main body.
 
204
            # Make it specifically 'attachment'.
 
205
            if (part.get('content-disposition', '').lower() == 'attachment'
 
206
                    and not part.get_content_charset()):
201
207
                omask = os.umask(002)
202
208
                try:
203
209
                    url = save_attachment(mlist, part, dir)