[prev in list] [next in list] [prev in thread] [next in thread] 

List:       trac
Subject:    Re: [Trac] Change email adresses of old tickets
From:       Ryan Ollos <rjollos () gmail ! com>
Date:       2019-07-03 5:55:14
Message-ID: CA+BGpn-aW-7E_Y0Qk_xFyiyrb17ndpMeJGjY_SiMcFPQOeP73g () mail ! gmail ! com
[Download RAW message or body]

On Tue, Jul 2, 2019 at 5:23 AM Mo <burcheri.massimo@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:
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+unsubscribe@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.


[Attachment #3 (text/html)]

<div dir="ltr"><div dir="ltr">On Tue, Jul 2, 2019 at 5:23 AM Mo &lt;<a \
href="mailto:burcheri.massimo@gmail.com">burcheri.massimo@gmail.com</a>&gt; \
wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><br>we have changed the \
dnsdomain of our local Trac Server and mail-relay.<br>Touching old tickets still \
tries to send mails to old adresses @olddomain instead of @newdomain.<br><br>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.<br></div></blockquote><div><br></div><div>That depends on your notification \
settings, and the Notification system changed in Trac 1.2, but both pre-1.2 and 1.2 \
have &quot;Ticket that I previously updated is modified&quot; rules for notifying \
users. It sounds like that notification rule is enabled. In Trac 1.2+ the \
subscription is  TicketUpdaterSubscriber:</div><div><a \
href="https://trac.edgewall.org/wiki/TracIni#notification-subscriber-section">https:// \
trac.edgewall.org/wiki/TracIni#notification-subscriber-section</a><br></div><div><br></div><div>In \
Trac &lt; 1.2, the setting was [notification] always_notify_updater = \
True</div><div><a href="https://trac.edgewall.org/demo-1.0/wiki/TracIni#notification-s \
ection">https://trac.edgewall.org/demo-1.0/wiki/TracIni#notification-section</a><br></div><div> \
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px \
solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Using ssmtp in the \
background, there is only rewriteDomain, that would rewrite the From: domain. What I \
would need is a rewriteToDomain or something.<br>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.<br><br>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?<br></div></blockquote><div><br></div><div>Assuming you have only \
authenticated users, and you aren&#39;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 \
&quot;value&quot;, replace the domain and change the \
&quot;value&quot;.</div><div><br></div><div><a \
href="https://trac.edgewall.org/wiki/TracDev/DatabaseSchema/Common#Tablesession_attrib \
ute">https://trac.edgewall.org/wiki/TracDev/DatabaseSchema/Common#Tablesession_attribute</a> \
</div><div><br></div><div>- Ryan</div></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &quot;Trac \
Users&quot; group.<br /> To unsubscribe from this group and stop receiving emails \
from it, send an email to <a \
href="mailto:trac-users+unsubscribe@googlegroups.com">trac-users+unsubscribe@googlegroups.com</a>.<br \
/> To post to this group, send email to <a \
href="mailto:trac-users@googlegroups.com">trac-users@googlegroups.com</a>.<br /> \
Visit this group at <a \
href="https://groups.google.com/group/trac-users">https://groups.google.com/group/trac-users</a>.<br \
/> To view this discussion on the web visit <a \
href="https://groups.google.com/d/msgid/trac-users/CA%2BBGpn-aW-7E_Y0Qk_xFyiyrb17ndpMe \
JGjY_SiMcFPQOeP73g%40mail.gmail.com?utm_medium=email&utm_source=footer">https://groups \
.google.com/d/msgid/trac-users/CA%2BBGpn-aW-7E_Y0Qk_xFyiyrb17ndpMeJGjY_SiMcFPQOeP73g%40mail.gmail.com</a>.<br \
/> For more options, visit <a \
href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br \
/>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic