PFA patch. generated by git --diff command. Le me know if you need me to 
make any changes.

On Friday, October 10, 2014 4:05:34 PM UTC+5:30, neel roy wrote:
>
> K, will work on patch - will give UI option. give me couple of days though.
>
> On Friday, October 10, 2014 12:12:12 PM UTC+5:30, chri...@beanbaginc.com 
> wrote:
>>
>> Hi Neel, 
>>
>> I'd accept a patch that adds a toggle for this, defaulting to being on in 
>> order to prevent breaking current behavior. Let me know if you have any 
>> questions about it. 
>>
>> Christian 
>>
>> --   
>> Christian Hammond - chri...@beanbaginc.com   
>> Review Board - https://www.reviewboard.org   
>> Beanbag, Inc. - https://www.beanbaginc.com 
>>
>> -----Original Message----- 
>> From: neel roy <neel...@rediffmail.com> 
>> Reply: revie...@googlegroups.com <revie...@googlegroups.com>> 
>> Date: October 9, 2014 at 11:38:24 PM 
>> To: revie...@googlegroups.com <revie...@googlegroups.com>> 
>> Cc: neel...@rediffmail.com <neel...@rediffmail.com>>, 
>> chri...@beanbaginc.com <chri...@beanbaginc.com>> 
>> Subject:  Re: stuck in last step - configuring email 
>>
>> > Christian, 
>> >   
>> > I will try to get the information of setup from IT but in parallel, is 
>> it 
>> > possible that it will always be the email account given will send the 
>> mail 
>> > instead of sending on behalf of users? If it's not possible right now, 
>> > would you be willing to accept the patch if I manage to work on it? 
>> >   
>> > -Neel. 
>> >   
>> > On Wednesday, October 8, 2014 4:19:57 AM UTC+5:30, 
>> chri...@beanbaginc.com 
>> > wrote: 
>> > > 
>> > > Hi Neel, 
>> > > 
>> > > Without knowing more about your setup, I can't say for sure. Out of 
>> the 
>> > > box, we support plain text authentication and using TLS. I'd need to 
>> know 
>> > > more details on your authentication setup for your mail server to be 
>> able 
>> > > to give you a more informed answer. 
>> > > 
>> > > Christian 
>> > > 
>> > > -- 
>> > > Christian Hammond - chri...@beanbaginc.com   
>> > > Review Board - https://www.reviewboard.org 
>> > > Beanbag, Inc. - https://www.beanbaginc.com 
>> > > 
>> > > -----Original Message----- 
>> > > From: neel roy > 
>> > > Reply: revie...@googlegroups.com > > >> 
>> > > Date: October 7, 2014 at 3:26:25 PM 
>> > > To: revie...@googlegroups.com > > >> 
>> > > Subject: Re: stuck in last step - configuring email 
>> > > 
>> > > > anyone? 
>> > > > 
>> > > > On Monday, October 6, 2014 10:00:01 PM UTC+5:30, neel roy wrote: 
>> > > > > 
>> > > > > Hi, 
>> > > > > 
>> > > > > Probably last step but I am stuck there anyway :) 
>> > > > > 
>> > > > > So, I configured the email and found that account I am using does 
>> not 
>> > > have 
>> > > > > privilege of sending mails on behalf of other users. Asked IT 
>> guys to 
>> > > fix 
>> > > > > it. They have but now I have problem with plain authentication 
>> method. 
>> > > The 
>> > > > > diagnosis is based on following log from reviewboard: 
>> > > > > 
>> > > > > - Error sending e-mail notification with subject '' 
>> > > > on behalf of '' to ',,': *No suitable authentication 
>> > > > method found.* 
>> > > > > Traceback (most recent call last): 
>> > > > > File 
>> > > 
>> "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.8-py2.7.egg/reviewboard/notifications/email.py",
>>  
>>   
>> > > 
>> > > > line 279, in send_review_mail 
>> > > > > message.send() 
>> > > > > File 
>> > > 
>> "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/core/mail/message.py",
>>  
>>   
>> > > 
>> > > > line 276, in send 
>> > > > > return self.get_connection(fail_silently).send_messages([self]) 
>> > > > > File 
>> > > 
>> "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/core/mail/backends/smtp.py",
>>  
>>   
>> > > 
>> > > > line 87, in send_messages 
>> > > > > new_conn_created = self.open() 
>> > > > > File 
>> > > 
>> "/usr/local/lib/python2.7/dist-packages/Django-1.6.7-py2.7.egg/django/core/mail/backends/smtp.py",
>>  
>>   
>> > > 
>> > > > line 54, in open 
>> > > > > self.connection.login(self.username, self.password) 
>> > > > > File "/usr/lib/python2.7/smtplib.py", line 611, in login 
>> > > > > raise SMTPException("No suitable authentication method 
>> > > found.")*SMTPException: 
>> > > > No suitable authentication method found.* 
>> > > > > 
>> > > > > 
>> > > > > *As per question ** 
>> > > 
>> http://stackoverflow.com/questions/1684534/python-and-sll-exchange-2007-no-suitable-authentication-method-found
>>  
>>   
>> > > 
>> > > > 
>> > > > I think we require "Plain Text Authentication" method enabled on 
>> > > exchange server, which 
>> > > > might be a no-no (don't know; haven't asked those IT guys yet). But 
>> > > before I ask them I wanted 
>> > > > to know whether there is any other workaround?* 
>> > > > > 
>> > > > > 
>> > > > > *Is there a way I can use non-plain text authentication method?* 
>> > > > > 
>> > > > > 
>> > > > > *Appreciate any help,* 
>> > > > > 
>> > > > > *-Neel.* 
>> > > > > 
>> > > > > 
>> > > > 
>> > > > -- 
>> > > > Get the Review Board Power Pack at 
>> http://www.reviewboard.org/powerpack/ 
>> > > > --- 
>> > > > Sign up for Review Board hosting at RBCommons: 
>> https://rbcommons.com/ 
>> > > > --- 
>> > > > Happy user? Let us know at http://www.reviewboard.org/users/ 
>> > > > --- 
>> > > > You received this message because you are subscribed to the Google 
>> > > Groups "reviewboard" 
>> > > > group. 
>> > > > To unsubscribe from this group and stop receiving emails from it, 
>> send 
>> > > an email to reviewboard...@googlegroups.com . 
>> > > > For more options, visit https://groups.google.com/d/optout. 
>> > > > 
>> > > 
>> > > 
>> >   
>> > -- 
>> > Get the Review Board Power Pack at 
>> http://www.reviewboard.org/powerpack/ 
>> > --- 
>> > Sign up for Review Board hosting at RBCommons: https://rbcommons.com/ 
>> > --- 
>> > Happy user? Let us know at http://www.reviewboard.org/users/ 
>> > --- 
>> > You received this message because you are subscribed to the Google 
>> Groups "reviewboard"   
>> > group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to reviewboard...@googlegroups.com.   
>> > For more options, visit https://groups.google.com/d/optout. 
>> >   
>>
>>

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/reviewboard/admin/forms.py b/reviewboard/admin/forms.py
index dfcc40e..04e3437 100644
--- a/reviewboard/admin/forms.py
+++ b/reviewboard/admin/forms.py
@@ -503,6 +503,12 @@ class EMailSettingsForm(SiteSettingsForm):
         help_text=_('Send an e-mail to yourself using these server settings.'),
         required=False)

