map / class lookup from milter

map / class lookup from milter

am 18.04.2008 14:04:44 von pwadas

Hello,

Anybody knows mimedefang allows sendmail class / map lookup from
inside
filter ? I've read Sendmail::Milter documentation, but I'd like to
avoid
writing my own milter from scratch, I guess if it's possible with
mimedefang,
somebody heard about it :)
Regards,
PW.

Re: map / class lookup from milter

am 18.04.2008 22:23:24 von pwadas

Well, after some research, it seems there's no way
to lookup into sendmail internal data from inside
any milter, including mimedefang.
It's possible to pass some sendmail macro to
milter, anyway I guess it's only one-variable macro lile {mail_host},
or {auth_name}, not class macro contents.
There's also a sendmail socket map mentioned in mimedefang
documentation, anyway it just means that a milter program
can do the same lookup as sendmail does, so it's not the
solution I look for - the purpose of it was to USE class macro
content, from inside milter, e.g. to check whether
sender or recipient email address is in VirtHost or w class,
to avoid unnecessary lookups :/

In Sendmail::Pmilter (?) (alternative to Sendmail::Milter) there's a
function get_sendmail_class, anyway it just looks into sendmail.cf
and does lookup the same way sendmail does.

I'm going to check sendmail control socket functionality,
but I don't expect to find such functionality, AFAIK sendmail
control socket has very limited functionality.

P.

Re: map / class lookup from milter

am 18.04.2008 22:27:48 von Andrzej Filip

DT wrote:
> Well, after some research, it seems there's no way
> to lookup into sendmail internal data from inside
> any milter, including mimedefang.

# for hash/btree lookups in MIMEDefang
use DB_File;

> [...]

--
[pl>en Andrew] Andrzej Adam Filip : anfi@priv.onet.pl : anfi@xl.wp.pl
"With molasses you catch flies, with vinegar you catch nobody."
-- Baltimore City Councilman Dominic DiPietro
----
http://groups.google.com/groups/profile?user=anfi@onet.eu
http://groups.google.com/groups?selm=7da9uei778@gail.fsf.hob by-site.com

Re: map / class lookup from milter

am 19.04.2008 02:06:54 von pwadas

On Apr 18, 10:27 pm, Andrzej Adam Filip wrote:
> DT wrote:
> > Well, after some research, it seems there's no way
> > to lookup into sendmail internal data from inside
> > any milter, including mimedefang.
>
> # for hash/btree lookups in MIMEDefang
> use DB_File;
>

The point is, that I want just check whether particular
recipient is in {w} or {VirtualHost}, and avoid doing dedicated
lookup to original database from milter, because,
conceptually, sendmail already have read the whole class, and stores
it somewhere while running,
extracting / passing it to milter would be ideal solution, in compare
with doing lookup to hash db file from milter program.
All classess ({VirtHost}, {M}, {G} etc. and all maps in my
installation are stored in LDAP anyway, I don't use hash DB at all.
With maps, a lookup from milter isn't so big deal, as sendmail
anyway looks up into map somewhat "per request", e.g. per email,
map is not stored in instance memory, but asked each time when
needed, but class, as you probably know ;-), is read once
per reload (smcontrol reload is required to reread class content).
P.

Re: map / class lookup from milter

am 22.04.2008 02:47:04 von pwadas

Well, finally unsuccessful, anyway I found out many
other interesting things about milters :)
What to say, IMHO it would be really useful
feature to extend sendmail control socket functionality,
to be able to return some internal lookup result, like
map lookup or class contents check. Even if not
the whole class contents, but at least result
of class contents check.

But for now, there's no way to get information from sendmail,
nor to pass class contents to milter in opposite way,
milter does great job manipulating messages, but
it cannot request or be granted such valuable information
like class contents. Only some one-value sendmail
macros values can be passed to milter, when
available at some particular phase of message processing,
but class, although available continously in sendmail,
cannot be passed. One has to do lookup from milter
into the same db sendmail uses from his internals.

Probably the second most sad thing about sendmail
in the last twelve years, the first one was, that it's not
possible to point different x509 certificates/keys for different
daemons / addresses of sendmail instance.

FYI :)

Regards,

DT

Re: map / class lookup from milter

am 22.04.2008 04:08:43 von DFS

DT wrote:

> But for now, there's no way to get information from sendmail,
> nor to pass class contents to milter in opposite way,
> milter does great job manipulating messages, but
> it cannot request or be granted such valuable information
> like class contents.

Not directly, but you could write rules that do whatever lookup
the milter would have done and then set a macro. Macros can be
passed to Milter (as you noted.)

Regards,

David.

Re: different x509 certificates/keys

am 22.04.2008 04:34:07 von ca+sendmail(-no-copies-please)

DT wrote:

> Probably the second most sad thing about sendmail
> in the last twelve years, the first one was, that it's not
> possible to point different x509 certificates/keys for different
> daemons / addresses of sendmail instance.

Run different instances. Problem solved.

Re: different x509 certificates/keys

am 23.04.2008 06:20:55 von pwadas

On 22 Kwi, 04:34, Claus AƟmann please)@mine.informatik.uni-kiel.de> wrote:
> DT wrote:
> > Probably the second most sad thing about sendmail
> > in the last twelve years, the first one was, that it's not
> > possible to point different x509 certificates/keys for different
> > daemons / addresses of sendmail instance.
>
> Run different instances. Problem solved.

Well, I didn't say I didn't manage it, somehow ;-)
Anyway, it was disappointment :)

:)