LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail -bv user unkown (https://www.linuxquestions.org/questions/linux-server-73/sendmail-bv-user-unkown-651845/)

davidedwardgill 06-26-2008 11:46 AM

Sendmail -bv user unkown
 
Hello

I am having an issue with sendmail. It is not recognizing the users with the full domain name.

If I run the sendmail -bt, then do the /try smtp userID, is shows the ID with the proper name and domain.


Though if I run the sendmail -bv command I get the following error.

[root@lks ~]# sendmail -bv david.gill@DOMAIN
david.gill@DOMAIN... deliverable: mailer esmtp, host DOMAIN, user david.gill@DOMAIN
[root@lks ~]# sendmail -bv david.gill@DOMAIN.com
david.gill@DOMAIN.com... User unknown

THANKS!

unSpawn 06-27-2008 06:42 AM

Odd since it should be the other way around. Since when do you have this error? What changed in sendmail config between initial state and now?

davidedwardgill 06-30-2008 05:26 PM

When I add the masqurading line into the .mc file.

Though if I take out the masqurading line, I get a 550 5.7.1 reject mail error.

Good question. Sorry for not including that.

unSpawn 07-01-2008 12:02 PM

Sorry for late reply. So your e-mail isn't accepted by remote MTAs (smarthost?) and your masquerading lines don't work well. Maybe posting what you changed and added could help.

davidedwardgill 07-03-2008 04:18 PM

It changes when I remove the MASQUERADE_AS(`DOMAIN.com')dnl. It changes from unknown user to rejected 550 5.7.1.

I don't understand why it accepts from remote MTAs then not when masquerading is disabled. Masquerading doesn't have anything to do with rejecting mail. I thought the server was sapose to accept everything unless it was labeled reject in the access file.

Here is my .mc file________________________________________________________
divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(`linux')dnl
DOMAIN(`DOMAIN')dnl
FEATURE(`nouucp', `reject')
MAILER(local)dnl
MAILER(smtp)dnl


here is my domain.m4 file_______________________________________________________
divert(0)
VERSIONID(`DOMAIN.m4 04/05.08')
define(`confFORWARD_PATH', `$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.
forward')dnl
define(`confMAX_HEADERS_LENGTH', `32768')dnl
FEATURE(`redirect')dnl
FEATURE(`use_cw_file')dnl
EXPOSED_USER(`root')dnl
MASQUERADE_AS(`DOMAIN.com')dnl
FEATURE(`masquerade_envelope')
FEATURE(`genericstable')dnl

here is my access file if that helps________________
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
216.252.100.52 RELAY
yahoo.com RELAY

unSpawn 07-04-2008 07:19 AM

First of all I think it would be best if you filled in your distro inf in your profile, and if that doesn't reflect this particular machine post its distro, version and sendmail version here.


Quote:

Originally Posted by davidedwardgill (Post 3203316)
It changes when I remove the MASQUERADE_AS(`DOMAIN.com')dnl. It changes from unknown user to rejected 550 5.7.1. I don't understand why it accepts from remote MTAs then not when masquerading is disabled. Masquerading doesn't have anything to do with rejecting mail. I thought the server was sapose to accept everything unless it was labeled reject in the access file.

I think you're confusing things. Remote MTAs sending e-mail to your MTA doesn't have anything to do with masquerading. Masquerading affects how remote MTAs view e-mail *your* MTA sends. "550 5.7.1" means "relaying denied" and unless you post output (of say 'sendmail -d1-20.99 -bv david.gill@lkelectric.com') I can't see how this relates.


Quote:

Originally Posted by davidedwardgill (Post 3203316)
Here is my .mc file (..)

Your sendmail.mc looks *way* too sparse to me. As far as I know if you use DOMAIN() it should be DOMAIN(`generic')dnl (as in the "generic.m4" and if you use a domain.m4 (which in your case looks like a plain copy of "generic.m4" with partial masq directives tacked on?) you should name it to yourdomain.m4 and use that, so: DOMAIN(`myrealdomainname')dnl. How, or better: using what documentation, did you configure all of this I wonder?


Quote:

Originally Posted by davidedwardgill (Post 3203316)
here is my access file if that helps

I suggest you remove the "connect" from localhost and domain since you want to be able to send from and to, so that'll be plain "localhost.localdomain RELAY". On the other hand, for other domains like yahoo.com I think it would be more clear if you *explicitly* set what you want to do. You want to relay *to* but not *from* that domain (even though that's useless since they wouldn't ever use your MX), so use "To:yahoo.com RELAY".


I'm no Sendmail guru but I think you want to go back to the drawingboard, read some sendmail docs and build your sendmail.mc from some template because it does not look complete to me. A very basic .mc file, listening on localhost only, w/o certs, and stuff should look something like this:
Code:

divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`replace_my linux sendmail template')dnl
OSTYPE(`linux')dnl
define(`confDEF_USER_ID', ``replace_numericUID:replace_numericGID'')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(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')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
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
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
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(replace_hostname.domainname.tld)dnl
MASQUERADE_DOMAIN(replace_hostname.domainname.tld)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(allmasquerade)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

* If you're going to test configurations be aware you can run Sendmail on another port with another config. For example if your M4 generated config is aptly named "test" and the port is 1234, run: 'sendmail - Ctest.cf -bd -oOP=1234'.

davidedwardgill 07-07-2008 11:59 AM

Up front, thanks for the help.

I updated my profile with distro information. It is RedHat 5 Enterprise.

Here is my sendmail version info.
[root@lks ~]# rpm -q sendmail
sendmail-8.13.8-2.el5

Just to make certain everything on my side is good, could you check that first quote, because in it I stated that masquerading doesn't have anything to do with rejecting mail.

Also I included the output of the 'sendmail -d1-20.99 -bv david.gill@DOMAIN.com' command. It is at the bottom. My DNS works ok...

In my .mc file I removed the actual name of my domain file and replaced it with DOMAIN...

As far as the .mc file I think you may be right for some things, I'm gona look through those commands and add the ones which aren't defaults or already included in .m4 files like domain.m4 and distro.m4.

With the access file, I've found next to no good documentation on it. Do you have any suggestions other than the sendmail readme file? With that file I could REALLY use some documentation because that is the one thing that I have many questions on with sendmail.

The documentation I've been using to set this up is Craig Hunt's 'Linux Network Servers'.





___________________________________________________________________
Output of command
'sendmail -d1-20.99 -bv david.gill@DOMAIN.com'

getla(): 0.00
getauthinfo: root@localhost
assign_queueid: random_offset = 884445851 (1451)
assign_queueid: assigned id m67GX3OB011971, e=0x87ea80
assign_queueid: random_offset = 884445851 (1452)
assign_queueid: assigned id m67GX3OC011971, e=0x87ea80
queuename: ./xfm67GX3OC011971
getla(): 0.00

--parseaddr(root)
parseaddr-->0x87ea90=root:
mailer 3 (local), host `'
user `root', ruser `<null>'
state=OK, next=0x0, alias 0x0, uid 0, gid 0
flags=180<QPINGONFAILURE,QPINGONDELAY>
owner=(none), home="(none)", fullname="(none)"
orcpt="(none)", statmta=(none), status=(none)
finalrcpt="(none)"
rstatus="(none)"
statdate=(none)

--parseaddr(david.gill@DOMAIN.com)
host_map_lookup(DOMAIN.com) => dns_getcanonname(DOMAIN.com, trymx=1)
dns_getcanonname: trying DOMAIN.com. (AAAA)
NO: errno=0, h_errno=4
dns_getcanonname: trying DOMAIN.com. (A)
NO: errno=0, h_errno=4
dns_getcanonname: trying DOMAIN.com. (MX)
YES
dns_getcanonname: DOMAIN.com
FOUND DOMAIN.com
parseaddr-->0x9d335e0=david.gill@DOMAIN.com:
mailer 3 (local), host `'
user `david.gill', ruser `<null>'
state=OK, next=0x0, alias 0x0, uid 0, gid 0
flags=180<QPINGONFAILURE,QPINGONDELAY>
owner=(none), home="(none)", fullname="(none)"
orcpt="(none)", statmta=(none), status=(none)
finalrcpt="(none)"
rstatus="(none)"
statdate=(none)
david.gill@DOMAIN.com... User unknown
giveresponse: status=67, dsn=5.1.1, e->e_message=david.gill@DOMAIN.com... User unknown, errnum=0
From person = "root"
main[0]: QS_SENDER 0x87ea90=root:
mailer 3 (local), host `'
user `root', ruser `<null>'
state=SENDER, next=0x0, alias 0x0, uid 0, gid 0
flags=181<QGOODUID,QPINGONFAILURE,QPINGONDELAY>
owner=(none), home="/root", fullname="(none)"
orcpt="(none)", statmta=(none), status=(none)
finalrcpt="(none)"
rstatus="(none)"
statdate=(none)
getla(): 0.00

===== SENDALL: mode v, id m67GX3OC011971, e_from 0x87ea90=root:
mailer 3 (local), host `'
user `root', ruser `<null>'
state=SENDER, next=0x0, alias 0x0, uid 0, gid 0
flags=181<QGOODUID,QPINGONFAILURE,QPINGONDELAY>
owner=(none), home="/root", fullname="(none)"
orcpt="(none)", statmta=(none), status=(none)
finalrcpt="(none)"
rstatus="(none)"
statdate=(none)
e_flags = 4001<OLDSTYLE,METOO>
sendqueue:
0x9d335e0=david.gill@DOMAIN.com:
mailer 3 (local), host `'
user `david.gill', ruser `<null>'
state=BADADDR, next=0x0, alias 0x0, uid 0, gid 0
flags=80000182<QPRIMARY,QPINGONFAILURE,QPINGONDELAY,QRCPTOK>
owner=(none), home="(none)", fullname="(none)"
orcpt="(none)", statmta=(none), status=5.1.1
finalrcpt="RFC822; david.gill@DOMAIN.com"
rstatus="550 5.1.1 User unknown"
statdate=(none)

After first owner pass, sendq =
0x9d335e0=david.gill@DOMAIN.com:
mailer 3 (local), host `'
user `david.gill', ruser `<null>'
state=BADADDR, next=0x0, alias 0x0, uid 0, gid 0
flags=80000182<QPRIMARY,QPINGONFAILURE,QPINGONDELAY,QRCPTOK>
owner=(none), home="(none)", fullname="(none)"
orcpt="(none)", statmta=(none), status=5.1.1
finalrcpt="RFC822; david.gill@DOMAIN.com"
rstatus="550 5.1.1 User unknown"
statdate=(none)
owner = "", otherowners = 1
Checking 0x9d335e0=david.gill@DOMAIN.com:
mailer 3 (local), host `'
user `david.gill', ruser `<null>'
state=BADADDR, next=0x0, alias 0x0, uid 0, gid 0
flags=80000182<QPRIMARY,QPINGONFAILURE,QPINGONDELAY,QRCPTOK>
owner=(none), home="(none)", fullname="(none)"
orcpt="(none)", statmta=(none), status=5.1.1
finalrcpt="RFC822; david.gill@DOMAIN.com"
rstatus="550 5.1.1 User unknown"
statdate=(none)
... Null owner
... QS_IS_BADADDR
sendall: final mode = v

================ Final Send Queue(s) =====================

*** Envelope m67GX3OC011971, e_from=root ***
0x9d335e0=david.gill@DOMAIN.com:
mailer 3 (local), host `'
user `david.gill', ruser `<null>'
state=BADADDR, next=0x0, alias 0x0, uid 0, gid 0
flags=80000182<QPRIMARY,QPINGONFAILURE,QPINGONDELAY,QRCPTOK>
owner=(none), home="(none)", fullname="(none)"
orcpt="(none)", statmta=(none), status=5.1.1
finalrcpt="RFC822; david.gill@DOMAIN.com"
rstatus="550 5.1.1 User unknown"
statdate=(none)
==========================================================

sendenvelope(m67GX3OC011971) e_flags=0x4001
queuename: ./dfm67GX3OC011971
queuename: ./qfm67GX3OC011971
queuename: ./xfm67GX3OC011971

====finis: stat 67 e_id=NOQUEUE e_flags=5001<OLDSTYLE,GLOBALERRS,METOO>
0: fl=0x8002, mode=20620: CHR: dev=0/11, ino=3, nlink=1, u/gid=0/5, size=0
1: fl=0x8002, mode=20620: CHR: dev=0/11, ino=3, nlink=1, u/gid=0/5, size=0
2: fl=0x8002, mode=20620: CHR: dev=0/11, ino=3, nlink=1, u/gid=0/5, size=0
4: fl=0x2, mode=140777: SOCK localhost->[[UNIX: /dev/log]]
5: fl=0x8000, mode=100640: dev=253/0, ino=2130651, nlink=1, u/gid=0/51, size=12288
6: fl=0x8000, mode=100640: dev=253/0, ino=2130651, nlink=1, u/gid=0/51, size=12288
______________________________________________________________________________________________

THANKS AGAIN!!!

unSpawn 07-07-2008 01:04 PM

Reviewing your earlier threads, this doesn't involve addressing of case sensitive /etc/passwd usernames "DavidGill" or "David.Gill" that should really read "davidgill" "david.gill", right?

davidedwardgill 07-07-2008 01:29 PM

Holy poopie dipers.

No you are totally right. I just created a user ID with all lower case, and it resolved perfectly fine!

I though my generics table which has the proper cases would resolve that?!

If you don't mind saving me about two hours worth of research, how do I get it to work with the capitols. Should I have used VirtualUserTables?

unSpawn 07-07-2008 02:32 PM

Well that's not resolution but case sensitivity dictated by the LDA for ya. AFAIK genericstable is for username to e-mail (outbound: davidgill DavidGill) translation and virtusertable for e-mail to username (inbound: DavidGill@somehost davidgill). Wrt documentation there's lots in different places: the sendmail-doc package, sial.org and other sites have more Sendmail information on-line than I'll ever read and then there's "the Bat Book" aka O'Reilly's "Using Sendmail"...

davidedwardgill 07-08-2008 01:54 PM

Well, I'm using procmail as my LDA. I don't need to config it directly though. Sendmail has a feature to add.

Thanks also for the quick edication on virtual user tables. I've got that up and it is testing fine...

To get sendmail to accept capitals on user IDs refer to http://www.sendmail.org/faq/section4.

Thank you again for the help!!!

Everything is up and running fine.


All times are GMT -5. The time now is 03:59 PM.