Discussion:
PostMaster.pl as postfix transport
(too old to reply)
Raphaël 'SurcouF' Bordet
2004-12-22 16:43:58 UTC
Permalink
H,

I'm using postfix and cyrus-imapd on a rhel 3 and I would like to
create a transport for otrs instead of using POP3.
I can't use procmail because I'm using cyrus and sieve doesn't support
pipe to command. As I read in documentation[1], PostMaster.pl recevied
mail from standart input (like it's done with procmail configuration).
I've set this following transport in postfix configuration file:

--( /etc/postfix/master.cf )--
# OTRS
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl
--8<--

I've tried both transport_maps and virtual_transport_maps directives
but I'm using a external ldap database to store users and virtual have
the precedence on transport, according to "big picture"[2] of postfix...

--( /etc/postfix/main.cf )--
virtual_mailbox_maps =3D ldap:demat
virtual_alias_maps =3D ldap:demat
virtual_transport_maps =3D hash:/etc/postfix/transport
--8<--

--( /etc/postfix/transport )--
support@* otrs:
--8<--

How can I set otrs as a transport for postfix in this case ?

Regards,

[1]: http://doc.otrs.org/1.3/en/html/receiving-email-cmd.html#AEN642
[2]: http://www.postfix.org/big-picture.html
--=20
Rapha=EBl 'SurcouF' Bordet
http://debianfr.net/ | surcouf at debianfr dot net
Wietse Venema
2004-12-22 17:25:16 UTC
Permalink
Rapha=EBl 'SurcouF' Bordet:
[ Charset ISO-8859-1 unsupported, converting... ]
Post by Raphaël 'SurcouF' Bordet
H,
=20
I'm using postfix and cyrus-imapd on a rhel 3 and I would like to
create a transport for otrs instead of using POP3.
I can't use procmail because I'm using cyrus and sieve doesn't support
pipe to command. As I read in documentation[1], PostMaster.pl recevied
mail from standart input (like it's done with procmail configuration).
=20
--( /etc/postfix/master.cf )--
# OTRS
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl
--8<--
=20
I've tried both transport_maps and virtual_transport_maps directives
but I'm using a external ldap database to store users and virtual have
the precedence on transport, according to "big picture"[2] of postfix..=
.
Post by Raphaël 'SurcouF' Bordet
=20
--( /etc/postfix/main.cf )--
virtual_mailbox_maps =3D ldap:demat
virtual_alias_maps =3D ldap:demat
virtual_transport_maps =3D hash:/etc/postfix/transport
--8<--
Where does the documentation describe virtual_transport_maps?
There is no such thing in Postfix.=20

Use transport_maps instead, or use virtual_transport.
Post by Raphaël 'SurcouF' Bordet
--( /etc/postfix/transport )--
--8<--
Where does the documentation say you can use username@* in
transport maps?
Post by Raphaël 'SurcouF' Bordet
How can I set otrs as a transport for postfix in this case ?
By reading the documentation more accurately.

Wietse
Victor Duchovni
2004-12-22 17:35:43 UTC
Permalink
Post by Raphaël 'SurcouF' Bordet
# OTRS
otrs unix - n n - - pipe
user=otrs argv=/opt/otrs/bin/PostMaster.pl
This is wrong, you have lost the message envelope sender and
recipient. It is a crime to deliver to header recipients, don't
get caught doing it! :-)
--
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:***@postfix.org?body=unsubscribe%20postfix-users>
Raphaël 'SurcouF' Bordet
2004-12-22 20:29:05 UTC
Permalink
Le mercredi 22 d=C3=A9cembre 2004 =C3=A0 12:35 -0500, Victor Duchovni a =C3=
On Wed, Dec 22, 2004 at 05:43:01PM +0100, Rapha?l 'SurcouF' Bordet wrot=
=20
Post by Raphaël 'SurcouF' Bordet
# OTRS
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl
=20
This is wrong, you have lost the message envelope sender and
recipient. It is a crime to deliver to header recipients, don't
get caught doing it! :-)
For testing PostMaster.pl, documentation tell to do this test:

# cat /opt/otrs/doc/test-email-1.box | /opt/otrs/bin/PostMaster.pl

And it's works perfectly. In test-email-A.box, this content:

