Answers.Body: <p>Figured out the problem. The error was related to the &quot;message_linelength_limit&quot; due to recent changes in exim and directadmin on my server. Check the message limit using SSH:</p>
  <p>grep message_linelength_limit /etc/exim.conf</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-21T19:10:24.183Z
Answers.LastActivityDate: 2021-12-21T19:10:24.183Z
Answers.UserDisplayName: Kristine
Answers.Body: <p>I assume you have scheduled reminders set up in civi and that's where it's coming from? You said people send copies of activities but that wouldn't then be constantly repeating from the same lone activity so that's why I'm thinking scheduled reminders.</p>
  <p>The error is &quot;message has lines too long for transport&quot; - if there's something about that activity like a really long details field can you break up the line lengths in it?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-16T15:43:28.803Z
Answers.Text: I don't have any scheduled reminders setup in Civi. The only place people are sending activities is through the case. Additionally, the email doesn't tell me which case activity it is... any way to trace this?
Answers.UserDisplayName: Kristine
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-16T15:51:07.533Z
Answers.Text: You can try setting CIVICRM_MAIL_LOG_AND_SEND and CIVICRM_MAIL_LOG in civicrm.settings.php. See https://docs.civicrm.org/dev/en/latest/tools/debugging/#changing-file-based-settings. On a busy site it will get big quickly but then you can see copies of the emails and it might give a clue.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-15T19:45:05.143Z
Answers.LastActivityDate: 2021-12-15T19:45:05.143Z
Answers.UserDisplayName: Demerit
Body: <p>In the past month, I've been receiving a lot of junk/spam emails from CiviCRM. The email is titled &quot;Mail delivery failed: returning message to sender&quot; with the message:</p>
  <pre><code>This message was created automatically by mail delivery software.
  
  A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
  
    XXX@email.com
      message has lines too long for transport
  </code></pre>
  <p>I'm using Drupal 7.82/CiviCRM 4.43.2. CiviMail is not enabled and my outbound mail is selected as mail(). No issues there. Users use the mail system to send copies of case activities through CiviCase.</p>
  <p>This error seems to be related to ONEspecific case activity that's stuck in queue. Is there a way I can stop this email from resending?</p>
  
Tags: <email><civicase>
Title: Multiple "Mail delivery failed" Emails
ThreadText: # Multiple "Mail delivery failed" Emails
  
  (Asked by: username_0 on 2021-12-15)
  
  In the past month, I've been receiving a lot of junk/spam emails from CiviCRM. The email is titled "Mail delivery failed: returning message to sender" with the message:
  This message was created automatically by mail delivery software.
  
  A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
  
    XXX@email.com
      message has lines too long for transport
  
  I'm using Drupal 7.82/CiviCRM 4.43.2. CiviMail is not enabled and my outbound mail is selected as mail(). No issues there. Users use the mail system to send copies of case activities through CiviCase.
  This error seems to be related to ONEspecific case activity that's stuck in queue. Is there a way I can stop this email from resending?
  
  **Tags:** email, civicase
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2021-12-21. Score: 1 | Accepted answer
  
  Figured out the problem. The error was related to the "message\_linelength\_limit" due to recent changes in exim and directadmin on my server. Check the message limit using SSH:
  
  grep message\_linelength\_limit /etc/exim.conf
  
  
  ---
  
  ### Answer by username_1 on 2021-12-15. Score: 1
  
  I assume you have scheduled reminders set up in civi and that's where it's coming from? You said people send copies of activities but that wouldn't then be constantly repeating from the same lone activity so that's why I'm thinking scheduled reminders.
  
  The error is "message has lines too long for transport" - if there's something about that activity like a really long details field can you break up the line lengths in it?
  
  > **Comments:**
  > **username_0**: I don't have any scheduled reminders setup in Civi. The only place people are sending activities is through the case. Additionally, the email doesn't tell me which case activity it is... any way to trace this?  
  > **username_1**: You can try setting CIVICRM_MAIL_LOG_AND_SEND and CIVICRM_MAIL_LOG in civicrm.settings.php. See https://docs.civicrm.org/dev/en/latest/tools/debugging/#changing-file-based-settings. On a busy site it will get big quickly but then you can see copies of the emails and it might give a clue.  
  
  ---
  
  