S
S
SlamJam2015-09-10 15:26:53
Email
SlamJam, 2015-09-10 15:26:53

How to handle bounce emails when sent via sendmail in Ubuntu?

Good afternoon!
There is sendmail on the Ubuntu server. Through it, sites on the server send mail. An arbitrary email can be used as a mail sender, for example, [email protected] When a bounce message arrives in response to a letter from the receiving server, it arrives at the sending server, and the latter forwards it to the mailbox specified by the sender, that is, [email protected]
In theory, such a response should arrive on the server and get only to the server administrator. There is another server on CentOS 5, it works there, the settings are identical. On Ubuntu it doesn't work. Therein lies the problem. It is necessary to prohibit the forwarding of such messages anywhere except the administrator.
The maillog logs are slightly different on different systems. There are different ctladdr values ​​for letters. On CentOS, ctladdr=, and on Ubuntu, ctladdr=E-mail, which is registered as the sender. It turns out that the following happens: sendmail sends mail by signing it with the user specified in the From field. In Centos, emails are sent from a system user and the From field does not affect the real sender.
Playing with sendmail configs didn't work. As an experiment, I tried to transfer all the settings from CentOS to Ubuntu, the result is the same. Digging in Google also did not give results.
How can this be overcome and can it be overcome in principle?
PS Sendmail configs below (example.com replaces real server name in configs)
sendmail.mc

define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.14.4-2ubuntu2.1 2013-09-19 22:03:58 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
undefine(`confHOST_STATUS_DIRECTORY')dnl        #DAEMON_HOSTSTATS=
FEATURE(`no_default_msa',`dnl')dnl
define(`confPRIVACY_FLAGS',`authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
FEATURE(`greet_pause', `1000')dnl 1 seconds
FEATURE(`delay_checks', `friend', `n')dnl
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
FEATURE(`redirect')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`allmasquerade')dnl
LOCAL_DOMAIN(`example.com')dnl
MASQUERADE_AS(`example.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MAILER_DEFINITIONS
MAILER(`smtp')dnl
MAILER(`local')dnl

submit.mc
divert(-1)dnl
divert(0)dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: submit.mc, v 8.14.4-2ubuntu2.1 2013-09-19 22:03:58 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-msp')dnl
define(`_USE_CT_FILE_',`1')dnl
define(`confCT_FILE',`/etc/mail/trusted-users')dnl
FEATURE(`use_ct_file')dnl
MASQUERADE_AS(`example.com')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`masquerade_entire_domain')dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
FEATURE(`msp', `[127.0.0.1]', `25')dnl

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question