Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7676 closed defect (invalid)

'smtp_from' disregarded: wrong sender-email

Reported by: crunk Owned by: doki_pen
Priority: normal Component: AnnouncerPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.12

Description

AnnouncerPlugin 0.12-p2.dev is sending mails to "undisclosed-recipients: ;"@<hostname>.com from an unspecified address: trac@localhost (probably via sendmail?), although a smtp is configured for AnnouncerPlugin:

[announcer]
admit_domains =
always_notify_component_owner = true
always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
default_email_format = text/html
email_address_resolvers = SpecifiedEmailResolver, SessionEmailResolver
email_enabled = true
ignore_domains =
mime_encoding = base64
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = true
smtp_from = trac-no-reply@mydomain.com
smtp_from_name = Trac
smtp_password =
smtp_port = 25
smtp_replyto = no-reply@mydomain.com
smtp_server = smtp.mydomain.com
smtp_subject_prefix = __default__
smtp_timeout = 30
smtp_user =
ticket_email_header_fields = owner, reporter, milestone, component, priority, severity.
ticket_email_subject = Ticket #${ticket.id}: ${ticket['summary']}.
ticket_subject_template = $prefix $ticket.id: $summary
use_public_cc = False
use_short_addr = false
use_tls = false

Adding

[notification]
smtp_enabled = true
smtp_from = trac-no-reply@mydomain.com
smtp_from_name = Trac
smtp_password =
smtp_port = 25
smtp_replyto = no-reply@mydomain.com
smtp_server = smtp.mydomain.com
smtp_subject_prefix = __default__
smtp_timeout = 30
smtp_user =

to my trac.ini results in receiving two mails: one from trac as specified in [nofication] section and one from AnnouncerPlugin from trac@localhost.
Log:

2010-09-13 11:25:02,908 Trac[main] DEBUG: Dispatching <Request "POST '/ticket/93'">
2010-09-13 11:25:02,924 Trac[web_ui] DEBUG: Updating session ca111a081b816f420754f2911f4a9072 for user vogelbj
2010-09-13 11:25:02,960 Trac[session] DEBUG: Retrieving session for ID u'crunk'
2010-09-13 11:25:02,970 Trac[main] DEBUG: Negotiated locale: ['de-de', 'de', 'en-us', 'en'] -> de
2010-09-13 11:25:03,024 Trac[api] INFO: Synchronized '' repository in 0.11 seconds
2010-09-13 11:25:03,030 Trac[web_ui] DEBUG: Updating session ca111a081b816f420754f2911f4a9072 for user crunk
2010-09-13 11:25:03,130 Trac[ticket_compat] DEBUG: LegacyTicketSubscriber added 'crunk (authenticated)' because of rule: always_notify_ticket_owner
2010-09-13 11:25:03,137 Trac[ticket_compat] DEBUG: LegacyTicketSubscriber added 'crunk (authenticated)' because of rule: always_notify_ticket_component_owner
2010-09-13 11:25:03,144 Trac[ticket_compat] DEBUG: LegacyTicketSubscriber added 'crunk (authenticated)' because of rule: always_notify_ticket_reporter
2010-09-13 11:25:03,165 Trac[api] DEBUG: AnnouncementSystem has found the following subscriptions: [crunk(authenticated) via email]
2010-09-13 11:25:03,166 Trac[mail] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, text/plain
2010-09-13 11:25:03,170 Trac[mail] DEBUG: EmailDistributor determined the preferred format for 'crunk (authenticated)' is: text/html
2010-09-13 11:25:03,175 Trac[mail] DEBUG: EmailDistributor found the address 'crunk@mydomain.com' for 'crunk (authenticated)' via: SessionEmailResolver
2010-09-13 11:25:03,176 Trac[mail] DEBUG: EmailDistributor expected local delivery for crunk to: crunk@mydomain.com
2010-09-13 11:25:03,176 Trac[mail] DEBUG: EmailDistributor is sending event as 'text/html' to: crunk@mydomain.com
2010-09-13 11:25:03,482 Trac[mail] DEBUG: Content of recip_adds: [u'crunk@mydomain.com']
2010-09-13 11:25:03,702 Trac[mail] DEBUG: EmailDistributor took 0.2 seconds to send.
2010-09-13 11:25:03,704 Trac[api] DEBUG: AnnouncementSystem sent event in 0.58 seconds.
2010-09-13 11:25:03,746 Trac[notification] INFO: Sending notification through SMTP at smtp.mydomain.com:25 to [u'crunk@mydomain.com']
2010-09-13 11:25:03,807 Trac[web_ui] DEBUG: Side effect for ConfigurableTicketWorkflow
2010-09-13 11:25:04,077 Trac[main] DEBUG: Dispatching <Request "GET '/ticket/93'">
2010-09-13 11:25:04,087 Trac[web_ui] DEBUG: Updating session ca111a081b816f420754f2911f4a9072 for user crunk
2010-09-13 11:25:04,110 Trac[session] DEBUG: Retrieving session for ID u'crunk'
2010-09-13 11:25:04,115 Trac[main] DEBUG: Negotiated locale: ['de-de', 'de', 'en-us', 'en'] -> de
2010-09-13 11:25:04,146 Trac[api] INFO: Synchronized '' repository in 0.07 seconds
2010-09-13 11:25:04,148 Trac[web_ui] DEBUG: Updating session ca111a081b816f420754f2911f4a9072 for user crunk
2010-09-13 11:25:04,182 Trac[default_workflow] DEBUG: render_ticket_action_control: action "leave"
2010-09-13 11:25:04,182 Trac[default_workflow] DEBUG: render_ticket_action_control: action "reopen"
2010-09-13 11:25:04,187 Trac[chrome] DEBUG: Prepare chrome data for request

