Also, verify that you do not have a mailertable entry for address.com
Main Topics
Browse All TopicsGreetings,
Environment:
Two openbsd 4.0 server environment -- main.mail.server in DMZ, another in firewalled LAN. firewall denies SMTP from LAN except to DMZ mail server.
Sendmail 8.13.8 on both servers. No issues sending mails from main DMZ mail server to any address.
I wish to blindly forward all emails sent from LAN server to the main DMZ server which will handle forwarding.
Server names and email addresses have been sanitized, but are correct in my environment.
Added
define(`SMART_HOST', `main.dmz.mailserver')dnl
to the LAN mailserver .mc file, generated cf and kill -HUP sendmail.
testing sending mail outside the network using
user@lan% echo "test" | mail -v -s test external@address.com
and receive the following output:
external@address.com... Connecting to [127.0.0.1] via relay...
220 mail.lan.com ESMTP Sendmail 8.13.8/8.13.8; Mon, 29 Jan 2007 11:10:03 -0500 (EST)
>>> EHLO dmz.server.com
250-mail.lan.com hello localhost.lan.com [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<user@mail.lan.com> SIZE=60
250 2.1.0 <user@mail.lan.com>... Sender ok
>>> RCPT To:<external@address.com>
>>> DATA
250 2.1.5 <external@address.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <external@address.com>... Connecting to
mail.externaladdress.com. via esmtp...
050 <external@address.com>... Deferred: Connection refused by mail.externaladdress.com.
250 2.0.0 l0TGA3vP013035 Message accepted for delivery
external@address.com... Sent (l0TGA3vP013035 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 mail.lan.com closing connection
Apparantly, the mail.lan.com server attempts to deliver the mail directly,
which is forbidden by the firewall. This places the mail in the sendmail
queue:
# sendmail -bp
/var/spool/mqueue (2 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipie
l0TGA0IP016397 5 Mon Jan 29 11:10 <user@mail.lan.com>
(Deferred: Connection refused by mail.externaladdress.com.)
<external@address.com>
When root issues a "sendmail -q" command, the mail is properly forwarded to
the main.dmz.mailserver and is delivered. Where have I gone wrong?
Thanks,
Nick Pelfort
The following is my sendmail.mc file:
divert(0)dnl
OSTYPE(openbsd)dnl
FEATURE(`relay_local_from'
define(`SMART_HOST', `main.dmz.mailserver')dnl
MAILER(smtp)dnl
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
PsiCop
no mailertable entries in /etc/mail/mailertable. To make sure, I re-hashed and HUP'ed sendmail.
Anfi:
1) # grep ^DS /etc/mail/sendmail.cf
DSmain.dmz.mailserver
2) i send HUP signal each time I reconstruct the sendmail.cf file, so that is not the issue.
3) Here is the report you asked for. It appears at the end that it finds the correct relay, but then I'm not exactly sure what I'm looking at below. Advice is greatly appreciated.
# echo '3,0 external@address.com' | sendmail -d21.12 -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> canonify input: external @ address . com
-----trying rule: $@
----- rule fails
-----trying rule: $*
-----rule matches: $: $1 < @ >
rewritten as: external @ address . com < @ >
-----trying rule: $* < $* > $* < @ >
----- rule fails
-----trying rule: @ $* < @ >
----- rule fails
-----trying rule: $* [ IPv6 : $+ ] < @ >
----- rule fails
-----trying rule: $* : : $* < @ >
----- rule fails
-----trying rule: : include : $* < @ >
----- rule fails
-----trying rule: $* : $* [ $* ]
----- rule fails
-----trying rule: $* : $* < @ >
----- rule fails
-----trying rule: $* < @ >
-----rule matches: $: $1
rewritten as: external @ address . com
-----trying rule: $* ;
----- rule fails
-----trying rule: $* < $+ : ; > $*
----- rule fails
-----trying rule: $* < $* ; >
----- rule fails
-----trying rule: $@
----- rule fails
-----trying rule: $*
-----rule matches: $: < $1 >
rewritten as: < external @ address . com >
-----trying rule: $+ < $* >
----- rule fails
-----trying rule: < $* > $+
----- rule fails
-----trying rule: < >
----- rule fails
-----trying rule: < $+ >
-----rule matches: $: $1
rewritten as: external @ address . com
-----trying rule: @ $+ , $+
----- rule fails
-----trying rule: @ [ $* ] : $+
----- rule fails
-----trying rule: @ $+ : $+
----- rule fails
-----trying rule: $+ : $* ; @ $+
----- rule fails
-----trying rule: $+ : $* ;
----- rule fails
-----trying rule: $+ @ $+
-----rule matches: $: $1 < @ $2 >
rewritten as: external < @ address . com >
-----trying rule: $+ < $+ @ $+ >
----- rule fails
-----trying rule: $+ < @ $+ >
-----rule matches: $@ $> Canonify2 $1 < @ $2 >
Canonify2 input: external < @ address . com >
-----trying rule: $* < @ localhost > $*
----- rule fails
-----trying rule: $* < @ localhost . lan . com > $*
----- rule fails
-----trying rule: $* < @ localhost . UUCP > $*
----- rule fails
-----trying rule: $* < @ [ $+ ] > $*
----- rule fails
-----trying rule: $* < @ @ $=w > $*
----- rule fails
-----trying rule: $* < @ @ $+ > $*
----- rule fails
-----trying rule: $* < @ $+ . UUCP > $*
----- rule fails
-----trying rule: $* < @ $+ . . UUCP . > $*
----- rule fails
-----trying rule: $* < @ $* $=P > $*
----- rule fails
-----trying rule: $* < @ $* $~P > $*
-----rule matches: $: $&{daemon_flags} $| $1 < @ $2 $3 > $4
rewrite: RHS $&{daemon_flags} => "(NULL)"
rewritten as: $| external < @ address . com >
-----trying rule: $* CC $* $| $* < @ $+ . $+ > $*
----- rule fails
-----trying rule: $* CC $* $| $*
----- rule fails
-----trying rule: $* $| $* < @ $* > $*
-----rule matches: $: $2 < @ $[ $3 $] > $4
rewritten as: external < @ address . com . >
-----trying rule: $* $| $*
----- rule fails
-----trying rule: $* < @ $=w > $*
----- rule fails
-----trying rule: $* < @ $=M > $*
----- rule fails
-----trying rule: $* < @ $* . . > $*
----- rule fails
Canonify2 returns: external < @ address . com . >
rewritten as: external < @ address . com . >
canonify returns: external < @ address . com . >
parse input: external < @ address . com . >
-----trying rule: $*
-----rule matches: $: $> Parse0 $1
Parse0 input: external < @ address . com . >
-----trying rule: < @ >
----- rule fails
-----trying rule: $* : $* ; < @ >
----- rule fails
-----trying rule: @ < @ $* >
----- rule fails
-----trying rule: < @ $+ >
----- rule fails
-----trying rule: $+ < @ >
----- rule fails
-----trying rule: $*
-----rule matches: $: < > $1
rewritten as: < > external < @ address . com . >
-----trying rule: < > $* < @ [ $* ] : $+ > $*
----- rule fails
-----trying rule: < > $* < @ [ $* ] , $+ > $*
----- rule fails
-----trying rule: < > $* < @ [ $* ] $+ > $*
----- rule fails
-----trying rule: < > $* < @ [ $+ ] > $*
----- rule fails
-----trying rule: < > $* < $* : $* > $*
----- rule fails
-----trying rule: < > $*
-----rule matches: $1
rewritten as: external < @ address . com . >
-----trying rule: < > $*
----- rule fails
-----trying rule: $* < @ . $* > $*
----- rule fails
-----trying rule: $* < @ $* . . $* > $*
----- rule fails
-----trying rule: $* < @ $* @ > $*
----- rule fails
-----trying rule: $* @ $* < @ $* > $*
----- rule fails
-----trying rule: $* , $~O $*
----- rule fails
-----trying rule: $* < @ > $*
----- rule fails
-----trying rule: < @ $=w . > : $*
----- rule fails
-----trying rule: $- < @ $=w . >
----- rule fails
-----trying rule: < @ $+ >
----- rule fails
-----trying rule: $* $=O $* < @ $=w . >
----- rule fails
-----trying rule: $-
----- rule fails
-----trying rule: < @ *LOCAL* >
----- rule fails
-----trying rule: $* $=O $* < @ *LOCAL* >
----- rule fails
-----trying rule: $* < @ *LOCAL* >
----- rule fails
Parse0 returns: external < @ address . com . >
rewritten as: external < @ address . com . >
-----trying rule: < @ >
----- rule fails
-----trying rule: $*
-----rule matches: $: $> ParseLocal $1
-----skip subr ParseLocal (98)
rewritten as: external < @ address . com . >
-----trying rule: $*
-----rule matches: $: $> Parse1 $1
Parse1 input: external < @ address . com . >
-----trying rule: $* < @ [ $+ ] > $*
----- rule fails
-----trying rule: $* < @ [ $+ ] > $*
----- rule fails
-----trying rule: $* < @ [ $+ ] : > $*
----- rule fails
-----trying rule: $* < @ [ $+ ] : $- : $* > $*
----- rule fails
-----trying rule: $* < @ [ $+ ] : $+ > $*
----- rule fails
-----trying rule: $=L < @ $=w . >
----- rule fails
-----trying rule: $+ < @ $=w . >
----- rule fails
-----trying rule: $* < @ $* > $*
-----rule matches: $: $> MailerToTriple < main . cipherpayments . com > $1 < @ $2 > $3
MailerToTriple input: < main . dmz . mailserver > external < @ address . com . >
-----trying rule: < > $*
----- rule fails
-----trying rule: < error : $- . $- . $- : $+ > $*
----- rule fails
-----trying rule: < error : $- : $+ > $*
----- rule fails
-----trying rule: < error : $+ > $*
----- rule fails
-----trying rule: < local : $* > $*
----- rule fails
-----trying rule: < $~[ : $+ @ $+ > $* < $* > $*
----- rule fails
-----trying rule: < $~[ : $+ > $*
----- rule fails
-----trying rule: < $=w > $*
----- rule fails
-----trying rule: < $+ > $*
-----rule matches: $# relay $@ $1 $: $2
rewritten as: $# relay $@ main . cipherpayments . com $: external < @ address . com . >
MailerToTriple returns: $# relay $@ main . dmz . mailserver $: external < @ address . com . >
rewritten as: $# relay $@ main . cipherpayments . com $: external < @ address . com . >
Parse1 returns: $# relay $@ main . dmz . mailserver $: external < @ address . com . >
rewritten as: $# relay $@ main . cipherpayments . com $: external < @ address . com . >
parse returns: $# relay $@ main . dmz . mailserver $: external < @ address . com . >
It all looks OK - no problems exposed even by the strongest test:
returns: $# relay $@ main . dmz . mailserver $: external < @ address . com . >
B1) Try test below:
sendmail -bv external@address.com
*ONLY IF* it returns other triple than the test you resported THEN report what is rerted by
sendmail -d21.12 -bv external@address.com
B2) send a short message as root in verbose mode *WITHOUT* using submit.cf:
(echo subject; test; echo) | sendmail -v -Am -- external@address.com
anfi:
B1 test passes -- provides mailer relay as main.dmz.mailserver
external@address.com... deliverable: mailer relay, host main.dmz.mailserver, user external@address.com
B2 test passes -- lan mail server fowards properly to DMZ without first attempting to deliver directly. you mention submit.cf, however I have not made configuration changes to this file.
Upon further reading, I see that submit.cf is used for local mail processing configuration and sendmail.cf is for additional mail configuration from other sources. I was not aware of needing to alter submit.cf. By soft-linking submit.cf -> sendmail.cf, I have solved the original issue. Are there any issues involved with soft-linking in this manner or is this an acceptable practice?
Thanks so much for your knowledge and assistance in this matter.
Cheers,
Nick Pelfort
submit.cf is intended to pass locally submitted mail (via direct execution of sendmail binary) to local sendmail daemon.
[ It was added to avoid set root id installation of sendmail ]
I suggest you to generate *NEW* submit.cf from original submit.mc with FEATURE(`msp', `[127.0.0.1]') line changed to FEATURE(`msp',`[main.dmz.m
It will turn off mail aliases axpansion at local machine.
Business Accounts
Answer for Membership
by: anfiPosted on 2007-01-29 at 14:08:39ID: 18423454
1) Is smart host defined in your sendmail.cf? [possuble problem with *.mc to semndmail.cf translation ]
grep ^DS /etc/mail/sendmail.cf
2) Have your restarted/HUPed sendmail daemon after modifying sendmail.cf?
[ sendmail daemon remembers sendmail.cf as it was when the daemon wassstarted]
3) if the above fails post results produced by the test command below
echp '3,0 external@address.com' | sendmail -d21.12 -bt