--(/opt/otrs/doc/test-email-1.box )--
Return-Path: <***@otrs.org>
Received: (from ***@localhost)
by avro.de (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f3MMSE303694
for ***@localhost; Fri, 21 Dec 2001 23:59:24 +0200
Date: Fri, 21 Dec 2001 23:59:24 +0200
From: System Tester I <***@otrs.org>
To: ***@otrs.org
Subject: test 1
Message-ID: <***@avro>
Mime-Version: 1.0
Content-Type: text/plain; charset=3Dus-ascii
Content-Disposition: inline
X-Operating-System: Linux 2.4.10-4GB i686
X-Uptime: 12:23am up 5:19, 6 users, load average: 0.11, 0.13, 0.18
X-CVS: $Id: test-email-1.box,v 1.1 2001/12/27 14:28:58 martin Exp $
Content-Length: 139
Lines: 11

This is the first test.

Adios ...

Little "Skywalker"

--
System Tester I - <***@otrs.org>
--
Old programmers never die. They just branch to a new address.
---8<---

Regards,

--=20
Rapha=C3=ABl 'SurcouF' Bordet
http://debianfr.net/ | surcouf at debianfr dot net
Wietse Venema
2004-12-22 20:32:24 UTC
Permalink
Rapha=EBl 'SurcouF' Bordet:
[ Charset UTF-8 unsupported, converting... ]
Post by Raphaël 'SurcouF' Bordet
On Wed, Dec 22, 2004 at 05:43:01PM +0100, Rapha?l 'SurcouF' Bordet wr=
=20
Post by Raphaël 'SurcouF' Bordet
# OTRS
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl
=20
This is wrong, you have lost the message envelope sender and
recipient. It is a crime to deliver to header recipients, don't
get caught doing it! :-)
=20
=20
# cat /opt/otrs/doc/test-email-1.box | /opt/otrs/bin/PostMaster.pl
=20
=20
--(/opt/otrs/doc/test-email-1.box )--
It is wrong, because it takes recipient from the mail headers.

Every few days or so there is an incompetent mail setup that delivers
postfix-users mail to the addresses in the message headers, and
when I find out about it, I silently terminate the trespasser's
subscription.