Attachments (0)

Change History (4)

comment:1 Changed 4 years ago by crunk

announcer.api.announcementsystem = enabled
announcer.distributors.mail.emaildistributor = enabled
announcer.distributors.mail.sendmailemailsender = disabled
announcer.distributors.mail.smtpemailsender = enabled
announcer.email_decorators.generic.announceremaildecorator = disabled
announcer.email_decorators.generic.staticemaildecorator = disabled
announcer.email_decorators.generic.threadingemaildecorator = disabled
announcer.email_decorators.ticket.ticketaddlheaderemaildecorator = enabled
announcer.email_decorators.ticket.ticketsubjectemaildecorator = enabled
announcer.email_decorators.wiki.wikisubjectemaildecorator = disabled
announcer.filters.change_author.changeauthorfilter = enabled
announcer.filters.unsubscribe.unsubscribefilter = enabled
announcer.formatters.ticket.ticketformatter = enabled
announcer.formatters.wiki.wikiformatter = disabled
announcer.opt.acct_mgr.announce.accountmanagerannouncement = enabled
announcer.pref.announcerpreferences = enabled
announcer.producers.attachment.attachmentchangeproducer = enabled
announcer.producers.ticket.ticketchangeproducer = enabled
announcer.producers.wiki.wikichangeproducer = disabled
announcer.resolvers.sessionemail.sessionemailresolver = enabled
announcer.resolvers.specified.specifiedemailresolver = enabled
announcer.subscribers.ticket_compat.carboncopysubscriber = enabled
announcer.subscribers.ticket_compat.legacyticketsubscriber = enabled
announcer.subscribers.ticket_components.ticketcomponentsubscriber = enabled
announcer.subscribers.ticket_custom.ticketcustomfieldsubscriber = enabled
announcer.subscribers.ticket_groups.joinablegroupsubscriber = enabled
announcer.subscribers.watch_users.userchangesubscriber = enabled
announcer.subscribers.watchers.watchsubscriber = enabled
announcer.subscribers.wiki.generalwikisubscriber = disabled

