Documentation ¶
Overview ¶
Package webaccount provides a web app for users to view and change their account settings, and to import/export email.
Index ¶
- func CheckAuth(ctx context.Context, log *mlog.Log, kind string, w http.ResponseWriter, ...) (address, account string)
- func Handle(w http.ResponseWriter, r *http.Request)
- func ImportManage()
- type Account
- func (Account) Account(ctx context.Context) (string, dns.Domain, map[string]config.Destination)
- func (Account) AccountSaveFullName(ctx context.Context, fullName string)
- func (Account) DestinationSave(ctx context.Context, destName string, oldDest, newDest config.Destination)
- func (Account) ImportAbort(ctx context.Context, importToken string) error
- func (Account) SetPassword(ctx context.Context, password string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAuth ¶
func CheckAuth(ctx context.Context, log *mlog.Log, kind string, w http.ResponseWriter, r *http.Request) (address, account string)
CheckAuth checks http basic auth, returns login address and account name if valid, and writes http response and returns empty string otherwise.
func ImportManage ¶
func ImportManage()
ImportManage should be run as a goroutine, it manages imports of mboxes/maildirs, propagating progress over SSE connections.
Types ¶
type Account ¶
type Account struct{}
Account exports web API functions for the account web interface. All its methods are exported under api/. Function calls require valid HTTP Authentication credentials of a user.
func (Account) Account ¶
Account returns information about the account: full name, the default domain, and the destinations (keys are email addresses, or localparts to the default domain). todo: replace with a function that returns the whole account, when sherpadoc understands unnamed struct fields.
func (Account) AccountSaveFullName ¶
func (Account) DestinationSave ¶
func (Account) DestinationSave(ctx context.Context, destName string, oldDest, newDest config.Destination)
DestinationSave updates a destination. OldDest is compared against the current destination. If it does not match, an error is returned. Otherwise newDest is saved and the configuration reloaded.
func (Account) ImportAbort ¶
ImportAbort aborts an import that is in progress. If the import exists and isn't finished, no changes will have been made by the import.
func (Account) SetPassword ¶
SetPassword saves a new password for the account, invalidating the previous password. Sessions are not interrupted, and will keep working. New login attempts must use the new password. Password must be at least 8 characters.