Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User unknown to only certain e-mail address

Status
Not open for further replies.

compquackers

Technical User
Feb 1, 2003
20
I have Redhat 9.0 running sendmail & have a program using sendmail to contact subscribing members of a website. Basically it works fine for email addresses such as abc@hotmail.com , but when it emails something like abc@xyz.fsnet.co.uk i get the DSN: User Unknown in the sendmail log (see below):


Here is the log, my server name is abc1.

44MvM0e003134: from=apache, size=465, class=0, nrcpts=1, msgid=<200405042257.i44MvM0e003134@localhost.localdomain>, relay=apache@localhost
May 4 18:57:25 abc1 sendmail[3136]: i44MvNJx003136: from=<apache@localhost.localdomain>, size=700, class=0, nrcpts=1, msgid=<200405042257.i44MvM0e003134@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=mfx1 [127.0.0.1]
May 4 18:57:25 abc1 sendmail[3134]: i44MvM0e003134: to=abc@xyz.fsnet.co.uk, ctladdr=apache (48/48), delay=00:00:03, xdelay=00:00:02, mailer=relay, pri=30137, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (i44MvNJx003136 Message accepted for delivery)
May 4 18:57:27 abc1 sendmail[3138]: i44MvNJx003136: to=<abc@xyz.fsnet.co.uk>, ctladdr=<apache@localhost.localdomain> (48/48), delay=00:00:04, xdelay=00:00:02, mailer=esmtp, pri=30372, relay=mail-in.freeserve.com. [193.252.22.141], dsn=5.1.3, stat=User unknown
May 4 18:57:27 abc1 sendmail[3138]: i44MvNJx003136: i44MvRJx003138: DSN: User unknown
May 4 18:57:27 abc1 sendmail[3138]: i44MvRJx003138: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31724, dsn=2.0.0, stat=Sent

Could the error be my setup - eg localhost@localdomain is not setup to be my domain, or maybe because fsnet.co.uk has a fault? I can email the customer using Outlook Express so I can only think it's at my end. I am new to sendmail configuration so any help in setting the thing up would be very welcome!
 
Looks like your problem is pretty simple see below:

May 4 18:57:27 abc1 sendmail[3138]: i44MvNJx003136: to=<abc@xyz.fsnet.co.uk>, ctladdr=<apache@localhost.localdomain> (48/48), delay=00:00:04, xdelay=00:00:02, mailer=esmtp, pri=30372, relay=mail-in.freeserve.com. [193.252.22.141], dsn=5.1.3, stat=User unknown

You need to set up an "apache" user account on the sendmail server in order to send mail from the apache@localhost account.

Cogito Ergo Sum - Non Compos Mentis
 
Follow up:
You can send mail to the same user using Outlook Express and your account because you have the proper setup. The apache user account does not.

Cogito Ergo Sum - Non Compos Mentis
 
Thanks Rhinokiller - fastest reply ever!
Any idea how i would add this user account? Also why do other email addresses get sent ok (eg to a *@hotmail address)?
 
Here's how to add a user account:

su - to root
useradd -g (group name) username (e.g apache)
passwd username
(type passwd here)
(confirm passwd)

cd to /etc and edit the passwd file.
Choose an editor (VI or Pico) and change the shell to nologin or false if you don't want the user to have shell access.

If you want the new user to be able to receive mail you'll need to add them to the aliases db or the virtuser db.
Edit the aliases file and add something like
newuser: newuser
Save the file and run sendmail -bi to hash the file to a db.

In your first post you stated "I can email the customer using Outlook Express so I can only think it's at my end. I am new to sendmail configuration so any help in setting the thing up would be very welcome!"
I can only conclude that you have a valid user account on the mail server.

Cogito Ergo Sum - Non Compos Mentis
 
Thanks again
I appear to already have apache setup like this in my pawwsd file:

apache:x:48:48:Apache:/var/

Also i think i misled you about the outlook express email working - that is from another of my Pc's!
 
