Operating System - HP-UX
1827174 Members
2227 Online
109716 Solutions
New Discussion

Re: login account but no email?

 
SOLVED
Go to solution
Fred Martin_1
Valued Contributor

login account but no email?

I have a D380/2 running HP-UX 10.20, and use sendmail.

I have several users that require a normal unix login account, but I do not want them to have a valid email account. As far as sendmail is concerned, these people should not exist.

What are some ways that this can be accomplished?
fmartin@applicatorssales.com
11 REPLIES 11
Robin Wakefield
Honored Contributor

Re: login account but no email?

Hi Fred,

You could alias them to /dev/null, i.e. /etc/mail/aliases would contain:

username: /dev/null

then run newaliases or 'sendmail -bi'.

Rgds, Robin.
Sachin Patel
Honored Contributor

Re: login account but no email?

Hi Fred,
Sendmail looks first in /etc/mail/aliases files or /etc/aliases file for email address. Then send that mail to user. If you do not have that user's mail address on aliases file then if this box has mail realy set it will send this mail to relay host and relay host trys to find users emial address.

If I am not wrong then, you do not have there address on aliases then they are not exist.

Sachin
Is photography a hobby or another way to spend $
linuxfan
Honored Contributor

Re: login account but no email?

Hi Fred,

One of the options is to create an alias for all the users to point to /dev/null

edit /etc/mail/aliases
user1 : /dev/null
user2 : /dev/null


Run newaliases and all the email for these users will go to /dev/null.

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Fred Martin_1
Valued Contributor

Re: login account but no email?

Thanks for the replies...I understand that re-directing to /dev/null will work, but the sender is unaware that the user does not exist - because the mail is accepted but thrown out.

I would prefer that the mail bounce back to the sender as if the username was unknown.

Also relays are not involved; sendmail on the server does in fact deliver mail to the local mailboxes in /var/mail, and does not forward or relay mail to any other server.
fmartin@applicatorssales.com
Edward Alfert_2
Respected Contributor

Re: login account but no email?

what if
1) you create a user called "nomail"
2) then alias the mail for the people you don't want to receive mail to this user.
3) Then have an autoreply that sends a message saying that that user doesn't exist...

your lying, and it isn't a standard message, but the recipient will get the message that they can't reach those users via email.
"Do what you love and you will never work a day in your life." - Confucius
Fred Martin_1
Valued Contributor

Re: login account but no email?

Just a note, I found something that is probably acceptable to me, the idea came from the discussion above. In my aliases file, I put this entry:

user1 : unknown
user2 : unknown

user1 and user2 are valid login accounts. unknown is bogus, and does not exist. sendmail returns the mail saying something like:

unknown (expanded from user1) - user unknown

So the effect is the same; it bounces back.

I may use this, but any other ideas are welcome.
fmartin@applicatorssales.com
linuxfan
Honored Contributor
Solution

Re: login account but no email?

Hi Fred,


If you want the mail to bounce back to the sendar, what you could do is in /etc/mail/aliases

user1 : invaliduser
user2 : invaliduser

so when a mail is sent to user1@host.domain.com

this will bounce back since invaliduser is not a valid user on your system.

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
linuxfan
Honored Contributor

Re: login account but no email?

Hi Fred,

I should have refreshed my browser to check the thread before i sent my message, i tested out the solution, it works.

-Regards
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Fred Martin_1
Valued Contributor

Re: login account but no email?

Do we think alike, or what . I will use this approach, because it's easily managed from the aliases file.
fmartin@applicatorssales.com
Robin Wakefield
Honored Contributor

Re: login account but no email?

Hi Fred,

You could add lines in rule set 0 of sendmail.cf:

Rusername $#error $: unknown user
Ranotheruser $#error $: unknown user

Make sure you put tabs between the user and the $#...

Rgds, Robin.
Robin Wakefield
Honored Contributor

Re: login account but no email?

Hi Fred,

The other way is to create a class file, then refer to this in rule set 0:

FU /etc/mail/UserList
...
S0
R$=U $#error $: User Unknown

Don't forget to stop/start sendmail after these changes are made.

aliases is probably simpler though ;-) ...Robin