postfix functional testing

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

postfix functional testing

Илья Шипицин
Hello,

we have pretty complicated setup. when we change something, we can break something else.
however, we can describe "what must work".

is there a way of describing configuration testing like https://openresty.gitbooks.io/programming-openresty/content/testing/test-nginx.html ?

cheers,
Ilya Shipitsin
Reply | Threaded
Open this post in threaded view
|

Re: postfix functional testing

Wietse Venema
???? ???????:
> Hello,
>
> we have pretty complicated setup. when we change something, we can break
> something else.  however, we can describe "what must work".

In the case of email, this is usually tested by sending email and
monitoring one or more destination mailboxes, to determine if the
message is delivered in the expected time and with the expected
content.

> is there a way of describing configuration testing like
> https://openresty.gitbooks.io/programming-openresty/content/testing/test-nginx.html
> ?

SMTP is a store-and-forward protocol, therefore server responses
alone cover only a small part of a complete email transaction.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: postfix functional testing

Илья Шипицин


вт, 2 окт. 2018 г. в 4:24, Wietse Venema <[hidden email]>:
???? ???????:
> Hello,
>
> we have pretty complicated setup. when we change something, we can break
> something else.  however, we can describe "what must work".

In the case of email, this is usually tested by sending email and
monitoring one or more destination mailboxes, to determine if the
message is delivered in the expected time and with the expected
content.

> is there a way of describing configuration testing like
> https://openresty.gitbooks.io/programming-openresty/content/testing/test-nginx.html
> ?

SMTP is a store-and-forward protocol, therefore server responses
alone cover only a small part of a complete email transaction.

I understand that HTTP and SMTP are different (while HTTP borrowed a lot from SMTP, like return status codes).
what I did already is "sendmail -bt" (become test) mode. it allows to test some aspects of smtp rules (not many, mostly address manipulation).

what I would like to test are

1) some IP are allowed to relay, some are not allowed (i'd like to specify several IP addresses and see "relay allowed" or "relay not allowed")
2) some domains should be delivered via LMTP, i.e. locally (I'd like to specify both local and remote addresses and see what happens)
3) DKIM signature is added to certain domains (via milter), I'd like to send test messages and see


well, at least "3)" can be tested via real use letters. not clear how to test "1)" and "2)"

we did break overall config when changed "something". we do not want to break again.
 

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: postfix functional testing

Patrick Ben Koetter-2
* Илья Шипицин <[hidden email]>:

> вт, 2 окт. 2018 г. в 4:24, Wietse Venema <[hidden email]>:
>
> > ???? ???????:
> > > Hello,
> > >
> > > we have pretty complicated setup. when we change something, we can break
> > > something else.  however, we can describe "what must work".
> >
> > In the case of email, this is usually tested by sending email and
> > monitoring one or more destination mailboxes, to determine if the
> > message is delivered in the expected time and with the expected
> > content.
> >
> > > is there a way of describing configuration testing like
> > >
> > https://openresty.gitbooks.io/programming-openresty/content/testing/test-nginx.html
> > > ?
> >
> > SMTP is a store-and-forward protocol, therefore server responses
> > alone cover only a small part of a complete email transaction.
> >
>
> I understand that HTTP and SMTP are different (while HTTP borrowed a lot
> from SMTP, like return status codes).
> what I did already is "sendmail -bt" (become test) mode. it allows to test
> some aspects of smtp rules (not many, mostly address manipulation).
>
> what I would like to test are
>
> 1) some IP are allowed to relay, some are not allowed (i'd like to specify
> several IP addresses and see "relay allowed" or "relay not allowed")
> 2) some domains should be delivered via LMTP, i.e. locally (I'd like to
> specify both local and remote addresses and see what happens)
> 3) DKIM signature is added to certain domains (via milter), I'd like to
> send test messages and see
>
> well, at least "3)" can be tested via real use letters. not clear how to
> test "1)" and "2)"

For 1) and 2) read into XCLIENT. We use it for functional testing all the
time. For 3) send the message to another (local) instance and let it verify,
then parse the log.


p@rick



--
[*] sys4 AG
 
https://sys4.de, +49 (89) 30 90 46 64
Schleißheimer Straße 26/MG,80333 München
 
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer, Wolfgang Stief
Aufsichtsratsvorsitzender: Florian Kirstein
 
