Answers.Body: <p>Emails have two &quot;from&quot; addresses. One is the 'smtp-from' or 'envelope-from', and the other one ('header from') is the one that you see in your email program.</p>
  <p>The email addresses you are referring to are for &quot;bounce tracking&quot;, and normally, they would be set as the smtp-from, but not the header-from, and you wouldn't see that as the recipient, you'd see the address you (the sender) put as the (header) from address.</p>
  <p>If the issue is that you are now seeing the smtp-from/envelope-from address as the header-from (after the php upgrade), then I suspect it has to do with some handling of the mail after it leaves civicrm, i.e. by whatever php has setup for it's mail. There's probably some simplified mail agent that drops the header from and then it gets replaced by the smtp-from.</p>
  <p>I'll go out on a limb and guess that your previous setup might not have included bounce handling anyway.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-20T18:36:25.290Z
Answers.LastActivityDate: 2023-06-20T18:36:25.290Z
Answers.UserDisplayName: Alan Dixon
Body: <p>We just upgraded to the latest civi 5.62.0 and after doing so when we send an email out of the system it sends a seemingly random string @ our domain name as the &quot;from&quot;.  Here's an email header:</p>
  <pre><code>b.53.4009.d2f1d0d5b9a05516@ourdomain.tld
  b.51.4008.e06411d46896dda8@ourdomain.tld
  ...and so forth and so on always different but it seems to increment upward.
  </code></pre>
  <p>This system uses PHP version 8.1.20 which meets or exceeds the recommendation of 7.4.
  Extensions
  All extensions are up-to-date:</p>
  <pre><code>Access Control by Financial Type for Reports: Version 2.0
  AuthX: Version 5.62.0
  Civi-Import: Version 5.62.0
  CiviCRM Administration UI: Version 5.62.0
  CKEditor4: Version 5.62.0
  Custom search framework: Version 5.62.0
  Event Cart: Version 5.62.0
  ExtendedReport: Version 5.21
  Financial ACLs: Version 5.62.0
  FlexMailer: Version 5.62.0
  Form Core: Version 5.62.0
  Membership Renewallinks: Version 1.1
  reCAPTCHA: Version 5.62.0
  SearchKit: Version 5.62.0
  Sequential credit notes: Version 5.62.0
  Theme: Greenwich: Version 5.62.0
  </code></pre>
  <p>Is there a bug in a file that creates the mail that creates a random string@...?  I also disabled the original system default email and created a new one with the same odd result.</p>
  <p>I downloaded a copy of the mariadb / mysql database and searched through it but I only see our configured mail in there correctly.  This is beyond my scope of knowledge.</p>
  <p>Can anyone assist in tracking down what file in the system is doing this and some code to tweak this behavior?</p>
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-15T21:04:02.140Z
Comments.Text: At Administer - CiviMail - CiviMail Component Settings, do you have `Track replies using VERP in Reply-To header` checked?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-16T01:57:24.420Z
Comments.Text: I back rev'd to PHP 7.4 since we also upgraded to PHP 8.1.  When back rev'ing to PHP 7.4 it worked as expected and perfectly.  Something must be up with however that all works :-)
Comments.UserDisplayName: A Civi Admin Kinda
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-16T02:09:33.337Z
Comments.Text: the fact is starts with a b. to me means it is using bounce tracking and hence this 'random' stuff is how civimail tracks the bounces
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-16T03:01:47.993Z
Comments.Text: @Dermit yes but that is unticked.  The ticked options are:  Enable Double Opt-in for Profile Group(s) field, Enable CiviMail to generate Message-ID header, Enable CiviMail to create activities on delivery, CiviMail dedupes e-mail addresses by default, Enable automatic CiviMail recipient count display, Enable click-through tracking by default, Enable open tracking by default, Use Smarty in scheduled reminders
  
  Cron seemed to break with a .par file process too that calls the mail api for sending.  I had to copy it back after the upgrade.  That's another problem for another time!
