Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
# .DS_Store files
.DS_Store
.gocache
raven-test
18 changes: 9 additions & 9 deletions internal/auth/oauthbearer/oauthbearer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,15 @@ func TestEvaluateRoleAccess_RejectsUnsafeComponents(t *testing.T) {
// characters that must never make it into the mailbox identity, even
// when the token roles claim happens to match.
cases := map[string]string{
"path traversal in domain": "admin@..",
"double dot inside domain": "admin@co..com",
"slash in domain": "admin@co/com",
"backslash in domain": "admin@co\\com",
"slash in local": "ad/min@co.com",
"double dot in local": "ad..min@co.com",
"non-ascii in domain": "admin@cΓΆ.com",
"whitespace inside local": "ad min@co.com",
"null byte in domain": "admin@co.com\x00evil",
"path traversal in domain": "admin@..",
"double dot inside domain": "admin@co..com",
"slash in domain": "admin@co/com",
"backslash in domain": "admin@co\\com",
"slash in local": "ad/min@co.com",
"double dot in local": "ad..min@co.com",
"non-ascii in domain": "admin@cΓΆ.com",
"whitespace inside local": "ad min@co.com",
"null byte in domain": "admin@co.com\x00evil",
}
for name, addr := range cases {
t.Run(name, func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/blobstorage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Config struct {
AccessKey string `yaml:"access_key"`
// #nosec G117 -- Configuration field name, not a hardcoded secret
SecretKey string `yaml:"secret_key"`
Timeout int `yaml:"timeout"` // seconds
Timeout int `yaml:"timeout"` // seconds
}

// NewS3BlobStorage creates a new S3 blob storage instance
Expand Down
3 changes: 1 addition & 2 deletions internal/db/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ func UserExists(db *sql.DB, username string, domainID int64) (bool, error) {
return count > 0, err
}



// Mailbox management functions

func CreateMailbox(db *sql.DB, userID int64, name string, specialUse string) (int64, error) {
Expand Down Expand Up @@ -1248,6 +1246,7 @@ func GetMessageHeaders(db *sql.DB, messageID int64) ([]map[string]string, error)

return headers, rows.Err()
}

// createDefaultMailboxes creates default mailboxes for a new user.
// Kept here with other schema helpers so migrations and initialization stay together.
func createDefaultMailboxes(db *sql.DB) error {
Expand Down
1 change: 0 additions & 1 deletion internal/db/sqlite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1569,4 +1569,3 @@ func TestGetMessageHeaders(t *testing.T) {
}
}
}

2 changes: 1 addition & 1 deletion internal/delivery/groupresolver/groupresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,4 +534,4 @@ func extractJWTExpiry(token string) (time.Time, error) {
}

return time.Unix(claims.Exp, 0), nil
}
}
10 changes: 5 additions & 5 deletions internal/delivery/groupresolver/groupresolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ func TestGroupMemberResolution(t *testing.T) {

case "/users/user-1":
resp := map[string]interface{}{
"id": "user-1",
"ouId": "ou-1",
"id": "user-1",
"ouId": "ou-1",
"attributes": map[string]string{
"username": "alice",
},
Expand All @@ -186,8 +186,8 @@ func TestGroupMemberResolution(t *testing.T) {

case "/users/user-2":
resp := map[string]interface{}{
"id": "user-2",
"ouId": "ou-2",
"id": "user-2",
"ouId": "ou-2",
"attributes": map[string]string{
"username": "bob",
},
Expand Down Expand Up @@ -290,4 +290,4 @@ func TestGroupNotFound(t *testing.T) {
if !strings.Contains(err.Error(), "not found") {
t.Errorf("ResolveGroupMembers() error = %v, expected 'not found'", err)
}
}
}
2 changes: 1 addition & 1 deletion internal/delivery/lmtp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,4 @@ func (s *Server) Shutdown() error {

log.Println("LMTP server shutdown complete")
return nil
}
}
Loading
Loading