Change email adresses of old tickets

9 views
Skip to first unread message

Mo

unread,
Jul 2, 2019, 7:23:01 AM7/2/19
to Trac Users
Hi,

we have changed the dnsdomain of our local Trac Server and mail-relay.
Touching old tickets still tries to send mails to old adresses @olddomain instead of @newdomain.

How does Trac determine all the adresses? It seems to not only fetch the adresses of known users but also the old adresses from comments, when users had the old adress.
Using ssmtp in the background, there is only rewriteDomain, that would rewrite the From: domain. What I would need is a rewriteToDomain or something.
Is that possible in Trac? Our mail-relay refuses to send mails to the old domain, but the mailboxes are all the same on the new domain.

As a last solution, would it be possible to do a global search-replace of all @olddomain in the Postgres db, and what is the best way to do that?

Best regards.

Ryan Ollos

unread,
Jul 3, 2019, 1:55:31 AM7/3/19
to Trac Users
On Tue, Jul 2, 2019 at 5:23 AM Mo <burcheri...@gmail.com> wrote:
Hi,

we have changed the dnsdomain of our local Trac Server and mail-relay.
Touching old tickets still tries to send mails to old adresses @olddomain instead of @newdomain.

How does Trac determine all the adresses? It seems to not only fetch the adresses of known users but also the old adresses from comments, when users had the old adress.

That depends on your notification settings, and the Notification system changed in Trac 1.2, but both pre-1.2 and 1.2 have "Ticket that I previously updated is modified" rules for notifying users. It sounds like that notification rule is enabled. In Trac 1.2+ the subscription is TicketUpdaterSubscriber:

In Trac < 1.2, the setting was [notification] always_notify_updater = True
 
Using ssmtp in the background, there is only rewriteDomain, that would rewrite the From: domain. What I would need is a rewriteToDomain or something.
Is that possible in Trac? Our mail-relay refuses to send mails to the old domain, but the mailboxes are all the same on the new domain.

As a last solution, would it be possible to do a global search-replace of all @olddomain in the Postgres db, and what is the best way to do that?

Assuming you have only authenticated users, and you aren't doing something complex like pulling email addresses from an LDAP server, you can replace the email addresses in the `session_attribute` table. Search for all items with name=email, fetch the "value", replace the domain and change the "value".


- Ryan
Reply all
Reply to author
Forward
0 new messages