Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

Where to set aliases / forward email to different user

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
jsfald
Asked:
jsfald
  • 6
  • 5
1 Solution
 
PsiCopCommented:
Well, what OS, version and MTA? We're Experts, not mindreaders.
0
 
jsfaldAuthor Commented:
My expectations of your mind reading powers have been greatly diminished. =)

Sendmail (obviously) 8.12.10
Redhat Linux
procmail
0
 
PsiCopCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
PsiCopCommented:
Hello?
0
 
jsfaldAuthor Commented:
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
 
PsiCopCommented:
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
 
jsfaldAuthor Commented:
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
 
PsiCopCommented:
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
 
jsfaldAuthor Commented:
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
 
PsiCopCommented:
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
 
jsfaldAuthor Commented:
Thanks, I added and tested it just to be safe. Thanks again.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now