Re: [Trac] Change email adresses of old tickets

2019-07-02 Thread Ryan Ollos
On Tue, Jul 2, 2019 at 5:23 AM Mo  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:
https://trac.edgewall.org/wiki/TracIni#notification-subscriber-section

In Trac < 1.2, the setting was [notification] always_notify_updater = True
https://trac.edgewall.org/demo-1.0/wiki/TracIni#notification-section


> 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".

https://trac.edgewall.org/wiki/TracDev/DatabaseSchema/Common#Tablesession_attribute


- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CA%2BBGpn-aW-7E_Y0Qk_xFyiyrb17ndpMeJGjY_SiMcFPQOeP73g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Trac] Change email adresses of old tickets

2019-07-02 Thread Mo
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.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/ff1c0ef8-3db9-476d-b35b-448984caad2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.