regex fwd_header("---- .+ Message -----");
regex received("^Received:");
regex from("^From:");
+ regex subject("^Subject:");
regex returnpath("^Return-Path:");
openlog("gnucomo", 0, LOG_MAIL);
while (std::cin >> line)
{
+ //std::cout << "[" << state << "] checking " << line << "\n"; // DEBUG
switch (state)
{
case 0:
case 1:
// Inside the forwarded header
- if (line == received || line == from || line == returnpath)
+ if (line == received || line == from || line == returnpath || line == subject)
{
header = line;
state = 2;
case 2:
if (line == regex("^[^ ]+: "))
{
+ //std::cout << "Header: " << header << "\n"; // DEBUG
syslog(LOG_WARNING, "%s", (char *)header);
- header = "";
- state = 1;
- if (line == received || line == from || line == returnpath)
- {
- header = line;
- state = 2;
- }
+
+ header = line;
}
else if (line == String(""))
{