Re: OpenSMTPD-extras manual
On Sun, Dec 20, 2020 at 05:09:22PM +0300, ?? wrote: > man table-socketmap is interesting but confusing: > __ > """DESCRIPTION > This manual page documents the file > format of "socketmap" tables used by > the smtpd(8) mail daemon. > > The format described here applies to tables > as defined in smtpd.conf(5). > > SOCKETMAP TABLE > A "socketmap" table uses a simple protocol. > The client sends a single- The single line request is: table-name key > line request and the server sends > a single-line reply. > The reply is one of: OK answer NOTFOUND TEMP TIMEOUT PERM > The table may be used for any kind of key-based > lookup and replies are > expected to follow the formats described in table(5). > """ > __ So in theory you would have something like the following in smtpd.conf: table test socketmap:/path/to/socketmap.sock where the table-name would be test in the above request line. > > This table type could be just an experimental > useless table type like ldap tables or > a universal key to any userdata(password) storage if > one manages to make a middleware which > is able to make requests to any userdata storage > and return a needed value in proper format > to smtpd server through socketmap. > > But again no clear manual entry makes it useless. > No hint in the manual how to configure this type > of table access > > > 20.12.2020 01:34, Ingo Schwarze ??: > > Hi Maksim & Edgar, > > > > Edgar Pettijohn wrote on Sat, Dec 19, 2020 at 03:37:22PM -0600: > > > On Sat, Dec 19, 2020 at 08:02:19PM +0300, ?? wrote: > > > > > > Where can I find any manuals and examples regarding OpenSMTPD-extras? > > > > Try: > > > > $ man -k ^table- > > $ man table-passwd table-socketmap table-sqlite table-redis > > > > > > Which table types are supported and do not have status "experimental" > > > > like ldap tables? > > > > E.g. what is opensmtpd-extras-python and how can I use it? > > > > Not sure about thise questions. > > > > > Your best bet is to git clone the repository and search for the tables, > > > etc you are interested in. > > > > That would be unusual with OpenBSD; when possible, we try to include > > documentation in user-installable packages and not only in source > > distributions. > > > > Strangely, in this case, there are files > > > >table-postgres.5 table-mysql.5 > > > > in the source tarballs but not in the respective packing lists. > > > > Strangely, the tarball also contains three empty README files. > > > > > If there is a manual simply `mandoc file | less`. > > > > Not the best advice ever... :-/ > > > > Manually piping mandoc(1) output to less(1) is never needed. > > > > If you have a manual page in the current directory - say, table-sqlite.5 - > > then just > > > > $ man -l table-sqlite.5 > > > > is sufficient, and if it's properly installed, as the opensmtpd-extras > > package does it, then just > > > > $ man table-sqlite > > > > does the job without even needing to worry about the current directory. > > > > > Unfortunantly there aren't manuals for all of the `extras`. > > > > Hmm, you may be right about that one, for example a table-python(5) > > manual page doesn't appear to exist. > > > > Yours, > >Ingo > > > > -- > ?? ??, > ?? >
Re: OpenSMTPD-extras manual
man table-socketmap is interesting but confusing: __ """DESCRIPTION This manual page documents the file format of "socketmap" tables used by the smtpd(8) mail daemon. The format described here applies to tables as defined in smtpd.conf(5). SOCKETMAP TABLE A "socketmap" table uses a simple protocol. The client sends a single- line request and the server sends a single-line reply. The table may be used for any kind of key-based lookup and replies are expected to follow the formats described in table(5). """ __ This table type could be just an experimental useless table type like ldap tables or a universal key to any userdata(password) storage if one manages to make a middleware which is able to make requests to any userdata storage and return a needed value in proper format to smtpd server through socketmap. But again no clear manual entry makes it useless. No hint in the manual how to configure this type of table access 20.12.2020 01:34, Ingo Schwarze пишет: Hi Maksim & Edgar, Edgar Pettijohn wrote on Sat, Dec 19, 2020 at 03:37:22PM -0600: On Sat, Dec 19, 2020 at 08:02:19PM +0300, ?? wrote: Where can I find any manuals and examples regarding OpenSMTPD-extras? Try: $ man -k ^table- $ man table-passwd table-socketmap table-sqlite table-redis Which table types are supported and do not have status "experimental" like ldap tables? E.g. what is opensmtpd-extras-python and how can I use it? Not sure about thise questions. Your best bet is to git clone the repository and search for the tables, etc you are interested in. That would be unusual with OpenBSD; when possible, we try to include documentation in user-installable packages and not only in source distributions. Strangely, in this case, there are files table-postgres.5 table-mysql.5 in the source tarballs but not in the respective packing lists. Strangely, the tarball also contains three empty README files. If there is a manual simply `mandoc file | less`. Not the best advice ever... :-/ Manually piping mandoc(1) output to less(1) is never needed. If you have a manual page in the current directory - say, table-sqlite.5 - then just $ man -l table-sqlite.5 is sufficient, and if it's properly installed, as the opensmtpd-extras package does it, then just $ man table-sqlite does the job without even needing to worry about the current directory. Unfortunantly there aren't manuals for all of the `extras`. Hmm, you may be right about that one, for example a table-python(5) manual page doesn't appear to exist. Yours, Ingo -- С уважением, Родин Максим
Re: OpenSMTPD-extras manual
Hi Maksim & Edgar, Edgar Pettijohn wrote on Sat, Dec 19, 2020 at 03:37:22PM -0600: > On Sat, Dec 19, 2020 at 08:02:19PM +0300, ?? wrote: >> Where can I find any manuals and examples regarding OpenSMTPD-extras? Try: $ man -k ^table- $ man table-passwd table-socketmap table-sqlite table-redis >> Which table types are supported and do not have status "experimental" >> like ldap tables? >> E.g. what is opensmtpd-extras-python and how can I use it? Not sure about thise questions. > Your best bet is to git clone the repository and search for the tables, > etc you are interested in. That would be unusual with OpenBSD; when possible, we try to include documentation in user-installable packages and not only in source distributions. Strangely, in this case, there are files table-postgres.5 table-mysql.5 in the source tarballs but not in the respective packing lists. Strangely, the tarball also contains three empty README files. > If there is a manual simply `mandoc file | less`. Not the best advice ever... :-/ Manually piping mandoc(1) output to less(1) is never needed. If you have a manual page in the current directory - say, table-sqlite.5 - then just $ man -l table-sqlite.5 is sufficient, and if it's properly installed, as the opensmtpd-extras package does it, then just $ man table-sqlite does the job without even needing to worry about the current directory. > Unfortunantly there aren't manuals for all of the `extras`. Hmm, you may be right about that one, for example a table-python(5) manual page doesn't appear to exist. Yours, Ingo
Re: OpenSMTPD-extras manual
On Sat, 2020-12-19 at 15:37 -0600, Edgar Pettijohn wrote: > On Sat, Dec 19, 2020 at 08:02:19PM +0300, ?? wrote: > > Hello. > > Where can I find any manuals and examples regarding OpenSMTPD-extras? > > Which table types are supported and do not have status "experimental" > > like ldap tables? > > E.g. what is opensmtpd-extras-python and how can I use it? > > -- > > Best regards > > Maksim Rodin > > > > Your best bet is to git clone the repository and search for the tables, > etc you are interested in. If there is a manual simply `mandoc file | less`. > > Unfortunantly there aren't manuals for all of the `extras`. > > Good luck, > > Edgar > I don't play around too much with opensmtpd-extras and I don't do python, but minor unrelated hint: mandoc -l will spawn less for you and will include the tags-file. martijn@
Re: OpenSMTPD-extras manual
On Sat, Dec 19, 2020 at 08:02:19PM +0300, ?? wrote: > Hello. > Where can I find any manuals and examples regarding OpenSMTPD-extras? > Which table types are supported and do not have status "experimental" > like ldap tables? > E.g. what is opensmtpd-extras-python and how can I use it? > -- > Best regards > Maksim Rodin > Sorry didn't answer the python question. I'm not a python expert, but I suspect that you would write a script similar to the following perl: Obviously untested, just a best guess. #!/usr/bin/env perl use common::sense; our %state = (); sub update { $state{updated} = 1; print STDERR "table perl updated\n"; } sub check { my ($service, $value, $key) = @_; print STDERR "$service: $value: $key\n"; } sub lookup { my ($service, $value, $key) = @_; print STDERR "$service: $value: $key\n"; return "test"; } sub fetch { my ($service, $value) = @_; print STDERR "$service: $value\n"; return "test"; } Then in smtpd.conf have something like: table test python:/path/to/python/script.py action "some_action" maildir alias
Re: OpenSMTPD-extras manual
On Sat, Dec 19, 2020 at 08:02:19PM +0300, ?? wrote: > Hello. > Where can I find any manuals and examples regarding OpenSMTPD-extras? > Which table types are supported and do not have status "experimental" > like ldap tables? > E.g. what is opensmtpd-extras-python and how can I use it? > -- > Best regards > Maksim Rodin > Your best bet is to git clone the repository and search for the tables, etc you are interested in. If there is a manual simply `mandoc file | less`. Unfortunantly there aren't manuals for all of the `extras`. Good luck, Edgar
OpenSMTPD-extras manual
Hello. Where can I find any manuals and examples regarding OpenSMTPD-extras? Which table types are supported and do not have status "experimental" like ldap tables? E.g. what is opensmtpd-extras-python and how can I use it? -- Best regards Maksim Rodin