Solved

Rewriting a From Address in Sendmail V8

Posted on 2000-03-14
3
404 Views
Last Modified: 2010-04-21
How can I get sendmail to rewrite the from address.  As an example I have a  mail message going out with a from address of:
louis@life.com

I would like sendmail to rewrite the from address to bill@life.com.

No a replay to will not work.  The address is really an aliases to a list of people.   Maybe if there is a way to change the to address in to a bcc address and then create a replay to address that is the one I want???

Thanks,
Louis
0
Comment
Question by:brownjohn
3 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2616935
You could do it with a custom sendmail rule if the person part was always the same, but that's kind of a lot of work.

How about changing the alias to point to, say a perl script that reads the message, and remails it to the real alias list with what you want as the From: address? That's pretty simple and straight-forward (and I think I've got a perl script around somewhere that that does something awfully close to that)
0
 
LVL 1

Expert Comment

by:sereda
ID: 2620037
Hmm...

Will not
  sendmail -f from@address
do the trick?

Or do i miss something?

0
 
LVL 2

Accepted Solution

by:
mapc earned 200 total points
ID: 2620586
This could be accomplished by the USERDB
feature.
First, sendmail must be compiled with USERDB, this can be checked with sendmail -adda or some other bogus debug flag which will show the  compiled in modules.
If it's not, then you must recompile it.
Then, you use feature(`USERDB')dnl in the .m4 config file, and create a database which consists of:
user <space> mailname: anotheruser
Simple as that.
The sendmail 9.10.0 states that LDAP could be used for *any* database which is used in it, so I haven't verified it, but it should be possible with sendmail 9.10.0 to use LDAP database instead of USERDB which is in DB2 format.
Another use for USERDB is creating entries like:
user<space> maildrop: anotheruser@anotherhost
which accomplishes something similar to aliases/forwarding..
Other way to accomplish what you want is to write manual rule for sender address.
It should have F and 'i' and '@' if I'm not mistaken, but this sort of information should be checked in the book.
Hope that it helps.
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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

757 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

22 Experts available now in Live!

Get 1:1 Help Now