Exim abandoned: unknown, malformed, or incomplete option -s

Salou20

Registered
Jul 3, 2014
1
0
1
Knoxville, Tennessee, United States
cPanel Access Level
Root Administrator
Hi all, I am getting the following error in my ssh terminal when my script prompts an email to be sent:

exim abandoned: unknown, malformed, or incomplete option -s

My script is as follows:
Code:
void send_alert(const std::string &subject, const std::string &text) {
  start_sql("SELECT * FROM tconfig;");
  run_sql();

  std::string sender_addr = decode_str(sql_result("sender_addr"));
  std::string alert_addr = decode_str(sql_result("alert_addr"));

  end_sql();

  std::string filename = tmpnam(NULL);
  std::ofstream file(filename.c_str());
  file << text;
  file.close();

  std::string cmd = "mail " + alert_addr + " -s '" + subject + "' < " + filename;

  system(cmd.c_str());
}

any suggestions?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Hello :)

The "s" flag as you have used it is not valid. EX:

Code:
# exim -s
exim abandoned: unknown, malformed, or incomplete option -s
You should update the script so it uses a valid flag.

Thank you.