/etc/mail/aliases


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting /etc/mail/aliases
# 1  
Old 07-16-2007
/etc/mail/aliases

HI

I have 5000 users on sendmail server, also there entries of these users Mail ID in /etc/mail/aliases as per Diparments. Same Mail ID can occures in Diff Departments as per req.
I have to remove 500 users from server also there entry from /etc/mail/aliases file. which occures many times.

IS there any script to remove the ID's from this file at a time

Thanks
Kumarsharad
# 2  
Old 07-16-2007
If you have a file with the users listed in it one per line this might work for you:

Code:
cp /etc/mail/aliases /etc/mail/aliases.orig
fgrep -vwf file /etc/mail/aliases.orig > /etc/mail/aliases

I suggest you verify the file before doing:
Code:
newaliases

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

3. UNIX for Dummies Questions & Answers

Problem with aliases

I work on a MAC. And i have the need to connect to various servers on a daily basis. So I use aliases in bash shell. The aliases work fine in bash shell. But they dont work with tcsh. Can anybody clarify what might be wrong? (1 Reply)
Discussion started by: newprofile
1 Replies

4. Solaris

Mail Aliases

I'm at a bit of a loss here, any help is appreciated... I have Solaris 10, and in submit.cf, sendmail.cf I have the mail relay setup to our companys relay server which works fine when I type a full email address on the command like (i.e. #echo hello | mail me@work.com). However, I am trying... (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

5. Shell Programming and Scripting

etc aliases

Hello: i have several server with own etc aliases. right now i want to combine it all into a general etc aliases in a new freebsd server. cause it consist hundred thousand of record user inside how to make a shell script to combine it or configure it. all etc aliases record example: ... (0 Replies)
Discussion started by: peterLfs
0 Replies

6. Solaris

how to forward mail in /var/mail/username to external mail

Dear All, Now I use solaris 10 and I try to forward mail from /var/mail/username to their external mail so what should I do? thank u in advance (2 Replies)
Discussion started by: unitipon
2 Replies

7. AIX

mail, aliases, pager

Hi, I have two aliases for two types of alert. /etc/aliases italert1: user1@company.com italertb: 123456@paging.isp.com The first alias containts only an email to go through the company exchange/mail server. Works fine. The second alias contains only a pager which also works fine.... (2 Replies)
Discussion started by: itik
2 Replies

8. UNIX for Dummies Questions & Answers

aliases

Is there a way to view what aliases are running on a given session? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

9. UNIX for Dummies Questions & Answers

NIS map mail.aliases specified, but NIS not running

Hi all, I just took over the admin role from someone and I wanna setup sendmail (just to send mail from the host) however, after I config all the resolv.conf, nssitch.conf, hosts file and when I try to send a mail out, after I punched ctl-D, it returned he following, "NIS map mail.aliases... (2 Replies)
Discussion started by: stancwong
2 Replies

10. Programming

aliases

Hi. I have a C program that is using the **environ pointer and I am trying to set up aliases for a system("/bin/ksh") call. This works for other environment variables but not for the aliases. Does anyone know if this can be done? Thanks ahead of time. (1 Reply)
Discussion started by: mluey61
1 Replies
Login or Register to Ask a Question