Skip to content

Can't delete an alias when an alias was added with just one email. #1563

@mcastillof

Description

@mcastillof

Context

While using ./setup.sh, If you create an alias with an uncompleted command, then you can't delete it.

##Steps to reproduce:

user@zeus:~/mail# ./setup.sh alias list
[email protected] [email protected]
user@zeus:~/mail# ./setup.sh alias add [email protected]
user@zeus:~/mail# ./setup.sh alias list
[email protected] [email protected]
[email protected]
user@zeus:~/mail# ./setup.sh alias del [email protected]
Usage: delalias <alias@domain> <recipient@other>
No email specifed

Actual Behavior

The malformed alias can't be deleted

Expected behavior (i.e. solution)

The malformed alias be deleted

Your Environment

'latest' docker image with latest ./setup.sh file.

Workaround

I deleted the alias entry in /tmp/docker-mailserver/postfix-virtual.cf inside the container.

About a real solution

Both addalias and delalias expects two arguments:

/usr/local/bin/addalias
Usage: addalias <alias@domain> <recipient@other>
/usr/local/bin/delalias
Usage: delalias <alias@domain> <recipient@other>

but, addalias just check for one argument.
https://github.com/tomav/docker-mailserver/blob/df4e04f03346e8f384e6857f0d8240511c2ed63d/target/bin/addalias#L21
https://github.com/tomav/docker-mailserver/blob/df4e04f03346e8f384e6857f0d8240511c2ed63d/target/bin/delalias#L21

I'm not an email expert, so I don't know if a line with just one email is valid in the postfix-virtual.cf file. if it is valid, then delalias should be modified to be able to delete a line with one email. If it is not valid, then addalias should be modified to ensure that two arguments are there.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions