mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Ignore p7s smime attachments
This commit is contained in:
parent
2fd9664295
commit
ad4a1c00f4
2 changed files with 5 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ class Command(BaseCommand):
|
|||
self.stdout.write('Gathering messages for %s\n' % mailbox.name)
|
||||
messages = mailbox.get_new_mail()
|
||||
for message in messages:
|
||||
self.stdout.write('Recieved %s (from %s)\n' % (
|
||||
self.stdout.write('Received %s (from %s)\n' % (
|
||||
message.subject,
|
||||
message.from_address
|
||||
))
|
||||
|
|
|
|||
|
|
@ -170,6 +170,10 @@ class Mailbox(models.Model):
|
|||
if part.get('Content-Disposition') is None:
|
||||
continue
|
||||
filename = part.get_filename()
|
||||
# ignore SMIME extension
|
||||
filename_basename, filename_extension = os.path.splitext(filename)
|
||||
if filename_extension in ('.p7s',):
|
||||
continue
|
||||
data = part.get_payload(decode=True)
|
||||
if not data:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue