trac notification not sending emails

1.5k views Asked by At

I am trying to set up trac notification but it is not working. In apache i have

<LocationMatch "/trac/[^/]+/login">
        AuthType Kerberos
        AuthName KerberosLogin
        KrbServiceName HTTP/intranet.domain.com
        KrbMethodNegotiate On
        KrbMethodK5Passwd On
        KrbAuthRealms DOMAIN.COM
        Krb5KeyTab /etc/httpd/conf/intranet.keytab
        require valid-user
        Options Indexes MultiViews FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
        SetOutputFilter DEFLATE
</LocationMatch>

In trac.ini I have

always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
mime_encoding = base64
smtp_always_bcc =
smtp_always_cc = [email protected]
smtp_default_domain = domain.com
smtp_enabled = true
smtp_from = [email protected]
smtp_password =
smtp_port = 25
smtp_replyto = [email protected]
smtp_server = hero.uk.domain.com
smtp_subject_prefix = __default__
smtp_user =
use_public_cc = false
use_short_addr = false
use_tls = false
ignore_domains = domain.com

Problem is I log in as [email protected] but my email is [email protected]. how do i fix this?

I put my email address under settings however when i create a new ticket In the log file i get

2013-11-29 12:40:34,804 Trac[notification] DEBUG: Sending SMTP notification to hero.uk.domain.com on port 25 to [u'[email protected]', u'[email protected]', u'[email protected]']

UPDATE

I have installed Announcer plugin. Error I recieve

Dec  4 10:48:43 hero Trac[paradox:api] INFO: Synchronized '(default)' repository in 0.00 seconds
Dec  4 10:48:45 hero mountd[2510]: authenticated mount request from buzz.uk.domain.com:960 for /data/apps (/data/apps)
Dec  4 10:48:51 hero Trac[paradox:api] INFO: Synchronized '(default)' repository in 0.00 seconds
Dec  4 10:49:26 hero Trac[paradox:env] INFO: -------------------------------- environment startup [Trac 0.12.5] --------------------------------
Dec  4 10:49:27 hero Trac[paradox:loader] ERROR: Skipping "announcer.email_decorators = announcer.email_decorators":  Traceback (most recent call last):   File "/usr/lib/python2.4/site-packages/Trac-0.12.5-py2.4.egg/trac/loader.py", line 68, in _load_eggs     entry.load(require=True)   File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load     entry = __import__(self.module_name, globals(),globals(), ['__name__'])   File "/usr/lib/python2.4/site-packages/TracAnnouncer-1.0dev_r12503-py2.4.egg/announcer/email_decorators.py", line 7, in ?     from email.utils import parseaddr ImportError: No module named utils
Dec  4 10:49:27 hero Trac[paradox:api] INFO: Synchronized '(default)' repository in 0.06 seconds
Dec  4 10:49:27 hero Trac[paradox:api] ERROR: AnnouncementSystem failed. Traceback (most recent call last):   File "/usr/lib/python2.4/site-packages/TracAnnouncer-1.0dev_r12503-py2.4.egg/announcer/api.py", line 560, in _real_send     subscriptions = self.resolver.subscriptions(evt)   File "/usr/lib/python2.4/site-packages/TracAnnouncer-1.0dev_r12503-py2.4.egg/announcer/api.py", line 311, in subscriptions     ordered_subs = sorted(subscriptions, key=itemgetter(1,2,3,6)) TypeError: itemgetter expected 1 arguments, got 4
Dec  4 10:49:27 hero Trac[paradox:api] INFO: Synchronized '(default)' repository in 0.00 seconds

Configuration

[announcer]
admit_domains =
always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
default_email_format = text/html
email_address_resolvers = SpecifiedEmailResolver, SessionEmailResolver
email_sender = SmtpEmailSender
ignore_domains =
mime_encoding = none
notify_on_failed_build = true
notify_on_successful_build = false
smtp_always_bcc =
smtp_always_cc = [email protected]
smtp_default_domain =
smtp_enabled = true
smtp_from = [email protected]
smtp_from_name = Trac
smtp_password =
smtp_port = 25
smtp_replyto = [email protected]
smtp_server = hero.uk.domain.com
smtp_subject_prefix = __default__
smtp_user =
ticket_subject_template = $prefix #$ticket.id: $summary
use_public_cc = False
use_short_addr = false
use_tls = false

New UPDATE

current conf file /usr/share/trac/conf

