Skip to content

[Feature-Request] Add special debugging option (write original Vcalendar body to file and write fixed Vcalendar body to other file) #426

@ifrh

Description

@ifrh

For debugging some strange behaviors, it would be nice,
if one could use a special debugging option from GUI or as Commandline parameter
to let DavMail write out to different files

  • the original Vcalendar body
  • the fixed Vcalendar body

It would be much easyier to analyse these single files, than copy the content out of the WIRE-logs,
since copying via editor could change copied content, too.

The code for creating that additional files should be called or implemented in

protected void fixICS(byte[] icsContent, boolean fromServer) throws IOException {
if (LOGGER.isDebugEnabled() && fromServer) {
dumpIndex++;
String icsBody = new String(icsContent, StandardCharsets.UTF_8);
ICSCalendarValidator.ValidationResult vr = ICSCalendarValidator.validateWithDetails(icsBody);
dumpICS(icsBody, true, false);
LOGGER.debug("Vcalendar body ValidationResult: "+ vr.isValid() +" "+ vr.showReason());
LOGGER.debug("Vcalendar body received from server:\n" + icsBody);
}
vCalendar = new VCalendar(icsContent, getEmail(), getVTimezone());
vCalendar.fixVCalendar(fromServer);
if (LOGGER.isDebugEnabled() && !fromServer) {
String resultString = vCalendar.toString();
ICSCalendarValidator.ValidationResult vr = ICSCalendarValidator.validateWithDetails(resultString);
LOGGER.debug("Fixed Vcalendar body ValidationResult: "+ vr.isValid() +" "+ vr.showReason());
LOGGER.debug("Fixed Vcalendar body to server:\n" + resultString);
dumpICS(resultString, false, true);
}
}

Or is there an option for DavMail doing the wanted thing already?
Than some documentation need additional information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions