If you want to maintain multiple accounts but select one by default, add an account command after the accounts are defined to select it
Example rc file:
account myimap {
set folder=imap://user@host
set record=+Sent
set imap-keepalive="5"
}
account local {
set folder=.local/maildir
unset record
}
# Now select myimap as default account on startup:
account myimap
Now on invoking mailx, it will connect to myimap, but you can still switch between the two accounts with account local and account myimap (and whatever other accounts you define) in interactive mode, or pick which one using mailx -A myimap or mailx -A local (and whatever other accounts) when invoking from the commandline.
(tested with Heirloom mailx version 12.5 6/20/10)