Comments.UserDisplayName: A Civi Admin Kinda
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-16T03:03:20.077Z
Comments.Text: @petendz that's likely!  Good catch!  We were using it before too, I haven't changed anything after upgrading so why would it be "fixed" in PHP 7.4 but break in PHP 8.1...?  It must be a code problem between 7.4 and 8.1 eh?
Comments.UserDisplayName: A Civi Admin Kinda
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-22T12:29:19.983Z
Comments.Text: Can you share who the mail is sent to in your "Outgoing Mail/SMTP" settings?  Not the specific server, but something like, "We send through GMail" or "we send through a Postfix server". As Alan describes below, some mail servers misbehave. Exchange 365 is notably a bad actor.
Comments.UserDisplayName: Jon G - Megaphone Tech
Tags: <civimail>
Title: Sent mail is %randomstring%@yourdomain.tld
ThreadText: # Sent mail is %randomstring%@yourdomain.tld
  
  (Asked by: username_0 on 2023-06-15)
  
  We just upgraded to the latest civi 5.62.0 and after doing so when we send an email out of the system it sends a seemingly random string @ our domain name as the "from".  Here's an email header:
  b.53.4009.d2f1d0d5b9a05516@ourdomain.tld
  b.51.4008.e06411d46896dda8@ourdomain.tld
  ...and so forth and so on always different but it seems to increment upward.
  
  This system uses PHP version 8.1.20 which meets or exceeds the recommendation of 7.4.
  Extensions
  All extensions are up-to-date:
  Access Control by Financial Type for Reports: Version 2.0
  AuthX: Version 5.62.0
  Civi-Import: Version 5.62.0
  CiviCRM Administration UI: Version 5.62.0
  CKEditor4: Version 5.62.0
  Custom search framework: Version 5.62.0
  Event Cart: Version 5.62.0
  ExtendedReport: Version 5.21
  Financial ACLs: Version 5.62.0
  FlexMailer: Version 5.62.0
  Form Core: Version 5.62.0
  Membership Renewallinks: Version 1.1
  reCAPTCHA: Version 5.62.0
  SearchKit: Version 5.62.0
  Sequential credit notes: Version 5.62.0
  Theme: Greenwich: Version 5.62.0
  
  Is there a bug in a file that creates the mail that creates a random string@...?  I also disabled the original system default email and created a new one with the same odd result.
  I downloaded a copy of the mariadb / mysql database and searched through it but I only see our configured mail in there correctly.  This is beyond my scope of knowledge.
  Can anyone assist in tracking down what file in the system is doing this and some code to tweak this behavior?
  Thanks!
  
  **Tags:** civimail
  
  > **Comments:**
  > **username_1**: At Administer - CiviMail - CiviMail Component Settings, do you have `Track replies using VERP in Reply-To header` checked?  
  > **username_0**: I back rev'd to PHP 7.4 since we also upgraded to PHP 8.1.  When back rev'ing to PHP 7.4 it worked as expected and perfectly.  Something must be up with however that all works :-)  
  > **username_2**: the fact is starts with a b. to me means it is using bounce tracking and hence this 'random' stuff is how civimail tracks the bounces  
  > **username_0**: @Dermit yes but that is unticked.  The ticked options are:  Enable Double Opt-in for Profile Group(s) field, Enable CiviMail to generate Message-ID header, Enable CiviMail to create activities on delivery, CiviMail dedupes e-mail addresses by default, Enable automatic CiviMail recipient count display, Enable click-through tracking by default, Enable open tracking by default, Use Smarty in scheduled reminders  Cron seemed to break with a .par file process too that calls the mail api for sending.  I had to copy it back after the upgrade.  That's another problem for another time!  
  > **username_0**: @petendz that's likely!  Good catch!  We were using it before too, I haven't changed anything after upgrading so why would it be "fixed" in PHP 7.4 but break in PHP 8.1...?  It must be a code problem between 7.4 and 8.1 eh?  
  > **username_3**: Can you share who the mail is sent to in your "Outgoing Mail/SMTP" settings?  Not the specific server, but something like, "We send through GMail" or "we send through a Postfix server". As Alan describes below, some mail servers misbehave. Exchange 365 is notably a bad actor.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2023-06-20. Score: 2
  
  Emails have two "from" addresses. One is the 'smtp-from' or 'envelope-from', and the other one ('header from') is the one that you see in your email program.
  
  The email addresses you are referring to are for "bounce tracking", and normally, they would be set as the smtp-from, but not the header-from, and you wouldn't see that as the recipient, you'd see the address you (the sender) put as the (header) from address.
  
  If the issue is that you are now seeing the smtp-from/envelope-from address as the header-from (after the php upgrade), then I suspect it has to do with some handling of the mail after it leaves civicrm, i.e. by whatever php has setup for it's mail. There's probably some simplified mail agent that drops the header from and then it gets replaced by the smtp-from.
  
  I'll go out on a limb and guess that your previous setup might not have included bounce handling anyway.
  
  
  ---
  
  