+    dont_impersonate_users = forms.BooleanField(
+        label=_('Dont impersonate users'),
+        help_text=_('Dont send mails on behalf of users'),
+        required=False)
+
+
     def clean_mail_host(self):
         # Strip whitespaces from the SMTP address.
         return self.cleaned_data['mail_host'].strip()
@@ -555,7 +561,7 @@ class EMailSettingsForm(SiteSettingsForm):
                 'title': _('E-Mail Server Settings'),
                 'fields': ('mail_host', 'mail_port', 'mail_host_user',
                            'mail_host_password', 'mail_use_tls',
-                           'send_test_mail'),
+                           'send_test_mail','dont_impersonate_users'),
             },
         )

diff --git a/reviewboard/notifications/email.py 
b/reviewboard/notifications/email.py
index 78fd599..aaca4a2 100644
--- a/reviewboard/notifications/email.py
+++ b/reviewboard/notifications/email.py
@@ -145,6 +145,12 @@ class SpiffyEmailMessage(EmailMultiAlternatives):
         headers = headers.copy()
         siteconfig = SiteConfiguration.objects.get_current()

+       dont_impersonate_users = siteconfig.get("dont_impersonate_users")
+       logging.debug("dont_impersonate_users = " + str(dont_impersonate_users))
+       if(dont_impersonate_users):
+               from_email = sender
+
+
         if sender:
             headers['Sender'] = sender
             headers['X-Sender'] = sender

Reply via email to