Google Answers Logo
View Question
 
Q: Sendmail address rewriting ( No Answer,   2 Comments )
Question  
Subject: Sendmail address rewriting
Category: Computers > Internet
Asked by: kudithipudi-ga
List Price: $40.00
Posted: 30 May 2005 19:15 PDT
Expires: 29 Jun 2005 19:15 PDT
Question ID: 527507
I am having some issues with the sendmail config on one of my servers.
I have several domains defined in the sedmail.cw file. When the server
was originally configured, it was never intended to host more than one
domain. So all the aliases for the initial domain (say a.com) were
created in the aliases file. Once new domains started to be added to
the servers, I started using the virtualusers file for creating
aliases (say foo@b.com). The problem is when users from a.com domain
as sending e-mails to users at b.com, the from address is being
rewritten to @a.com address. For example if foob@b.com is sending an
e-mail to fooa@a.com, the from address is being changed to
foodb@a.com. This does not happen when the e-mail is being sent to
other domains not hosted on this server. On a side note, the
MASQUERADE_AS option in the sendmail.mc is set to "a.com".

Is there a special rewriting rule I need to add to the sendmail config
file? Thank you.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Sendmail address rewriting
From: exileonmain-ga on 29 Jun 2005 05:38 PDT
 
After you change your virtualusertable you need to rehash sendmail. 
I'm going post a script (which you may need to change the path to the
virtualusertable) and it will fix you up.  Also, you need to ensure
that your domains are listed in your local-host-names file.  If you
don't have one, you should create one in your mail dir (example:
/etc/mail).


Just copy the script and put it into a shell file (.sh) on your
server.  Chmod it and your all done.

Paste from here ...


#!/bin/sh

if [ "$1" = "-h" -o "$1" = "-h" ]; then
	echo "Usage: $0 [-v | -h]"
	echo "  -v: show actual output"
	echo "  -h: show this screen"
	exit
fi

if [ "$1" = "-v" ]; then
	newaliases
	makemap -v hash /etc/mail/virtusertable < /etc/mail/virtusertable
else
	echo -n "Updating aliases.. "
	newaliases 1>/dev/null 2>&1
	echo "done"
	echo -n "Updating virtual user table.. "
	makemap -v hash /etc/mail/virtusertable < /etc/mail/virtusertable 1>/dev/null 2>&1
	echo "done"
fi
echo -n "Sending HUP to sendmail.. "
killall -HUP sendmail
echo "done; update complete."
Subject: Re: Sendmail address rewriting
From: exileonmain-ga on 29 Jun 2005 06:02 PDT
 
If you have problems putting up that script, or have questions about
it, you can email me: exileonmain@gmail.com

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy