Modify

Opened 4 years ago

Last modified 11 months ago

#7824 new defect

To: field gets set to "email_to value"@trac.server.domain

Reported by: anonymous Owned by: hasienda
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords: email notification
Cc: jbeilicke, julrich Trac Release: 0.12

Description

In distributors/mail.py, the value of the 'To' header is inexplicably placed inside quotation marks. This causes it to end up being appended by the Trac server’s domain.

Attachments (1)

announcerplugin-to-header.diff (732 bytes) - added by cshelton 4 years ago.
diff to allow To header to be undisclosed-recipients: ;

Download all attachments as: .zip

Change History (16)

comment:1 Changed 4 years ago by anonymous

I suspect that this has something to do with the DefaultDomainResolver. If you don't need it, disable it. I'll try to get this fixed. Can you paste your settings and explain exactly where email_to value is entered?

Last edited 17 months ago by rjollos (previous) (diff)

comment:2 Changed 4 years ago by anonymous

DefaultDomainResolver is already disabled on our installation. The email_to value was entered in trac.ini as:

[announcer]
email_address_resolvers = SpecifiedEmailResolver,SessionEmailResolver
email_enabled = true
email_sender = SendmailEmailSender
email_to = nobody@example.com
mime_encoding = qp
never_notify_updater = true
subscription_resolvers = SubscriptionResolver
use_threaded_delivery = true

Currently, I’ve modified the our code to stop adding quotation marks and modified the part that checked for a match against a quoted version of undisclosed-recipients: ; and it is working fine.

comment:3 Changed 4 years ago by cshelton

I have noticed the exact same behavior on a new install of trac 0.12, using the svn version of the announcerplugin (as of r9404). After a little bit of digging in the code, I implemented a similar patch as described in comment:2.

Last edited 17 months ago by rjollos (previous) (diff)

Changed 4 years ago by cshelton

diff to allow To header to be undisclosed-recipients: ;

comment:4 Changed 4 years ago by jbeilicke

  • Cc jbeilicke added; anonymous removed

comment:5 Changed 3 years ago by rjollos

#8462 might be a duplicate.

comment:6 Changed 3 years ago by julrich

  • Cc julrich added

comment:7 Changed 2 years ago by hasienda

  • Keywords email notification added
  • Owner changed from doki_pen to hasienda

I think the following change should have resolved the issue, that has been reported and discussed here:

(In [12326]) TracAnnouncer: Don't attempt email distribution without recipients, refs #7834.

Felt like a re-arranged and slightly simplified code would make it easier to implement the requested check in EmailDistributor._do_send. IMHO it did.

The problematic check, that has a suggested patch here, is done differently now - before setting the headers, so quotation shouldn't cause issues anymore. Test feedback appreciated.

comment:8 Changed 17 months ago by bas.vandervlies@…

I just installed the trunk version and also have this problem. The domain is appended to the to-field. Is there a fix for it?

comment:9 Changed 17 months ago by rjollos

Please post your sanitized [announcer] configuration and I will try to reproduce with the latest version of the AnnouncerPlugin code.

comment:10 Changed 16 months ago by bas.vandervlies@…

just back from holidays:

[components]
announcer.* = enabled
announcer.resolvers.defaultdomainemailresolver = disabled
announcer.resolvers.specifiedemailresolver = disabled

[announcer]
always_notify_cc = true
always_notify_component_owner = true
default_email_format = text/plain
email_address_resolvers = SessionEmailResolver
email_always_cc = bas.van.der.vlies@...
email_enabled = true
email_from = bvlies@xs4all.nl
email_from_name = Email2Trac Test
email_replyto = bvlies@...
email_sender = SmtpEmailSender
email_to = linux-tg@...
use_threaded_delivery = true

[smtp]
debuglevel = 100
port = 25
server = localhost
timeout = 10

comment:11 Changed 14 months ago by bas.vandervlies@…

Still have the problem that the to addres is wrong:

  • linux-tg@…"@itrac.osd.surfsara.nl

Has somebody a patch for it?

comment:12 Changed 14 months ago by anonymous

I found out the problem. I have installed postfix as MTA and the announcer puts quotes around the to field. So it is considered as string. The patch below fixes the problem

  • announcer/distributors/mail.py

     
    416416            if self.to == self.to_default:
    417417                headers['To'] = _('undisclosed-recipients: ;')
    418418            else:
    419                 headers['To'] = '"%s"' % self.to
     419                headers['To'] = '%s' % self.to
    420420                if self.to:
    421421                    recip_adds += [self.to]
    422422        if not recip_adds:
Last edited 11 months ago by rjollos (previous) (diff)

comment:13 Changed 11 months ago by TiagoTT

This patch worked for me, thanks!

comment:14 Changed 11 months ago by bas.vandervlies@…

I'll hope that they release a new version or is the development stopped?

comment:15 Changed 11 months ago by rjollos

At the very least, development has been paused for far too long.

hasienda: do you have an opinion on the patch in comment:12? I'd be happy to do some additional testing and push it.

Add Comment

Modify Ticket

Action
as new The owner will remain hasienda.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.