[SOLVED]Unable to translate bounce.cf messages

sheshman

Member
Jan 16, 2023
54
4
8
Hello,

I'm trying to translate postfix bounce messages to my native language, i've found those similiar posts to help;
https://forum.proxmox.com/threads/how-to-configure-custom-postfix-bounce-messages-pmg-5-1-2.51499/
https://www.howtoforge.com/configure-custom-postfix-bounce-messages
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine
https://forum.proxmox.com/threads/translation-of-the-messages-sent-by-pmg.110180/

as far as i understand that i need to do through templates

so there was no /etc/pmg/templates folder i've created as
Code:
mkdir /etc/pmg/templates
and copied main.cf.in file as below;
Code:
cp /var/lib//pmg//templates/main.cf.in /etc/pmg/templates/main.cf
and changed file's name as template.cf

Created bounce.cf file as /etc/postfix/bounce.cf and included to my template.cf (to the end of the file) as;
Code:
bounce_template_file = /etc/postfix/bounce.cf

restarted bıth sync and postfix services;
Code:
pmgconfig sync --restart 1
service postfix restart

after that nothing changed :) it still uses the default messages, what am i doing wrong?
 
Last edited:
solved :)

Code:
cp /var/lib//pmg//templates/main.cf.in /etc/pmg/templates/main.cf.in

Code:
pico /etc/postfix/bounce.custom.cf

create your bounce file as you desired, for Turkish use as below;
Code:
# 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.
#

failure_template = <<EOF
Charset: us-ascii
From: MAILER-DAEMON (Mail Delivery System)
Subject: Teslim Edilemeyen E-posta Gonderene Geri Dondu
Postmaster-Subject: Postmaster Copy: Undelivered Mail

Bu mesaj $myhostname sunucusundan gonderilmistir.

Uzgunuz, ancak gonderdiginiz e-posta bir veya daha fazla aliciya teslim edilemedi. E-posta iletiniz asagida ekli olarak bulundugundan emin olun.

Daha fazla yardim icin lutfen postmaster ile iletisime gecin.

Eger bunu yaparsaniz, lutfen bu hata raporunu da ekleyin. Eklenen geri donen mesaktaki kendi metninizi silebilirsiniz.

                   The mail system
EOF


#
# The delay template is used when mail is delayed. Note a neat trick:
# the default template displays the delay_warning_time value as hours
# by appending the _hours suffix to the parameter name; it displays
# the maximal_queue_lifetime value as days by appending the _days
# suffix.
#
# Other suffixes are: _seconds, _minutes, _weeks. There are no other
# main.cf parameters that have this special behavior.
#
# You need to adjust these suffixes (and the surrounding text) if
# you have very different settings for these time parameters.
#

delay_template = <<EOF
Charset: us-ascii
From: MAILER-DAEMON (Mail Delivery System)
Subject: Geciken E-posta (hala yeniden deneniyor)
Postmaster-Subject: Postmaster Warning: Delayed Mail

Bu mesaj $myhostname sunucusundan gonderilmistir.

####################################################################

BU SADECE BIR UYARI MESAJIDIR. MESAJINIZI YENIDEN GONDERMENIZE GEREK YOKTUR.
####################################################################

Mesajiniz $delay_warning_time_hours saatten uzun bir sure boyunca teslim edilemedi. Bu mesaj, $maximal_queue_lifetime_days gun sureyle tekrar denenmeye devam edecektir.

Daha fazla yardim icin lutfen postmaster ile iletisime gecin.

Eger bunu yaparsaniz, lutfen bu hata raporunu da ekleyin. Eklenen geri donen mesajdaki kendi metninizi silebilirsiniz.

                   The mail system
EOF


#
# The success template is used when mail is delivered to mailbox,
# when an alias or list is expanded, or when mail is delivered to a
# system that does not announce DSN support. It is an error to specify
# a Postmaster-Subject: here.
#

success_template = <<EOF
Charset: us-ascii
From: MAILER-DAEMON (Mail Delivery System)
Subject: Basarili E-posta Teslimat Raporu

Bu mesaj $myhostname sunucusundan gonderilmistir.

Mesajiniz basariyla asagida listelenen hedef(ler)e teslim edilmistir. Eger mesajiniz posta kutusuna teslim edildiyse, baska bildirim almayacaksiniz. Aksi takdirde, diger sistemlerden e-posta teslimat hatalari hakkinda bildirim almaya devam edebilirsiniz.

                   The mail system
EOF


#
# The verify template is used for address verification (sendmail -bv
# address...). or for verbose mail delivery (sendmail -v address...).
# It is an error to specify a Postmaster-Subject: here.
#

verify_template = <<EOF
Charset: us-ascii
From: MAILER-DAEMON (Mail Delivery System)
Subject: E-posta Teslimat Durumu Raporu

Bu mesaj $myhostname sunucusundan gonderilmistir.

Istediginiz e-posta teslimat raporu ekte sunulmustur.

                   The mail system
EOF

Code:
pico /etc/pmg/templates/main.cf.in

add this end of the file : bounce_template_file = /etc/postfix/bounce.custom.cf

restart postfix and sync services
Code:
pmgconfig sync --restart 1
service postfix restart
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!