Reply | Threaded
Open this post in threaded view
|

Re: postfix functional testing

Илья Шипицин
wow. we do use XCLIENT already.
but I did not consider it for testing purpose.

you made my day :)

вт, 2 окт. 2018 г. в 12:46, Patrick Ben Koetter <[hidden email]>:
* Илья Шипицин <[hidden email]>:
> вт, 2 окт. 2018 г. в 4:24, Wietse Venema <[hidden email]>:
>
> > ???? ???????:
> > > Hello,
> > >
> > > we have pretty complicated setup. when we change something, we can break
> > > something else.  however, we can describe "what must work".
> >
> > In the case of email, this is usually tested by sending email and
> > monitoring one or more destination mailboxes, to determine if the
> > message is delivered in the expected time and with the expected
> > content.
> >
> > > is there a way of describing configuration testing like
> > >
> > https://openresty.gitbooks.io/programming-openresty/content/testing/test-nginx.html
> > > ?
> >
> > SMTP is a store-and-forward protocol, therefore server responses
> > alone cover only a small part of a complete email transaction.
> >
>
> I understand that HTTP and SMTP are different (while HTTP borrowed a lot
> from SMTP, like return status codes).
> what I did already is "sendmail -bt" (become test) mode. it allows to test
> some aspects of smtp rules (not many, mostly address manipulation).
>
> what I would like to test are
>
> 1) some IP are allowed to relay, some are not allowed (i'd like to specify
> several IP addresses and see "relay allowed" or "relay not allowed")
> 2) some domains should be delivered via LMTP, i.e. locally (I'd like to
> specify both local and remote addresses and see what happens)
> 3) DKIM signature is added to certain domains (via milter), I'd like to
> send test messages and see
>
> well, at least "3)" can be tested via real use letters. not clear how to
> test "1)" and "2)"

For 1) and 2) read into XCLIENT. We use it for functional testing all the
time. For 3) send the message to another (local) instance and let it verify,
then parse the log.


p@rick



--
[*] sys4 AG

https://sys4.de, +49 (89) 30 90 46 64
Schleißheimer Straße 26/MG,80333 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer, Wolfgang Stief
Aufsichtsratsvorsitzender: Florian Kirstein

Reply | Threaded
Open this post in threaded view
|

Re: postfix functional testing

Wietse Venema
In reply to this post by Илья Шипицин
???? ???????:

> ??, 2 ???. 2018 ?. ? 4:24, Wietse Venema <[hidden email]>:
>
> > ???? ???????:
> > > Hello,
> > >
> > > we have pretty complicated setup. when we change something, we can break
> > > something else.  however, we can describe "what must work".
> >
> > In the case of email, this is usually tested by sending email and
> > monitoring one or more destination mailboxes, to determine if the
> > message is delivered in the expected time and with the expected
> > content.
> >
> > > is there a way of describing configuration testing like
> > >
> > https://openresty.gitbooks.io/programming-openresty/content/testing/test-nginx.html
> > > ?
> >
> > SMTP is a store-and-forward protocol, therefore server responses
> > alone cover only a small part of a complete email transaction.
> >
>
> I understand that HTTP and SMTP are different (while HTTP borrowed a lot
> from SMTP, like return status codes).
> what I did already is "sendmail -bt" (become test) mode. it allows to test
> some aspects of smtp rules (not many, mostly address manipulation).

Perhaps you mean 'sendmail -bv', as discussed in the example at the
end of ADDRESS_REWRITING_README. Postfix has no 'sendmail -bt' feature.

> what I would like to test are
>
> 1) some IP are allowed to relay, some are not allowed (i'd like to specify
> several IP addresses and see "relay allowed" or "relay not allowed")

That's what Postfix has the XCLIENT feature is for.

> 2) some domains should be delivered via LMTP, i.e. locally (I'd like to
> specify both local and remote addresses and see what happens)

Set up a 'local' and 'remote' mailbox.  Or run the system in a VM
or container, and you have full control over all its network therefore
can simulate any environment.

> 3) DKIM signature is added to certain domains (via milter), I'd like to
> send test messages and see

Set up a mailbox and examine the result...

> well, at least "3)" can be tested via real use letters. not clear how to
> test "1)" and "2)"
>
> we did break overall config when changed "something". we do not want to
> break again.

        Wietse