iredmail / iRedAdmin

iRedMail Admin Panel (Open Source Edition)
https://www.iredmail.org/admin_panel.html
GNU General Public License v2.0
77 stars 28 forks source link

SQL-Pro: wrong sender for newsletter subscription #2

Closed Dexus closed 4 years ago

Dexus commented 4 years ago

see https://github.com/iredmail/mlmmjadmin/issues/13

I looked into the SQL Pro source: line 127 in /opt/www/iRedAdmin-Pro-SQL-4.3/controllers/mlmmj/newsletter.py looks like the problem area.

iredmail commented 4 years ago

Dear @Dexus

Thank you very much for the feedback, it's a bug of iRedAdmin-Pro, and here's the patch to fix it:

diff --git a/controllers/mlmmj/newsletter.py b/controllers/mlmmj/newsletter.py
index 3fb2e3e0..c864880b 100644
--- a/controllers/mlmmj/newsletter.py
+++ b/controllers/mlmmj/newsletter.py
@@ -127,7 +127,8 @@ class SubUnsub(object):
         # Generate mail message
         _msg = MIMEMultipart('alternative')

-        _smtp_sender = settings.NOTIFICATION_SMTP_USER
+        # Set mailing list address as sender in `From:`
+        _smtp_sender = mail
         _smtp_sender_name = settings.NOTIFICATION_SENDER_NAME
         if _smtp_sender_name:
             _msg['From'] = '%s <%s>' % (Header(_smtp_sender_name, 'utf-8'), _smtp_sender)