我正在尝试设置trac通知,但它无法正常工作。在阿帕奇我有
<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>
在trac.ini中我有
always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
mime_encoding = base64
smtp_always_bcc =
smtp_always_cc = first.last@domain.com
smtp_default_domain = domain.com
smtp_enabled = true
smtp_from = trac@domain.com
smtp_password =
smtp_port = 25
smtp_replyto = support@domain.com
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
问题是我以firstl@domain.com身份登录,但我的电子邮件是first.last@domain.com。我该如何解决这个问题?
我将我的电子邮件地址置于设置下,但是当我创建新票证时,在日志文件中我得到了
2013-11-29 12:40:34,804 Trac[notification] DEBUG: Sending SMTP notification to hero.uk.domain.com on port 25 to [u'firstl@DOMAIN.COM', u'somebody@domain.com', u'first.last@domain.com']
更新
我安装了播音员插件。我收到错误
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
配置
[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 = sharif.uddin@domain.com
smtp_default_domain =
smtp_enabled = true
smtp_from = trac@domain.com
smtp_from_name = Trac
smtp_password =
smtp_port = 25
smtp_replyto = sharif.uddin@domain.com
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
新增更新
当前配置文件/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 = trac-no-reply@domain.com
smtp_from_name = Trac
smtp_password =
smtp_port = 25
smtp_replyto = no-reply@domain.com
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 = trac@domain.com
#smtp_password =
#smtp_port = 25
#smtp_replyto = support@domain.com
#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
创建故障单时,日志文件中会显示什么。
==> /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 'sharifu@DOMAIN.COM'
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: [sharifu@DOMAIN.COM(not authenticated) via email], [sharif.uddin@domain.com(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 'sharifu@DOMAIN.COM' for 'None (not authenticated)' via: NoneType
Trac[paradox:mail] DEBUG: EmailDistributor expected local delivery for None to: sharifu@DOMAIN.COM
Trac[paradox:mail] DEBUG: EmailDistributor found the address 'sharif.uddin@domain.com' for 'None (not authenticated)' via: NoneType
Trac[paradox:mail] DEBUG: EmailDistributor expected local delivery for None to: sharif.uddin@domain.com
Trac[paradox:mail] DEBUG: EmailDistributor is sending event as 'text/html' to: sharifu@DOMAIN.COM, sharif.uddin@domain.com
Trac[paradox:mail] DEBUG: All email recipients: [u'sharifu@DOMAIN.COM', u'sharif.uddin@domain.com']
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 'sharifu@DOMAIN.COM'
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=<sharif.uddin@domain.com>,<sharifu@DOMAIN.COM>, 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'">
注意管理员 - &gt;组件我已将所有者设置为合法的电子邮件地址。
答案 0 :(得分:1)
我将我的电子邮件地址置于设置下,但是当我创建新票证时,在日志文件中我得到了......
我在Trac 1.0-stable上尝试了这个,以及通过用户首选项(/prefs
)设置并存储在会话数据is used中的电子邮件地址,即使用户名是电子邮件地址也是如此。此行为是在#8356中为Trac 1.0实现的,因此您可能需要升级才能解决此问题。
... somebody@domain.com也来自哪里?
如果[ticket] default_owner = < default >
,则会将新故障单分配给组件所有者。随Trac提供的初始数据中component1
和component2
的所有者为somebody
。对于没有在会话数据中设置电子邮件地址的用户名,默认域([notification] smtp_default_domain
)为appended。如果您删除smtp_default_domain
或将其值设置为空,则应在日志中看到:Trac[notification] INFO: Email address w/o domain: somebody
,并且不会将电子邮件发送到somebody@domain.com
。