[root@hero trac]# cat /usr/share/trac/conf/trac.ini 
[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
ignore_domains =
#mime_encoding = base64
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = true
smtp_from = [email protected]
smtp_from_name = Trac
smtp_password =
smtp_port = 25
smtp_replyto = [email protected]
smtp_server = hero
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
email_enabled = true


#[notification]
#always_notify_owner = false
#always_notify_reporter = true
#always_notify_updater = true
#mime_encoding = base64
#smtp_always_bcc =
#smtp_always_cc = 
#smtp_default_domain = domain.com
#smtp_enabled = true
#smtp_from = [email protected]
#smtp_password =
#smtp_port = 25
#smtp_replyto = [email protected]
#smtp_server = hero.uk.domain.com
#smtp_subject_prefix = __default__
#smtp_user =
#use_public_cc = false
#use_short_addr = false
#use_tls = false
#ignore_domains = domain.com


[ldap]
enable = true
global_perms = true
host = echo
basedn = dc=domain,dc=com
user_rdn = ou=sites
group_rdn = cn=users
store_bind = true
bind_user = cn=Administrator,cn=users,dc=domain,dc=com
bind_passwd = woki1141



[trac]
base_url = http://intranet/trac/
#permission_store = LdapPermissionStore


[logging]
log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s
log_type = syslog
log_level = DEBUG

[components]
webadmin.* = enabled
#ldapauth.* = enabled
#ldapplugin.* = enabled
#ldapplugin.api.ldappermissiongroupprovider = enabled
#ldapplugin.api.ldappermissionstore = disabled
ticketdelete.* = enabled
tracopt.ticket.deleter = enabled
tracwysiwyg.* = enabled
announcer.* = enabled
#announcer.api.announcementsystem = enabled
#announcer.distributors.mail.emaildistributor = enabled
#announcer.formatters.ticket.ticketformatter = enabled
#announcer.formatters.wiki.wikiformatter = enabled
#announcer.pref.announcerpreferences = enabled
#announcer.producers.attachment.attachmentchangeproducer = enabled
#announcer.producers.ticket.ticketchangeproducer = enabled
#announcer.producers.wiki.wikichangeproducer = enabled
#announcer.resolvers.sessionemail.sessionemailresolver = 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.watch_users.userchangesubscriber = enabled
#announcer.subscribers.watchers.watchsubscriber = enabled

What appears in log file when creating a ticket.

==> /data/intranet/html/trac/paradox/log/trac.log <==
Trac[paradox:env] INFO: Reloading environment due to configuration change
Trac[paradox:env] INFO: -------------------------------- environment startup [Trac 0.12.5] --------------------------------

...

Trac[paradox:default_workflow] DEBUG: Workflow actions at initialization: {u'resolve': {u'operations': [u'set_resolution'], 'name': u'resolve', 'default': 0, 'newstate': u'closed', 'oldstates': [u'new', u'assigned', u'reopened'], u'permissions': [u'TICKET_MODIFY']}, u'accept': {u'operations': [u'set_owner_to_self'], 'name': u'accept', 'default': 0, 'newstate': u'assigned', 'oldstates': [u'new'], u'permissions': [u'TICKET_MODIFY']}, u'leave': {u'operations': [u'leave_status'], 'name': u'leave', u'default': 1, 'newstate': u'*', 'oldstates': [u'*'], 'permissions': []}, u'reopen': {u'operations': [u'del_resolution'], 'name': u'reopen', 'default': 0, 'newstate': u'reopened', 'oldstates': [u'closed'], u'permissions': [u'TICKET_CREATE']}, u'reassign': {u'operations': [u'set_owner'], 'name': u'reassign', 'default': 0, 'newstate': u'new', 'oldstates': [u'new', u'assigned', u'reopened'], u'permissions': [u'TICKET_MODIFY']}, '_reset': {'operations': ['reset_workflow'], 'name': 'reset', 'default': 0, 'newstate': 'new', 'oldstates': [], 'permissions': []}}

Trac[paradox:main] DEBUG: Dispatching <Request "GET '/chrome/common/desc.png'">
Trac[paradox:main] DEBUG: Dispatching <Request "GET '/chrome/tracwysiwyg/editor.css'">
Trac[paradox:main] DEBUG: Dispatching <Request "POST '/newticket'">
Trac[paradox:svn_fs] DEBUG: Subversion bindings imported
Trac[paradox:api] INFO: Synchronized '(default)' repository in 0.06 seconds
Trac[paradox:session] DEBUG: Retrieving session for ID '[email protected]'
Trac[paradox:api] DEBUG: action controllers for ticket workflow: ['ConfigurableTicketWorkflow']
Trac[paradox:api] DEBUG: Adding (None [0]) for 'always' on rule (TicketComponentOwnerSubscriber) for (email)
Trac[paradox:api] DEBUG: Adding (None [0]) for 'always' on rule (TicketReporterSubscriber) for (email)
Trac[paradox:filters] DEBUG: Checking *_VIEW permission on event for resource ticket:33
Trac[paradox:filters] DEBUG: Checking *_VIEW permission on event for resource ticket:33
Trac[paradox:api] DEBUG: AnnouncementSystem has found the following subscriptions: [[email protected](not authenticated) via email], [[email protected](not authenticated) via email]
Trac[paradox:mail] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, text/plain
Trac[paradox:mail] DEBUG: EmailDistributor found the address '[email protected]' for 'None (not authenticated)' via: NoneType
Trac[paradox:mail] DEBUG: EmailDistributor expected local delivery for None to: [email protected]
Trac[paradox:mail] DEBUG: EmailDistributor found the address '[email protected]' for 'None (not authenticated)' via: NoneType
Trac[paradox:mail] DEBUG: EmailDistributor expected local delivery for None to: [email protected]
Trac[paradox:mail] DEBUG: EmailDistributor is sending event as 'text/html' to: [email protected], [email protected]
Trac[paradox:mail] DEBUG: All email recipients: [u'[email protected]', u'[email protected]']
Trac[paradox:mail] DEBUG: EmailDistributor took 0.43 seconds to send.
Trac[paradox:api] DEBUG: AnnouncementSystem sent event in 0.65 seconds.
Trac[paradox:main] DEBUG: Dispatching <Request "GET '/ticket/33'">

==> /var/log/maillog <==
Dec  5 10:26:07 hero sendmail[9041]: rB5AQ7cu009041: from=<trac@localhost>, size=7715, class=-60, nrcpts=2, msgid=<NB2HI4B2F4XWS3TUOJQW4ZLUF52HEYLDFR2GSY3LMV2CYMZT@localhost>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec  5 10:26:08 hero sendmail[9043]: STARTTLS=client, relay=thor.uk.domain.com., version=TLSv1/SSLv3, verify=FAIL, cipher=AES128-SHA, bits=128/128

==> /data/intranet/html/trac/paradox/log/trac.log <==
Trac[paradox:api] INFO: Synchronized '(default)' repository in 0.00 seconds
Trac[paradox:session] DEBUG: Retrieving session for ID '[email protected]'
Trac[paradox:default_workflow] DEBUG: render_ticket_action_control: action "leave"
Trac[paradox:default_workflow] DEBUG: render_ticket_action_control: action "resolve"
Trac[paradox:default_workflow] DEBUG: render_ticket_action_control: action "reassign"
Trac[paradox:default_workflow] DEBUG: render_ticket_action_control: action "accept"
Trac[paradox:chrome] DEBUG: Prepare chrome data for request

==> /var/log/maillog <==
Dec  5 10:26:08 hero sendmail[9043]: rB5AQ7cu009041: to=<[email protected]>,<[email protected]>, delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=265715, relay=thor.uk.domain.com. [172.16.0.19], dsn=2.0.0, stat=Sent (<NB2HI4B2F4XWS3TUOJQW4ZLUF52HEYLDFR2GSY3LMV2CYMZT@localhost> [InternalId=6859757] Queued mail for delivery)

==> /data/intranet/html/trac/paradox/log/trac.log <==
Trac[paradox:main] DEBUG: Dispatching <Request "GET '/chrome/common/js/auto_preview.js'">
Trac[paradox:main] DEBUG: Dispatching <Request "GET '/chrome/common/feed.png'">
Trac[paradox:main] DEBUG: Dispatching <Request "GET '/chrome/common/draft.png'">

Note on Admin->Components I have set the owner to legitimate email address.

1

There are 1 answers

6
RjOllos On

I put my email address under settings however when i create a new ticket In the log file i get ...

I tried this on Trac 1.0-stable, and the email address that is set through the user preferences (/prefs) and stored in the session data is used even when the username is an email address. This behavior was implemented in #8356 for Trac 1.0, so it looks like you may need to upgrade to resolve the issue.

... also where does [email protected] come from?

If [ticket] default_owner = < default >, then new tickets will be assigned to the component owner. The owner for component1 and component2 in the initial data that is provided with Trac is somebody. The default domain ([notification] smtp_default_domain) is appended to usernames that don't have an email address set in the session data. If you remove smtp_default_domain or set its value to empty, you should see in the logs: Trac[notification] INFO: Email address w/o domain: somebody, and email won't be sent to [email protected].