Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with email not being sent when using DISCARD in access file.

133 views
Skip to first unread message

Panic

unread,
Apr 12, 2011, 1:51:33 PM4/12/11
to
I'm having an issue with sendmail. I'm using the access file to allow
only emails sent "To:" specific domains. If email is sent to specific
domains only, everything is fine. Now if I send and email with an
address that will get discarded, the email seems to get discarded even
for the valid addresses. The following is my access config:

Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
To:com DISCARD
To:net DISCARD
To:org DISCARD
To:us DISCARD
To:testdomain.com OK
To:testdomain.net OK
To:testdomain2.com OK

In the mailllog with the above access config in place, I can see the
invalid addresses being discarded, but email to the valid address
never gets send to my smart host. Here is the mail command that I am
executing and the output of my mail session in maillog:

# date | mailx -s "Test from `uname -n`" s...@testdomain.com
k...@verizon.net k...@yahoo.com

Apr 12 12:47:47 testserver sendmail[21280]: p3CGllvp021280: from=root,
size=158, class=0, nrcpts=3,
msgid=<201104121647....@testserver.ny.testdomain.com>,
relay=root@localhost
Apr 12 12:47:47 testserver sendmail[21282]: p3CGllKZ021282:
ruleset=check_rcpt, arg1=<k...@verizon.net>, relay=localhost.localdomain
[127.0.0.1], discard
Apr 12 12:47:47 testserver sendmail[21282]: p3CGllKZ021282:
ruleset=check_rcpt, arg1=<k...@yahoo.com>, relay=localhost.localdomain
[127.0.0.1], discard
Apr 12 12:47:47 testserver sendmail[21282]: p3CGllKZ021282:
from=<ro...@testserver.ny.testdomain.com>, size=446, class=0, nrcpts=3,
msgid=<201104121647....@testserver.ny.testdomain.com>,
proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Apr 12 12:47:47 testserver sendmail[21282]: p3CGllKZ021282: discarded
Apr 12 12:47:47 testserver sendmail[21280]: p3CGllvp021280:
to=s...@testdomain.com,k...@verizon.net,k...@yahoo.com, ctladdr=root (0/0),
delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=90158,
relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p3CGllKZ021282
Message accepted for delivery)

Now if I change the "DISCARD" lines to "REJECT" and regenerate the
access.db files and restart sendmail, and try sending a group email to
users that are valid and invalid, the emails are delivered to the
valid users. Here the tracking of the email when using "REJECT":


Apr 12 13:37:07 testserver sendmail[24132]: p3CHb0AP024132: from=root,
size=158, class=0, nrcpts=3,
msgid=<201104121737....@testserver.ny.testdomain.com>,
relay=root@localhost
Apr 12 13:37:09 testserver sendmail[24135]: p3CHb7k4024135:
ruleset=check_rcpt, arg1=<k...@verizon.net>, relay=localhost.localdomain
[127.0.0.1], reject=550 5.2.1 <k...@verizon.net>... Mailbox disabled for
this recipient
Apr 12 13:37:09 testserver sendmail[24135]: p3CHb7k4024135:
ruleset=check_rcpt, arg1=<k...@yahoo.com>, relay=localhost.localdomain
[127.0.0.1], reject=550 5.2.1 <k...@yahoo.com>... Mailbox disabled for
this recipient
Apr 12 13:37:09 testserver sendmail[24132]: p3CHb0AP024132:
to=k...@verizon.net, ctladdr=root (0/0), delay=00:00:09,
xdelay=00:00:02, mailer=relay, pri=90158, relay=[127.0.0.1]
[127.0.0.1], dsn=5.2.1, stat=User unknown
Apr 12 13:37:09 testserver sendmail[24132]: p3CHb0AP024132:
to=k...@yahoo.com, ctladdr=root (0/0), delay=00:00:09, xdelay=00:00:02,
mailer=relay, pri=90158, relay=[127.0.0.1] [127.0.0.1], dsn=5.2.1,
stat=User unknown
Apr 12 13:37:09 testserver sendmail[24135]: p3CHb7k4024135:
from=<ro...@testserver.ny.testdomain.com>, size=446, class=0, nrcpts=1,
msgid=<201104121737....@testserver.ny.testdomain.com>,
proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Apr 12 13:37:09 testserver sendmail[24132]: p3CHb0AP024132:
to=s...@testdomain.com, ctladdr=root (0/0), delay=00:00:09,
xdelay=00:00:02, mailer=relay, pri=90158, relay=[127.0.0.1]
[127.0.0.1], dsn=2.0.0, stat=Sent (p3CHb7k4024135 Message accepted for
delivery)
Apr 12 13:37:09 testserver sendmail[24132]: p3CHb0AP024132:
p3CHb0AQ024132: DSN: User unknown
Apr 12 13:37:09 testserver sendmail[24135]: p3CHb7k6024135: from=<>,
size=2783, class=0, nrcpts=1,
msgid=<201104121737....@testserver.ny.testdomain.com>,
proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Apr 12 13:37:09 testserver sendmail[24132]: p3CHb0AQ024132: to=root,
delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31182,
relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p3CHb7k6024135
Message accepted for delivery)
Apr 12 13:37:10 testserver sendmail[24138]: p3CHb7k6024135:
to=s...@testdomain.com, delay=00:00:01, xdelay=00:00:00, mailer=relay,
pri=33010, relay=mailserver02.ny.testdomain.com. [10.10.10.151],
dsn=2.0.0, stat=Sent (p3CHbAvH023824 Message accepted for delivery)
Apr 12 13:37:10 testserver sendmail[24137]: p3CHb7k4024135:
to=<s...@testdomain.com>, ctladdr=<ro...@testserver.ny.testdomain.com>
(0/0), delay=00:00:03, xdelay=00:00:01, mailer=relay, pri=120446,
relay=mailserver01.ny.testdomain.com. [10.10.10.150], dsn=2.0.0,
stat=Sent (p3CHb9QE025030 Message accepted for delivery):

Sendmail sends out a rejection email notification, which in my case is
root, plus the email to s...@testdomain.com receives the email. Why
doesn't sendmail send email to valid users when one of the users is
being discarded? The following is the configuration of my sendmail.mc
file.

divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`SMART_HOST', `mailhost.testdomain.com')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(`relay_hosts_only')dnl
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
MASQUERADE_AS(`testdomain.com')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`masquerade_entire_domain')dnl
MASQUERADE_DOMAIN(`testdomain.com')dnl
GENERICS_DOMAIN(`testdomain.com')dnl
FEATURE(`genericstable')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl


Thank you in advance.

Claus Aßmann

unread,
Apr 12, 2011, 8:27:13 PM4/12/11
to
Panic wrote:
> I'm having an issue with sendmail. I'm using the access file to allow
> only emails sent "To:" specific domains. If email is sent to specific
> domains only, everything is fine. Now if I send and email with an
> address that will get discarded, the email seems to get discarded even
> for the valid addresses. The following is my access config:

Hmm, yes. That's what the fine documentation says (cf/README):

DISCARD Discard the message completely using the
$#discard mailer. If it is used in check_compat,
it affects only the designated recipient, not
the whole message as it does in all other cases.
This should only be used if really necessary.

0 new messages