Opened 10 years ago

Closed 10 years ago

# Overly large attachment doesn't bounce

Reported by: Owned by: anonymous Bas van der Vlies normal EmailtoTracScript normal 0.10

### Description (last modified by Noah Kantrowitz)

I have a message that has generated a ton of duplicate bugs. The problem is that it has an attachment that is overly large. The upload throws an error that email2trac doesn't catch and so the mail goes back to the queue for delivery again. The thing is the ticket actually gets created with the attachment (cut short) and so there are duplicate tickets now. It would be better if the error were caught and it generated a bounce to the sender. I will look to upgrade trac and see if that fixes the problem as well but really it looks from my read of the code for email2trac that an error should be caught there and dealt with.

Here is the traceback from my logs.

Jan 28 12:19:08 elwing email2trac: Traceback (most recent call last):
Jan 28 12:19:08 elwing email2trac:   File "/usr/local/sbin//email2trac", line 890, in ?     tktparser.parse(sys.stdin)
Jan 28 12:19:08 elwing email2trac:   File "/usr/local/sbin//email2trac", line 520, in parse     self.new_ticket(m)
Jan 28 12:19:08 elwing email2trac:   File "/usr/local/sbin//email2trac", line 478, in new_ticket     n =  self.attachments(msg, tkt)
Jan 28 12:19:08 elwing email2trac:   File "/usr/local/sbin//email2trac", line 749, in attachments     att.insert(url_filename, fd, filesize)
Jan 28 12:19:08 elwing email2trac:   File "/usr/lib/python2.3/site-packages/trac/attachment.py", line 130, in insert     'Upload failed')
Jan 28 12:19:08 elwing email2trac: TracError: Maximum attachment size: 262144 bytes


### comment:1 Changed 10 years ago by Bas van der Vlies

Status: new → assigned 0.9 → 0.10

This is an error and i will fix it. Thanks for the report. You can set the Maximun Attachment size in trac.ini:

[attachment]
max_size = -1


unlimited ;-)

### comment:2 Changed 10 years ago by Noah Kantrowitz

Description: modified (diff)

Fixing formatting.

### comment:3 Changed 10 years ago by Bas van der Vlies

I have to think about reporting the error back to the user of list the error in the ticket field. If i exit and have syslog enabled the error will only be reported in the logs.

### comment:4 Changed 10 years ago by Bas van der Vlies

Resolution: → fixed assigned → closed

I will no be in the ticket change log if attachment is too large. The MTA can also configured to bounce message that are greater then a specified size.

### Modify Ticket

Change Properties
Action
as closed The owner will remain Bas van der Vlies.
The resolution will be deleted. Next status will be 'reopened'.