Hello,
I'm having an issue with a simple sendmail setup, emails aliases on the form
user: remoteuser@[a.b.c.d]
are not sending the email directly to [a.b.c.d], but are always using the smart host defined in sendmail.mc
I have a mailertable with just one domain, directing all emails to our old server, that them process them directly or forwards them to other hosts.
localdomain.com relay:[192.168.254.121]
This is working fine.
And them a virtualusertable with the usernames I want to process locally;
user@domain.com localuser
The ideia behind this was to move all users from the old server to the
new one, starting with the most used ones... as this is an older
server not everything is well documented and we would like to keep
things working...
With local delivery to local users, it's working fine. But forwarding
to other servers, I have the same issues as using the local
/etc/aliases file, it always use the smarthost.
Anybody has an ideia why is this happening ? What do I need to change so I can redirect emails directly to other hosts, bypassing the smarthost ?
This is on RHEL8, using sendmail 8.15
My redacted sendmail.mc is the following :
[root@mail02 mail]# egrep -v "^dnl" sendmail.mc
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`confLOG_LEVEL', `19')dnl
define(`SMART_HOST', `sh.domain.com')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl
define(`confAUTH_REALM', `mail')dnl
define(`confCACERT_PATH', `/etc/mail/certs')dnl
define(`confCACERT', `/etc/mail/certs/CA.pem')dnl define(`confTLS_SRV_OPTIONS', `V')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa', `dnl')dnl
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl VIRTUSER_DOMAIN(`localdomain.com')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
define(`LUSER_RELAY',`local:bouncedemail')
FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
FEATURE(`accept_unresolvable_domains')dnl LOCAL_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(`localdomain.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
Access file is
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:192.168.1.121 RELAY
Connect:172 RELAY
Connect:10.235 RELAY
Connect:10.236 RELAY
Connect:10.237 RELAY
Connect:localdomain.com RELAY
10.235.200.184 RELAY
Francisco Amaro <fam...@gmail.com> wrote:
Hello,
I'm having an issue with a simple sendmail setup, emails aliases on the form
user: remoteuser@[a.b.c.d]
are not sending the email directly to [a.b.c.d], but are always using the smart host defined in sendmail.mc
I have a mailertable with just one domain, directing all emails to our old server, that them process them directly or forwards them to other hosts.
localdomain.com relay:[192.168.254.121]
This is working fine.
And them a virtualusertable with the usernames I want to process locally;
us...@domain.com localuser
The ideia behind this was to move all users from the old server to the
new one, starting with the most used ones... as this is an older
server not everything is well documented and we would like to keep
things working...
With local delivery to local users, it's working fine. But forwarding
to other servers, I have the same issues as using the local
/etc/aliases file, it always use the smarthost.
Anybody has an ideia why is this happening ? What do I need to change so I can redirect emails directly to other hosts, bypassing the smarthost ?
This is on RHEL8, using sendmail 8.15
My redacted sendmail.mc is the following :
[root@mail02 mail]# egrep -v "^dnl" sendmail.mc
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`confLOG_LEVEL', `19')dnl
define(`SMART_HOST', `sh.domain.com')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl define(`confDONT_PROBE_INTERFACES', `True')dnl define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl
define(`confAUTH_REALM', `mail')dnl
define(`confCACERT_PATH', `/etc/mail/certs')dnl
define(`confCACERT', `/etc/mail/certs/CA.pem')dnl define(`confTLS_SRV_OPTIONS', `V')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa', `dnl')dnl
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl VIRTUSER_DOMAIN(`localdomain.com')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
define(`LUSER_RELAY',`local:bouncedemail')
FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
FEATURE(`accept_unresolvable_domains')dnl LOCAL_DOMAIN(`localhost.localdomain')dnl MASQUERADE_AS(`localdomain.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
Access file is
Connect:localhost.localdomain RELAY1, You can use mailertable to exclude some non local destination from relaying via smart host. It seems that mailertable is not consulted for
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:192.168.1.121 RELAY
Connect:172 RELAY
Connect:10.235 RELAY
Connect:10.236 RELAY
Connect:10.237 RELAY
Connect:localdomain.com RELAY
10.235.200.184 RELAY
"ip domains" ([a.b.c.d]
2. My classic suggestion is to use organization domain name
(example.com) and per host domain names (oldhost.example.com, newhost.example.com).
On oldhost use mailertable to exclude newhost.example.com from smart
host routing. It should make aliases and virtusertable work with
"per host" (sub) domain names.
In case of problem use the following email routing test commands.
Each further stage stage adds extra dignostics
sendmail -bv John...@some.domain
# test map lookupss including mailertable lookups
sendmail -d60.5 John...@some.domain
# test also rewriting rules (no aliases)
echo '3,0 John...@some.domain" | sendmail -bt -d60.5 -d21.12
--
[Andrew] Andrzej A. Filip
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 149:07:38 |
Calls: | 10,383 |
Calls today: | 8 |
Files: | 14,054 |
D/L today: |
2 files (1,861K bytes) |
Messages: | 6,417,763 |