Best way to avoid sending large attachments via email
Jason Foster <[email protected]> Tue, 31 Jan 2017 21:18:33 -0500
| Newsgroups | gmane.comp.bug-tracking.request-tracker.user |
|---|---|
| Message-ID | <CAGQsXkcuMDPvWArojjiNNNpR97iWTDz1BJOFS_3++dG59itWZQ@mail.gmail.com> |
--f403045f531c5b82fa05476eaa04 Content-Type: text/plain; charset=UTF-8 I've run into a issue (on RT 4.2.9) where an overly large attachment will cause my (OS X Sierra) server to become resource starved. My guess is that somewhere between Apache, FastCGI, RT, and postfix, attempting to send (e.g.) a 50MB attachment using the "On Create Notify AdminCcs" scrip is causing a timeout or similar. $MaxAttachmentSize relates to the database, so doesn't seem helpful in this case. And was the only setting I could find. I do like receiving email notifications on create (or modify) so I don't want to disable the scrip. From what I can tell the best thing to do would be to: - copy NotifyOwnerOrAdminCc.pm to something like NotifyOwnerOrAdminCcWithLimits.pm - set "On Create Notify AdminCcs" to use NotifyOwnerOrAdminCcWithLimits.pm - in NotifyOwnerOrAdminCcWithLimits.pm figure out how to check the attachment size and either attach (if small) or link (if large) Within NotifyOwnerOrAdminCc.pm my guess is that I would want to override AddAttachment() from SendEmail.pm ... at which point my Perl-fu starts to fail me. Does this seem like the right solution (to avoiding the sending of large email attachments)? And does the rough outline of my plan make sense? Thanks! Jason --f403045f531c5b82fa05476eaa04 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><span style=3D"color:rgb(0,0,0);font-family:monospace;font= -size:11px">I've run into a issue (on RT 4.2.9) where an overly large a= ttachment will cause my (OS X Sierra) server to become resource starved.=C2= =A0 My guess is that somewhere between Apache, FastCGI, RT, and=C2=A0</span= ><span style=3D"color:rgb(0,0,0);font-family:monospace;font-size:11px">post= fix, attempting to send (e.g.) a 50MB attachment using the "On Create = Notify AdminCcs" scrip is causing a timeout or similar.</span><br styl= e=3D"color:rgb(0,0,0);font-family:monospace;font-size:11px"><br style=3D"co= lor:rgb(0,0,0);font-family:monospace;font-size:11px"><span style=3D"color:r= gb(0,0,0);font-family:monospace;font-size:11px">$MaxAttachmentSize relates = to the database, so doesn't seem helpful in this case.=C2=A0 And was th= e only setting I could find.</span><br style=3D"color:rgb(0,0,0);font-famil= y:monospace;font-size:11px"><br style=3D"color:rgb(0,0,0);font-family:monos= pace;font-size:11px"><span style=3D"color:rgb(0,0,0);font-family:monospace;= font-size:11px">I do like receiving email notifications on create (or modif= y) so I don't want to disable the scrip.</span><br style=3D"color:rgb(0= ,0,0);font-family:monospace;font-size:11px"><br style=3D"color:rgb(0,0,0);f= ont-family:monospace;font-size:11px"><span style=3D"color:rgb(0,0,0);font-f= amily:monospace;font-size:11px">From what I can tell the best thing to do w= ould be to:</span><br style=3D"color:rgb(0,0,0);font-family:monospace;font-= size:11px"><br style=3D"color:rgb(0,0,0);font-family:monospace;font-size:11= px"><span style=3D"color:rgb(0,0,0);font-family:monospace;font-size:11px">= =C2=A0- copy NotifyOwnerOrAdminCc.pm to something like NotifyOwnerOrAdminCc= WithLimits.pm</span><br style=3D"color:rgb(0,0,0);font-family:monospace;fon= t-size:11px"><span style=3D"color:rgb(0,0,0);font-family:monospace;font-siz= e:11px">=C2=A0- set "On Create Notify AdminCcs" to use NotifyOwne= rOrAdminCcWithLimits.pm</span><br style=3D"color:rgb(0,0,0);font-family:mon= ospace;font-size:11px"><span style=3D"color:rgb(0,0,0);font-family:monospac= e;font-size:11px">=C2=A0- in NotifyOwnerOrAdminCcWithLimits.pm figure out h= ow to check the attachment size and either attach (if small) or link (if la= rge)</span><br style=3D"color:rgb(0,0,0);font-family:monospace;font-size:11= px"><br style=3D"color:rgb(0,0,0);font-family:monospace;font-size:11px"><sp= an style=3D"color:rgb(0,0,0);font-family:monospace;font-size:11px">Within N= otifyOwnerOrAdminCc.pm my guess is that I would want to override AddAttachm= ent() from SendEmail.pm</span><br style=3D"color:rgb(0,0,0);font-family:mon= ospace;font-size:11px"><br style=3D"color:rgb(0,0,0);font-family:monospace;= font-size:11px"><span style=3D"color:rgb(0,0,0);font-family:monospace;font-= size:11px">... at which point my Perl-fu starts to fail me.</span><br style= =3D"color:rgb(0,0,0);font-family:monospace;font-size:11px"><br style=3D"col= or:rgb(0,0,0);font-family:monospace;font-size:11px"><span style=3D"color:rg= b(0,0,0);font-family:monospace;font-size:11px">Does this seem like the righ= t solution (to avoiding the sending of large email attachments)?=C2=A0 And = does the rough outline of my plan make sense?</span><br style=3D"color:rgb(= 0,0,0);font-family:monospace;font-size:11px"><br style=3D"color:rgb(0,0,0);= font-family:monospace;font-size:11px"><span style=3D"color:rgb(0,0,0);font-= family:monospace;font-size:11px">Thanks!</span><br style=3D"color:rgb(0,0,0= );font-family:monospace;font-size:11px"><br style=3D"color:rgb(0,0,0);font-= family:monospace;font-size:11px"><span style=3D"color:rgb(0,0,0);font-famil= y:monospace;font-size:11px">Jason</span><br></div> --f403045f531c5b82fa05476eaa04--