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:

  [email protected]
    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?

2 Answers 2


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?

  • 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?
    – Kristine
    Commented Dec 16, 2021 at 15:43
  • You can try setting CIVICRM_MAIL_LOG_AND_SEND and CIVICRM_MAIL_LOG in civicrm.settings.php. See docs.civicrm.org/dev/en/latest/tools/debugging/…. On a busy site it will get big quickly but then you can see copies of the emails and it might give a clue.
    – Demerit
    Commented Dec 16, 2021 at 15:51

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.