Solved

Where to set aliases / forward email to different user

Posted on 2004-08-25
11
177 Views
Last Modified: 2013-12-18
For some reason I set up mail going to one user to be forwarded to root a long time ago. Now I can't find where I set this up at. I have checked the aliases files but there was no entry for mail to be forwarded to root.

I also looked for a .forward file in the user's home directory but couldn't find one.

Where else could this be set, to forward email for one user to another?
0
Comment
Question by:jsfald
  • 6
  • 5
11 Comments
 
LVL 34

Expert Comment

by:PsiCop
Comment Utility
Well, what OS, version and MTA? We're Experts, not mindreaders.
0
 
LVL 1

Author Comment

by:jsfald
Comment Utility
My expectations of your mind reading powers have been greatly diminished. =)

Sendmail (obviously) 8.12.10
Redhat Linux
procmail
0
 
LVL 34

Expert Comment

by:PsiCop
Comment Utility
OK, sendmail v8.12.10. Not bad. I assume you inherited this server?

sendmail can be configured to look for .forward files in almost any place on the local machine (and, I imagine, in remote-mounted filesystems as well).

If you use the .mc file method of sendmail configuration (and you should), then the confFORWARD_PATH definition defines what places sendmail checks for .forward files. My point here is that just checking the user's Home Directory is not sufficient if the sendmail daemon has been told to look other places.

Such redirection can be accomplished with a VirtualUser table as well. Look for FEATURE(`virtualusertable') in the sendmail.mc

Also, this can be done with an aliases file (generally found at /etc/mail/aliases)
0
 
LVL 34

Expert Comment

by:PsiCop
Comment Utility
Hello?
0
 
LVL 1

Author Comment

by:jsfald
Comment Utility
I looked at aliases and the virtualuser table and didn't find anything. There also was not a confFORWARD_PATH definition in the .mc file. The forwarding doesn't always take place now, only for the cron and log file emails. Is root always suppose to get those emails even if there is an entry in aliases for root to forward to another user? The other user also gets an amail.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 34

Expert Comment

by:PsiCop
Comment Utility
OK, without a confFORWARD_PATH entry in sendmail.mc (assuming that is the sendmail.mc that was used to build the *current, running* sendmail.cf), sendmail will only look for ~/.forward. Altho if an alternative delivery agent is used, such as FEATURE(LOCAL_PROCMAIL), then sendmail doesn't handle final delivery and the rules that apply are whatever ones the local delivery agent uses.

cron job outputs are supposed to be sent to whichever user owns the cron job. Exactly how delivery is accomplished I'm not sure, altho from the design standpoint, I note that cron cannot depend on sendmail to be running, so cron may be depositing the files directly into the user's mail queue (/var/mail/<username>) as opposed to using a delivery agent like sendmail. That would bypass any .forward or aliases.
0
 
LVL 1

Author Comment

by:jsfald
Comment Utility
At the end of my .mc file I have a

MAILER(smtp)
MAILER(procmail)

Am I only suppose to have one of the two entries? Would this cause duplicate emails to be received? (This is another problem I just noticed. I sent an email from "localhost" from one user to root and two messages were received by the "alias" user.)
0
 
LVL 34

Accepted Solution

by:
PsiCop earned 100 total points
Comment Utility
Ah. Well, that is a little off...or at least non-standard.

According to the sendmail docs I've read, the *minimum* entries should be:

MAILER(SMTP)dnl
MAILER(LOCAL)dnl

and they should appear at the end of the file.

Its my understanding, if ProcMail is to be used, the proper way to do it in sendmail v8.12.x is:

FEATURE(LOCAL_PROCMAIL)dnl

That assumes ProcMail is in /usr/local/procmail - if it is elsewhere, then use:

FEATURE(LOCAL_PROCMAIL,`/path/to/procmail')dnl

Note I'm doing this entirely from memory, so verify my syntax with your sendmail docs.

Since you lack

MAILER(LOCAL)dnl

I dunno how sendmail is resolving the local delivery. I suspect aliases and ~/.forwards are being ignored entirely in favor of /etc/.procmailrc and/or ~/.procmailrc
0
 
LVL 1

Author Comment

by:jsfald
Comment Utility
My path to procmail is /usr/bin/procmail. The line in sendmail read, FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u $f' )dnl
I changed it to just read FEATURE(`local_procmail') and re-compiled the configuration file.
My initial tests indicate that the problem is solved. Thanks for you help.

0
 
LVL 34

Expert Comment

by:PsiCop
Comment Utility
If your ProcMail install is in /usr/bin/procmail and you put in the standard sendmail macro FEATURE(LOCAL_PROCMAIL) with no path spec, then you may have broken ProcMail. Just FYI.
0
 
LVL 1

Author Comment

by:jsfald
Comment Utility
Thanks, I added and tested it just to be safe. Thanks again.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now