You are not logged in.

#1 2013-09-05 03:16:06

BigIke
Member
Registered: 2013-09-05
Posts: 3

Sendmail virtuser is mapped but when mail arrives "User unknown"

I am setting up sendmail to accept email from 3 domains my primary domain works fine but I am having trouble getting virtusers on the other two domains to function. I have a local user name on one of the other two domains that works but the aliases do not function.

My sendmail.mc:

include(`/usr/share/sendmail-cf/m4/cf.m4')
define(`confLOG_LEVEL',`15')
define(`confDOMAIN_NAME', `michaeleichorn.com')dnl
FEATURE(use_cw_file)
dnl  The following allows relaying if the user authenticates,
dnl  and disallows plaintext authentication (PLAIN/LOGIN) on
dnl  non-TLS links:
define(`confAUTH_OPTIONS', `A p y')dnl
dnl
dnl  Accept PLAIN and LOGIN authentications:
TRUST_AUTH_MECH(`LOGIN PLAIN CRAM-MD5')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN CRAM-MD5')dnl
dnl
dnl Make sure this paths correctly point to your SSL cert files:
define(`confCACERT_PATH',`/etc/ssl/certs')dnl
define(`confCACERT',`/etc/ssl/certs/cacert.pem')dnl
define(`confSERVER_CERT',`/etc/ssl/certs/server.crt')dnl
define(`confSERVER_KEY',`/etc/ssl/private/key.pem')dnl
dnl
FEATURE(`virtusertable', `hash /etc/mail/virtusertable.db')dnl
OSTYPE(linux)dnl
MAILER(local)dnl
MAILER(smtp)dnl

My virtusertable

user1@domain1.com	user1
alias1.1@domain1.com	user1
alias1.2@domain1.com	user1
alias1.3@domain1.com	user1
alias1.4@domain1.com	user1
alias2.1@domain2.com	user2
user2@domain2.com	user2
alias2.2@domain2.com	user2
alias2.3@domain2.com	user2
alias2.4@domain3.com	user2
alias3.1@domain3.com 	user3
alias3.2@domain3.com	user3
alias3.3@domain3.com	user3
alias3.4@domain3.com	user3
alias3.5@domain3.com	user3
alias3.6@domain3.com	user3
alias3.6@domain3.com	user3

My local-host-names:

localhost
domain1.com
mail.domain1.com
servername.domain1.com
domain2.com
mail.domain2.com
domain3.com
mail.domain3.com
localhost.localdomain

The interesting bit is that if I run:

# sendmail -bt
> /map virtuser alias2.1@domain2.com

I get:

 map_lookup: virtuser (alias2.1@domain2.com) returns user2 (0) 

But if I run:

 sendmail -bv alias2.1@domain2.com 

Sendmail returns:

 alias2.1@domain2.com... User unknown 

When I send an email to that address the log says:

Sep 04 00:47:18 servername.domain1.com sm-mta[881]: r844lI1t000881: <-- RCPT TO:<alias2.1@domain2.com>
Sep 04 00:47:18 servername.domain1.com sm-mta[881]: r844lI1t000881: --- 550 5.1.1 <alias2.1@domain2.com>... User unknown
Sep 04 00:47:18 servername.domain1.com sm-mta[881]: r844lI1t000881: <alias2.1@domain2.com>... User unknown

So once again email to user1@domain1.com, user2@domain2.com, and alias1.*@domain1.com works, but alias2.*@domain2.com and alias3.*@domain3.com do not work.

Any ideas what is going on?

Offline

#2 2016-08-03 17:44:02

Seikku
Member
Registered: 2016-08-03
Posts: 2

Re: Sendmail virtuser is mapped but when mail arrives "User unknown"

Sorry to bring up a thread almost 3 years old, but I've got a very similar problem and (currently) out of clues.

My server had to change the IPv4 address and after that I noticed some of the virtusertable entries are old and stay old, though  the table itself updates on restart. I'm not aware if it is the change of IP or some other reason causing this 'freezing'.

The 'sudo sendmail -bv new.recepient@old.domain' return "User unknown", but query through 'sudo sendmail -bt' with  query '/map virtuser new.recepient@old.domain' returns valid recepient.

Some old entries that have been changed also show the old recepient with -bv but the new recepient with -bt.

Any ideas?

Offline

#3 2016-08-03 20:33:37

Seikku
Member
Registered: 2016-08-03
Posts: 2

Re: Sendmail virtuser is mapped but when mail arrives "User unknown"

Solved. Weird solution: though I have DNS answering properly, the solution was to edit the first non-comment entry of /etc/hosts to solve the localhost IP to the proper name of the host:
127.0.0.1       actual.domain localhost.localdomain   localhost

I'd like to know if BigIke found a solution too?
Perhaps this should be doomed solved?

Last edited by Seikku (2016-08-03 20:35:25)

Offline

Board footer

Powered by FluxBB