From: norishen on
Hi,

I need to use the option "bounce_template_file", (in postfix-2.3.3-2),
but it does not work :(

I have a very simple configuration, (I am testing,
postfix+amavis-new+spamassasin).

--------- main.cf ----------------------------------------------------
mydestination = $myhostname
mynetworks = 127.0.0.0/8 192.168.250.0/24
content_filter = smtp-amavis:[127.0.0.1]:10024

transport_maps = hash:/etc/postfix/transport
relay_domains = hash:/etc/postfix/relay_domains
relay_recipient_maps = hash:/etc/postfix/recipient_access

bounce_template_file = /etc/postfix/bounce.cf
--------------------------------------------------------------------------

The valicacion of the known recipients, works very well.

-------------------------- maillog
---------------------------------------
Oct 23 13:33:53 smtp0 postfix/smtpd[3267]: connect from
localhost.localdomain[127.0.0.1]
Oct 23 13:33:53 smtp0 postfix/smtpd[3267]: E93168E9D0:
client=localhost.localdomain[127.0.0.1]
Oct 23 13:33:54 smtp0 postfix/cleanup[3260]: E93168E9D0:
message-id=<BAY126-F31AC9E05BCAB978D5E8F4EC5000(a)phx.gbl>
Oct 23 13:33:54 smtp0 postfix/qmgr[3261]: E93168E9D0:
from=<myadr(a)hotmail.com>, size=1686, nrcpt=1 (queue active)
Oct 23 13:33:54 smtp0 postfix/smtpd[3267]: disconnect from
localhost.localdomain[127.0.0.1]
Oct 23 13:33:54 smtp0 amavis[3081]: (03081-01) FWD via SMTP:
<myadr(a)hotmail.com> -> <pepo(a)my.domain.com>, BODY=8BITMIME 250 2.6.0
Ok, id=03081-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as
E93168E9D0
Oct 23 13:33:54 smtp0 amavis[3081]: (03081-01) Passed CLEAN,
[65.55.131.123] <myadr(a)hotmail.com> -> <pepo(a)my.domain.com>,
Message-ID: <BAY126-F31AC9E05BCAB978D5E8F4EC5000(a)phx.gbl>, mail_id:
omYmt4SSLyhh, Hits: 1.952, queued_as: E93168E9D0, 7491 ms
Oct 23 13:33:54 smtp0 amavis[3081]: (03081-01) TIMING [total 7505 ms] -
SMTP EHLO: 19 (0%)0, SMTP pre-MAIL: 1 (0%)0, mkdir tempdir: 2 (0%)0,
create email.txt: 2 (0%)0, SMTP pre-DATA-flush: 11 (0%)0, SMTP DATA: 34
(0%)1, body_digest: 6 (0%)1, gen_mail_id: 2 (0%)1, mkdir parts: 2
(0%)1, mime_decode: 40 (1%)2, get-file-type1: 22 (0%)2, parts_decode: 1
(0%)2, AV-scan-1: 22 (0%)2, spam-wb-list: 8 (0%)2, SA msg read: 2
(0%)2, SA parse: 9 (0%)2, SA check: 7103 (95%)97, SA finish: 11 (0%)97,
update_cache: 5 (0%)97, decide_mail_destiny: 3 (0%)97, fwd-connect: 47
(1%)98, fwd-mail-from: 4 (0%)98, fwd-rcpt-to: 6 (0%)98, fwd-data-cmd: 2
(0%)98, write-header: 4 (0%)98, fwd-data-contents: 2 (0%)98,
fwd-data-end: 72 (1%)99, fwd-rundown: 12 (0%)99, prepare-dsn: 3 (0%)99,
main_log_entry: 43 (1%)100, update_snmp: 4 (0%)100, unlink-1-files: 3
(0%)100, rundown: 1 (0%)100
Oct 23 13:33:54 smtp0 postfix/smtp[3262]: 1CC5D8E9CA:
to=<pepo(a)ti.aeasa.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=8.2,
delays=0.67/0.02/0.03/7.5, dsn=2.6.0, status=sent (250 2.6.0 Ok,
id=03081-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as
E93168E9D0)
Oct 23 13:33:54 smtp0 postfix/smtp[3268]: E93168E9D0:
to=<pepo(a)my.domain.com>, relay=10.1.2.48[10.1.2.48]:25, delay=0.33,
delays=0.08/0.09/0/0.14, dsn=2.6.0, status=sent (250 2.6.0
<BAY126-F31AC9E05BCAB978D5E8F4EC5000(a)phx.gbl> Queued mail for delivery)
Oct 23 13:33:54 smtp0 postfix/qmgr[3261]: E93168E9D0: removed
-------------------------------------------------------------

but for unknown recipients... it does not send a mail to the origin,
(bounce_template_file, ¿...?), simply it rejects it. (550)

----------------- maillog ---------------------------------------------
Oct 23 13:30:21 smtp0 postfix/smtpd[3213]: connect from
bay0-omc1-s4.bay0.hotmail.com[65.54.246.76]
Oct 23 13:30:22 smtp0 postfix/smtpd[3213]: NOQUEUE: reject: RCPT from
bay0-omc1-s4.bay0.hotmail.com[65.54.246.76]: 550 5.1.1
<pepo(a)my.domain.com>: Recipient address rejected: User unknown in relay
recipient table; from=<mydirr(a)hotmail.com> to=<pepo(a)my.donain.com>
proto=ESMTP helo=<bay0-omc1-s4.bay0.hotmail.com>
Oct 23 13:30:22 smtp0 postfix/smtpd[3213]: disconnect from
bay0-omc1-s4.bay0.hotmail.com[65.54.246.76]
--------------------------------------------------------------------------

this configuration is O.K, for this pourpouse?

thx, and best regards,

norishen

From: Greg Hackney on
norishen wrote:

> I need to use the option "bounce_template_file", (in postfix-2.3.3-2),
> but it does not work :(

> for unknown recipients... it does not send a mail to the origin,
> (bounce_template_file, ¿...?), simply it rejects it. (550)


As I understand it, the failure template in the bounce_template_file
is not used for incoming SMTP, but for outgoing SMTP. If the mail
that's queued for an outbound remote destination fails, it's returned
using the template format.

This description is located in the default template file:

# The failure template is used when mail is returned to the sender;
# either the destination rejected the message, or the destination
# could not be reached before the message expired in the queue.

You should be able to test it by sending an email to an invalid recipient
address at a working domain name.
--
Greg