| Age | Commit message (Collapse) | Author |
|
With help of spdxconv tool [1], we able to bulk update all files license
and copyright format to comply with SPDX formats.
[1] https://kilabit.info/project/spdxconv/
|
|
Instead of annotating the lines that caught by linters, fix it to comply
with the recommendations.
This causes several breaking changes, especially related to naming,
* api/slack: [Message.IconUrl] become [Message.IconURL]
* lib/dns: DefaultSoaMinumumTtl become DefaultSoaMinimumTTL
* lib/email: [Message.SetBodyHtml] become [Message.SetBodyHTML]
* lib/http: [Client.GenerateHttpRequest] become
[Client.GenerateHTTPRequest]
* lib/http: [ClientOptions.ServerUrl] become [ClientOptions.ServerURL]
* lib/http: [EndpointRequest.HttpWriter] become
[EndpointRequest.HTTPWriter]
* lib/http: [EndpointRequest.HttpRequest] become
[EndpointRequest.HTTPRequest]
* lib/http: [ServerOptions.EnableIndexHtml] become
[ServerOptions.EnableIndexHTML]
* lib/http: [SSEConn.HttpRequest] become [SSEConn.HTTPRequest]
* lib/smtp: [ClientOptions.ServerUrl] become [ClientOptions.ServerURL]
* lib/ssh/sftp: [FileAttrs.SetUid] become [FileAttrs.SetUID]
* lib/ssh/sftp: [FileAttrs.Uid] become [FileAttrs.UID]
|
|
There are several reasons that why we move from github.com.
First, related to the name of package.
We accidentally name the package with "share" a common word in English
that does not reflect the content of repository.
By moving to other repository, we can rename it to better and unique
name, in this "pakakeh.go".
Pakakeh is Minang word for tools, and ".go" suffix indicate that the
repository related to Go programming language.
Second, supporting open source.
The new repository is hosted under sourcehut.org, the founder is known
to support open source, and all their services are licensed under AGPL,
unlike GitHub that are closed sources.
Third, regarding GitHub CoPilot.
The GitHub Terms of Service [1], allow any public content that are hosted
there granted them to parse the content.
On one side, GitHub helps and flourish the open source, but on another
side have an issues regarding scraping the copyleft license [2].
[1]: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#4-license-grant-to-us
[2]: https://githubcopilotinvestigation.com
|
|
There are some reports that I disagree with revive, in example, code
should not declare the type after variables.
In my opinion, on some cases, declaring the type make the code more
readable and explicit.
Since I did not want to add new configuration file, we changes it and
follow revive for now.
|
|
Somehow in 3a1a2715b25f, we include this method without implementing it.
The SendEmail method simplify sending email by automatically create
[MailTx] for passing it to method Client.MailTx.
The test right now use live connection since the Server is not ready yet.
|
|
This changes require all unit tests to use their own client.
|
|
Previously, to create new client one must pass three parameters to
NewClient function: localName, remoteURL, and insecure.
If we want to add another parameters in the future, it will cause the
function signature changes.
This changes simplify creating NewClient by passing single struct
with new parameters: AuthUser, AuthPass, and AuthMechanism.
If both AuthUser and AuthPass is not empty, the NewClient will
authenticate the connection, minimize number of step on the caller.
|
|
|
|
The goal is to minimize memory consumed by struct instance.
Changes,
* Client: from 112 to 80 bytes (-32 bytes)
* Command: from 48 to 32 bytes (-8 bytes)
* Domain: from 32 to 24 bytes (-8 bytes)
* LocalStorage: from 72 to 40 bytes (-32 bytes)
* MailTx: from 128 to 112 bytes (-16 bytes)
* receiver: from 152 to 104 bytes (-48 bytes)
* Response: from 32 to 24 bytes (-8 bytes)
* Server: from 144 to 128 bytes (-16 bytes)
* ServerInfo: from 40 to 32 bytes (-8 bytes)
|
|
Previously, the test.Assert and test.AssertBench functions has the
boolean parameter to print the stack trace of test in case its not equal.
Since this parameter is not mandatory and its usually always set to
"true", we remove them from function signature to simplify the call
to Assert and AssertBench.
|
|
The lookup test should use local DNS server instead of relying on
external DNS response.
|
|
This test takes too long due to connection timed out.
|
|
|
|
|
|
|
|
Previously, Connect and Ehlo are separated functions that must be called
by client manually to connect and to send EHLO command to server.
This commit unexport Connect and Ehlo, and call them implicitly when
creating NewClient.
This minimize any command that require Ehlo first, for example when
upgrading connection with STARTTLS and on mail transaction.
|
|
If we use slice of string to manage server extension we lost the
extension parameter due to split by " " on extension string.
This commit change the type of extension on ServerInfo as a mapping
between extension name and their parameters.
|
|
Previously, the remote address parameter on NewClient use the format
of "(hostname|ip-address)[:port]" to connect. This format does not have
any flags to indicate whether server support TLS or not. We can check
the port number and assume that port number 465 or 587 to support TLS,
but we can't do TLS on non well known port.
This commit change the remote address parameter to use URL based format,
remoteURL = [ scheme "://" ](domain | IP-address [":" port])
scheme = "smtp" / "smtps"
If scheme is "smtp", client will assume that no STARTTLS command will be
issued after connection has been established; otherwise if scheme is
"smtps", client will send STARTTLS command on any or missing port given
in URL.
|
|
LocalHandler is SMTP server that contains domain and user's accounts
in server environment.
The LocalHandler replace the HandlerPosix and remove unused Storage
interface and field in server.
|
|
The original purpose of environment is to allow bootstraping SMTP server
using user defined methods (e.g. from file or database), but since
primary or virtual domains is only set once, its setting can be acquired
and set before server started using any methods.
As replacement of environment, the primary domain (previously Hostname)
and virtual domains (previously Domains) are embedded directly as fields
of server.
|
|
By default normal listener will listen to port 25 and TLS port will
listen on port 465.
|
|
|
|
|
|
|
|
The non nil ServerInfo indicate that client has been called EHLO or HELO
before, which required for client to check whether server support AUTH
extension or not.
|
|
|
|
The SMTP AUTH is implemented as a core command instead of as an extension.
|
|
This option allow client to connect to server with self-signed certificate.
|
|
|