mirror of
https://github.com/directorz/mailfull-go.git
synced 2025-12-18 10:07:03 +00:00
Fixed arguments check
This commit is contained in:
@@ -273,12 +273,16 @@ func (r *Repository) usersHashedPassword(domainName string) (map[string]string,
|
|||||||
|
|
||||||
// userForwards returns a string slice of forwards that the input name has.
|
// userForwards returns a string slice of forwards that the input name has.
|
||||||
func (r *Repository) userForwards(domainName, userName string) ([]string, error) {
|
func (r *Repository) userForwards(domainName, userName string) ([]string, error) {
|
||||||
user, err := r.User(domainName, userName)
|
domain, err := r.Domain(domainName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if user == nil {
|
if domain == nil {
|
||||||
return nil, ErrUserNotExist
|
return nil, ErrDomainNotExist
|
||||||
|
}
|
||||||
|
|
||||||
|
if !validUserName(userName) {
|
||||||
|
return nil, ErrInvalidUserName
|
||||||
}
|
}
|
||||||
|
|
||||||
file, err := os.Open(filepath.Join(r.DirMailDataPath, domainName, userName, FileNameUserForwards))
|
file, err := os.Open(filepath.Join(r.DirMailDataPath, domainName, userName, FileNameUserForwards))
|
||||||
|
|||||||
Reference in New Issue
Block a user