Wietse
Raphaël 'SurcouF' Bordet
2004-12-22 21:19:50 UTC
Permalink
Le mercredi 22 d=C3=A9cembre 2004 =C3=A0 12:24 -0500, Wietse Venema a =C3=
Post by Wietse Venema
[ Charset ISO-8859-1 unsupported, converting... ]
Post by Raphaël 'SurcouF' Bordet
H,
=20
I'm using postfix and cyrus-imapd on a rhel 3 and I would like to
create a transport for otrs instead of using POP3.
I can't use procmail because I'm using cyrus and sieve doesn't suppor=
t
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
pipe to command. As I read in documentation[1], PostMaster.pl recevie=
d
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
mail from standart input (like it's done with procmail configuration)=
.
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
=20
--( /etc/postfix/master.cf )--
# OTRS
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl
--8<--
=20
I've tried both transport_maps and virtual_transport_maps directives
but I'm using a external ldap database to store users and virtual hav=
e
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
the precedence on transport, according to "big picture"[2] of postfix=
...
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
=20
--( /etc/postfix/main.cf )--
virtual_mailbox_maps =3D ldap:demat
virtual_alias_maps =3D ldap:demat
virtual_transport_maps =3D hash:/etc/postfix/transport
--8<--
=20
Where does the documentation describe virtual_transport_maps?
There is no such thing in Postfix.=20
=20
Use transport_maps instead, or use virtual_transport.
As I said, I've already tried transport_maps unsuccessfully.=20
I'm asking if mail aren't delivered to virtual before transport can do
anything...

--=20
Rapha=C3=ABl 'SurcouF' Bordet
http://debianfr.net/ | surcouf at debianfr dot net
Wietse Venema
2004-12-22 21:32:35 UTC
Permalink
Rapha=EBl 'SurcouF' Bordet:
[ Charset UTF-8 unsupported, converting... ]
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
[ Charset ISO-8859-1 unsupported, converting... ]
Post by Raphaël 'SurcouF' Bordet
H,
=20
I'm using postfix and cyrus-imapd on a rhel 3 and I would like to
create a transport for otrs instead of using POP3.
I can't use procmail because I'm using cyrus and sieve doesn't supp=
ort
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
pipe to command. As I read in documentation[1], PostMaster.pl recev=
ied
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
mail from standart input (like it's done with procmail configuratio=
n).
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
=20
--( /etc/postfix/master.cf )--
# OTRS
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl
--8<--
=20
I've tried both transport_maps and virtual_transport_maps directive=
s
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
but I'm using a external ldap database to store users and virtual h=
ave
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
the precedence on transport, according to "big picture"[2] of postf=
ix...
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
=20
--( /etc/postfix/main.cf )--
virtual_mailbox_maps =3D ldap:demat
virtual_alias_maps =3D ldap:demat
virtual_transport_maps =3D hash:/etc/postfix/transport
--8<--
=20
Where does the documentation describe virtual_transport_maps?
There is no such thing in Postfix.=20
=20
Use transport_maps instead, or use virtual_transport.
=20
As I said, I've already tried transport_maps unsuccessfully.=20
You have not given sufficient information so that the people on
this list can tell you what mistake you made.

Wietse
Matt
2004-12-22 21:39:24 UTC
Permalink
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Where does the documentation describe virtual_transport_maps?
There is no such thing in Postfix.=20
=20
Use transport_maps instead, or use virtual_transport.
=20
As I said, I've already tried transport_maps unsuccessfully.=20
I'm asking if mail aren't delivered to virtual before transport can do
anything...
Reading through your previous posts, one would have to say that if you
could describe your requirements in an understandable fashion, you may
solicit some helpful responses.
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl
Also, as has already been pointed out, the above ***IS WRONG***. It
should be using the form of:

otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl -- ${recipient}

The existing way the script is working is going to end up annoying
someone.


Matt
Robert L Mathews
2004-12-22 23:17:14 UTC
Permalink
Post by Raphaël 'SurcouF' Bordet
I'm using postfix and cyrus-imapd on a rhel 3 and I would like to
create a transport for otrs instead of using POP3.
Yes, I do this.

Although I don't use ldap, here is a simplified example of my=20
configuration (with my domain name replaced with "example.com"), which=20
may help point you in the right direction.

It defines a transport for otrs.example.com, then uses a virtual map=20
entry to ensure that mail arriving for ***@example.com will be=20
re-addressed to ***@otrs.example.com; postfix takes care of the rest.


-- /etc/postfix/master.cf:

otrs unix - n n - 1 pipe
flags=3DR
user=3Dotrs
argv=3D/path/to/PostMaster.pl -q ${mailbox}


-- /etc/postfix/main.cf:

otrs_destination_recipient_limit =3D 1


-- /etc/postfix/transport:

otrs.example.com otrs:


-- /etc/postfix/virtual:

***@example.com ***@otrs.example.com, ....


--=20
Robert L Mathews, Tiger Technologies http://www.tigertech.net/
Robert L Mathews
2004-12-22 23:39:25 UTC
Permalink
Post by Wietse Venema
It is wrong, because it takes recipient from the mail headers.
Every few days or so there is an incompetent mail setup that delivers
postfix-users mail to the addresses in the message headers, and
when I find out about it, I silently terminate the trespasser's
subscription.
Although this is a wise warning for piped mail delivery in general, the
script the OP is using just writes the source of the message to a
database and a file on disk. It doesn't perform any further delivery
based on header destinations (or envelope destination, for that matter),
so this particular piped script won't cause that problem.
--
Robert L Mathews, Tiger Technologies http://www.tigertech.net/
Raphaël 'SurcouF' Bordet
2004-12-22 23:41:26 UTC
Permalink
Post by Matt
=20
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Where does the documentation describe virtual_transport_maps?
There is no such thing in Postfix.=20
=20
Use transport_maps instead, or use virtual_transport.
=20
As I said, I've already tried transport_maps unsuccessfully.=20
I'm asking if mail aren't delivered to virtual before transport can d=
o
Post by Matt
Post by Raphaël 'SurcouF' Bordet
anything...
=20
=20
Reading through your previous posts, one would have to say that if you
could describe your requirements in an understandable fashion, you may
solicit some helpful responses.
=20
=20
Post by Raphaël 'SurcouF' Bordet
Post by Wietse Venema
Post by Raphaël 'SurcouF' Bordet
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl
=20
=20
Also, as has already been pointed out, the above ***IS WRONG***. It
=20
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl -- ${recipient}
=20
The existing way the script is working is going to end up annoying
someone.
I've understand this setting is wrong.
I've set otrs's transport definition, according to usage of
PostMaster.pl script to this:

--( /etc/postfix/master.cf )--
otrs unix - n n - - pipe
user=3Dotrs argv=3D/opt/otrs/bin/PostMaster.pl -q ${user} -t postfix
---8<---

--( /etc/postfix/main.cf )--
transport_maps =3D hash:/etc/postfix/transport
---8<---

--( /etc/postfix/transport )--
/^***@e-demat-mp.fr$/ otrs:
---8<---

And doing an postmap /etc/postfix/transport.

I've also configured postfix to search aliases, mailbox to an external
ldap database, using virtual_alias_maps and virtual_mailbox_maps
respectively. If I defined ***@e-demat-mp.fr to an object of this
database, the mail is delivered to the appropriate mailbox instead of
the transport I want to defined. If not, I'm getting this error message:

--( /var/log/maillog )--
Dec 22 22:04:47 is1bin01 postfix/smtpd[19549]: DFD0C5AED4:
client=3Ddebianfr.net[62.212.121.156]
Dec 22 22:04:47 is1bin01 postfix/smtpd[19549]: DFD0C5AED4: reject: RCPT
from debianfr.net[62.212.121.156]: 550 <***@e-demat-mp.fr>: User
unknown in virtual alias table; from=3D<***@debianfr.net>
to=3D<***@e-demat-mp.fr> proto=3DESMTP helo=3D<arioch.debianfr.net>
Dec 22 22:04:49 is1bin01 postfix/smtpd[19549]: disconnect from
debianfr.net[62.212.121.156]
---8<---


Regards,

--=20
Rapha=C3=ABl 'SurcouF' Bordet
http://debianfr.net/ | surcouf at debianfr dot net

Loading...