comment:2 Changed 4 years ago by doki_pen

  • Resolution set to invalid
  • Status changed from new to closed

There have been some changes to the way announcer gets configured. You now have the choice of SmtpEmailSender or SendmailEmailSender.

    email_sender = ExtensionOption('announcer', 'email_sender',
        IEmailSender, 'SmtpEmailSender',
        """Name of the component implementing `IEmailSender`.

        This component is used by the announcer system to send emails.
        Currently, `SmtpEmailSender` and `SendmailEmailSender` are provided.
        """)

smtp specific configuration is moved to the [smtp] section of the config. Here are the values we expect:

    server = Option('smtp', 'server', 'localhost',
        """SMTP server hostname to use for email notifications.""")

    timeout = IntOption('smtp', 'timeout', 10,
        """SMTP server connection timeout. (requires python-2.6)""")

    port = IntOption('smtp', 'port', 25,
        """SMTP server port to use for email notification.""")

    user = Option('smtp', 'user', '',
        """Username for SMTP server.""")

    password = Option('smtp', 'password', '',
        """Password for SMTP server.""")

    use_tls = BoolOption('smtp', 'use_tls', 'false',
        """Use SSL/TLS to send notifications over SMTP.""")

    use_ssl = BoolOption('smtp', 'use_ssl', 'false',
        """Use ssl for smtp connection.""")

    debuglevel = IntOption('smtp', 'debuglevel', 0,
        """Set to 1 for useful smtp debugging on stdout.""")

if you decide to go with sendmail, use the following:

    sendmail_path = Option('sendmail', 'sendmail_path', 'sendmail',
        """Path to the sendmail executable.

        The sendmail program must accept the `-i` and `-f` options.
        """)

[announcer] still gets the following, but names may have changed:


    enabled = BoolOption('announcer', 'email_enabled', 'true',
        """Enable email notification.""")

    email_from = Option('announcer', 'email_from', 'trac@localhost',
        """Sender address to use in notification emails.""")

    from_name = Option('announcer', 'email_from_name', '',
        """Sender name to use in notification emails.""")

    replyto = Option('announcer', 'email_replyto', 'trac@localhost',
        """Reply-To address to use in notification emails.""")

    mime_encoding = Option('announcer', 'mime_encoding', 'base64',
        """Specifies the MIME encoding scheme for emails.

        Valid options are 'base64' for Base64 encoding, 'qp' for
        Quoted-Printable, and 'none' for no encoding. Note that the no encoding
        means that non-ASCII characters in text are going to cause problems
        with notifications.
        """)

    use_public_cc = BoolOption('announcer', 'use_public_cc', 'false',
        """Recipients can see email addresses of other CC'ed recipients.

        If this option is disabled (the default), recipients are put on BCC
        """)

    # used in email decorators, but not here
    subject_prefix = Option('announcer', 'email_subject_prefix',
                                 '__default__',
        """Text to prepend to subject line of notification emails.

        If the setting is not defined, then the [$project_name] prefix.
        If no prefix is desired, then specifying an empty option
        will disable it.
        """)

    to = Option('announcer', 'email_to', 'undisclosed-recipients: ;',
        'Default To: field')

    use_threaded_delivery = BoolOption('announcer', 'use_threaded_delivery',
        'false',
        """Do message delivery in a separate thread.

        Enabling this will improve responsiveness for requests that end up
        with an announcement being sent over email. It requires building
        Python with threading support enabled-- which is usually the case.
        To test, start Python and type 'import threading' to see
        if it raises an error.
        """)

    default_email_format = Option('announcer', 'default_email_format',
        'text/plain',
        """The default mime type of the email notifications.

        This can be overridden on a per user basis through the announcer
        preferences panel.
        """)

comment:3 Changed 4 years ago by doki_pen

I'll add it to the wiki.

comment:4 Changed 4 years ago by doki_pen

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.