Forcing a message to bounce

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

Forcing a message to bounce

Jay Deiman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is there any way to force a message in the deferred queue to be
immmediately bounced back to the sender?  I can't find a thing on this
anywhere and it seems like it would be something that people could use
in some situations (in mine, it is a backup MX server).  I've crafted a
way to do it in my head, but it would take a quite a bit of work and
there would be a few outside parts to it and I would prefer something
simpler, if it exists.

Thanks,

Jay Deiman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIUxwZQ0lr+ZVKSBgRAooUAJ9Ewa34HEQSc7qfB+89h/IdMYHD4wCfRJb3
dEETY++7jg1U0rjWU36Vaws=
=fa2m
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a message to bounce

Sahil Tandon
Jay <[hidden email]> wrote:

> Is there any way to force a message in the deferred queue to be
> immmediately bounced back to the sender?  I can't find a thing on this
> anywhere and it seems like it would be something that people could use
> in some situations (in mine, it is a backup MX server).  I've crafted a
> way to do it in my head, but it would take a quite a bit of work and
> there would be a few outside parts to it and I would prefer something
> simpler, if it exists.

This is a FAQ; please search the mailing list archives.

--
Sahil Tandon <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a message to bounce

Jay Deiman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sahil Tandon wrote:
| Jay <[hidden email]> wrote:
|
|> Is there any way to force a message in the deferred queue to be
|> immmediately bounced back to the sender?  I can't find a thing on this
|> anywhere and it seems like it would be something that people could use
|> in some situations (in mine, it is a backup MX server).  I've crafted a
|> way to do it in my head, but it would take a quite a bit of work and
|> there would be a few outside parts to it and I would prefer something
|> simpler, if it exists.
|
| This is a FAQ; please search the mailing list archives.
|
Hmmm, I couldn't seem to find the FAQ you mentioned, but I did find this:

One way to force a specific message to bounce is to add a
header_check to REJECT the Message-Id of that message, then
postfix reload and requeue the message.

as a part of this thread:

http://groups.google.com/group/list.postfix.users/browse_thread/thread/4f66712fa75b0607/a2c30ccc96046b1f?lnk=gst&q=force+a+message+to+bounce#a2c30ccc96046b1f

The above will work well enough for me.  I can automate that without too
much work and it's much simpler than what I originally had planned.

Thanks for the help.

Jay Deiman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIUyw4Q0lr+ZVKSBgRAiMEAKChclHpFM3WnnOkdkrcGqV3A2RD9ACeItlU
t1Fd+ocXVAwZfaw4d4Yv0Dc=
=2/rV
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a message to bounce

Sahil Tandon
Jay Deiman <[hidden email]> wrote:

> Sahil Tandon wrote:
>
> | Jay <[hidden email]> wrote:
> |
> |> Is there any way to force a message in the deferred queue to be
> |> immmediately bounced back to the sender?  I can't find a thing on this
> |> anywhere and it seems like it would be something that people could use
> |> in some situations (in mine, it is a backup MX server).  I've crafted a
> |> way to do it in my head, but it would take a quite a bit of work and
> |> there would be a few outside parts to it and I would prefer something
> |> simpler, if it exists.
> |
> | This is a FAQ; please search the mailing list archives.
> |
> Hmmm, I couldn't seem to find the FAQ you mentioned, but I did find this:

Your question (or a close derivative) is frequently asked on this list; I
wasn't referring to a published list of FAQs.

--
Sahil Tandon <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a message to bounce

Victor Duchovni
On Sat, Jun 14, 2008 at 12:40:49AM -0400, Sahil Tandon wrote:

> Your question (or a close derivative) is frequently asked on this list; I
> wasn't referring to a published list of FAQs.

If manually bouncing specific messages is a vital task, create a 2nd
Postfix instance (config_directory /etc/postfix-bounce) with a queue
directory in the same file-system as the main Postfix instance, whose
"pickup" service in master.cf looks like:

    /etc/postfix-bounce/master.cf:
        # Only wake up once an hour, it is OK for bounces to wait a while
        # if a wakeup trigger is lost.
        pickup    fifo  n       -       n       3600    1       pickup
            -o content_filter=$bounce_pickup_transport

with /etc/postfix-bounce/main.cf:

        bounce_pickup_transport = error:5.0.0 Message undeliverable

If the main Postfix queue directory is /var/spool/postfix, and the
second Postfix queue directory is /var/spool/postfix-bounce, to bounce
a message:

    # qid=01234ABCDE
    # postsuper -h $qid
    # qfile=`find /var/spool/postfix/hold -name $qid -print`
    # bouncelog=`find /var/spool/postfix/defer -name $qid -print`
    # if test -n "$qfile"; then
    test -n "$bouncelog" && rm "$bouncelog"
        mv $qfile /var/spool/postfix-bounce/maildrop
        postkick -c /etc/postfix-bounce public pickup W
      fi

Apart from the non-default master.cf entry and additional main.cf entry,
the two instances should be identical, so that bounces are routed to
the right place.

If this is really so critical a service, a single Postfix instance could
do it with the following code change:

    - Configurable "maildrop" directory enabling multiple pickup(8)
      services in the same Postfix queue.

        pickup    fifo  n       -       n       60      1       pickup
        # Only wake up once an hour, it is OK for bounces to wait a while
        # if a wakeup trigger is lost.
        bounce_pickup fifo n    -       n       3600    1       pickup
            -o maildrop_directory=bouncedrop
            -o content_filter=$bounce_pickup_transport

It may also be possible to use a single "pickup" service, but give
the maildrop file that should be bounced a specially formatted name,
say error.<qid> instead of <qid>. The name format could be hidden with
a suitable "postuper -X <qid>" command doing all the work.

--
        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:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.