Skip to content

Commit

Permalink
Fix for mimetype-dest (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Aug 12, 2024
1 parent 0293bc7 commit dff1880
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/config/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,18 @@ func BuildExecCommand(message api.Payload, c *ServerConfig) (*exec.Cmd, error) {
args = append(args, a)
// if we have the special value of %destination-mime-ext
// replace it with the source mimetype extension
} else if a == "%destination-mime-ext" {
} else if a == "%destination-mime-ext" || a == "%destination-mime-ext:-" {
dash := false
if a == "%destination-mime-ext:-" {
dash = true
}
a, err := GetMimeTypeExtension(message.Attachment.Content.DestinationMimeType)
if err != nil {
return nil, fmt.Errorf("unknown mime extension: %s", message.Attachment.Content.DestinationMimeType)
}

if dash {
a = fmt.Sprintf("%s:-", a)
}
args = append(args, a)

} else if a == "%target" {
Expand Down

0 comments on commit dff1880

Please sign in to comment.