Maybe fsnet rejects emails from @localhost (i.e. default) domains as they are not "true addresses"? So, how can i alter the from setting to read eg webmaster@abc1.com?
I think that should make the fsnet mail server receive my emails. Maybe other mail servers don't reject such emails (as i have found hotmail works with sendmail from apache@localhost)
 
I would look at modifying whatever program/script is contacting your members and see if you can change the default envelope sender to something other than apache@localhost. Maybe create a dummy account on the mail server called notify and use that. I am alittle confused though, when you send mail and your app sends mail, is it from the same physical box ???

Cogito Ergo Sum - Non Compos Mentis
 
The program actually sends the email through sendmail using a different email address (for this example webmaster@abc1.com) and i can alter that ok, but on the sendmail log i get as per my first post.

See email properties below for test email received in my outlook express inbox (this had no sendmail errors):

Return-Path: apache@localhost.localdomain
Envelope-To: webmaster@abc1.com
Received: from [*.*.*.110]([*.*.*.110] HELO:localhost.localdomain) by def.ghi.net.uk
for webmaster@abc1.com;
Mon, 03 May 2004 20:44:47 +0100
Received: from localhost.localdomain (abc1 [127.0.0.1])
by localhost.localdomain (8.12.8/8.12.8) with ESMTP id i440gYe3003308
for <test@xyz.co.uk>; Mon, 3 May 2004 20:42:35 -0400
Received: (from apache@localhost)
by localhost.localdomain (8.12.8/8.12.8/Submit) id i440gYvS003306;
Mon, 3 May 2004 20:42:34 -0400
Date: Mon, 3 May 2004 20:42:34 -0400
Message-Id: <200405040042.i440gYvS003306@localhost.localdomain>
To: webmaster@abc1.com Subject: ** Pending Payment
From: webmaster@abc1.com
X-Mailer: xxxx (my mebership program)

So i still think it is the localhost bit being bounced by fsnet as it works for other addresses.

I have not sent mail from the server except using sendmail, but outlook express on the other pc emails fine to the problem email address.
 
Sorry i made an error in the last post - should read:

Return-Path: apache@localhost.localdomain
Envelope-To: test@xyz.com
Received: from [*.*.*.110]([*.*.*.110] HELO:localhost.localdomain) by def.ghi.net.uk
for test@xyz.com;
Mon, 03 May 2004 20:44:47 +0100
Received: from localhost.localdomain (abc1 [127.0.0.1])
by localhost.localdomain (8.12.8/8.12.8) with ESMTP id i440gYe3003308
for <test@xyz.com>; Mon, 3 May 2004 20:42:35 -0400
Received: (from apache@localhost)
by localhost.localdomain (8.12.8/8.12.8/Submit) id i440gYvS003306;
Mon, 3 May 2004 20:42:34 -0400
Date: Mon, 3 May 2004 20:42:34 -0400
Message-Id: <200405040042.i440gYvS003306@localhost.localdomain>
To: test@xyz.com Subject: ** Pending Payment
From: webmaster@abc1.com
X-Mailer: xxxx (my mebership program)

Please ignore this data sent in previous thread.
 
Now i have managed to alter the php.ini file which allows a sendmail-f command to be set to change email to any email address. Problem is this sends mail but it gets redirected in hotmail.com to the spam folder.
Now this is a new issue, surely it must be possible to alter the sendmail configuration instead of this to allow a trusted user to send mail so it doesn't appear asa changed "from" address, so it can be received without being bounced, and without be classed as spam?

 
After a lot of testing, i reinstalled sendmail to default and set it up using some instructions i found on the web.

I have managed to get external emails sent now, but have a problem with any emails in my domain (even though i receive emails in another pc). What appears to happen is any email with my domain is trying to email internally - although the server is not setup to receive emails. They do not arrive and User unknown is error message again.

How can I allow emails to be sent outside the localhost - it must be something very simple left to do now??? It's ironic as i had previously had no problems with them getting internally, just externally!

Thanks for any advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top