Operating System - HP-UX
1748095 Members
5713 Online
108758 Solutions
New Discussion юеВ

Two Domains, one expires soon, need an auto-responder.

 
SOLVED
Go to solution
Lee Hundley
Valued Contributor

Two Domains, one expires soon, need an auto-responder.

So I've got one sendmail server handling email for a domain, lets call it olddomain.net. I purchased newdomain.net awhile back, but olddomain.net doesn't expire until January. I've already sent out mass mailing telling users to update bookmarks, address books, etc.

Now heres the hitch:
I want sendmail to receive email for both domains (it already does this part), but I'd like it set up so that mail addressed to @olddomain.net still gets delivered as per normal, but I want a auto-responding message to be sent back to the originator, warning of domain expiration.

I had thought about using the virtusertable to reroute all mail to @olddomain.net to a specific account under newdomain.net. Then, use the aliases file to pipe that into a shell/perl script which will handle the auto-response and pass the mail to the appropriate user at newdomain.net.

Am I on the right path here, or am I overlooking something completely obvious?
It is my firm belief that it is a mistake to hold any firm beliefs
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Two Domains, one expires soon, need an auto-responder.

The first step you need to do is set up the expiring domain as a virutal domain.

Here a link that tells step by step how to do that. I'm copying an overengineered Linux script that will build the necessary sendmail .cf file from the sendmail.mc file.

Here is a link to an hpux version:

http://www.hpux.ws/buildmail.hpux.text

I really don't know how to set up an auto responder.

What I'd do is once a day cat the mail.log or maillog file and cull it for lines that contain the olddomain.net.

I'd then process that file and send out a generic message. You can even fancy up the script and have it check a database of whom it has sent messages to and only send the message one time.

The sendmail.org site also contains cookbooks on how to set up auto-responders.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Two Domains, one expires soon, need an auto-responder.

Just thought of something.

If your users use outlook express, you could have them set up an out of the office response message. You can change the message and have it respond to all inbound mail once with a warning message.

I'm attaching a perl script that could be a good starter for your auto-response message.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ermin Borovac
Honored Contributor
Solution

Re: Two Domains, one expires soon, need an auto-responder.

There's probably a better way but here's my suggestion.

Maybe you can use sendmail's built-in redirect feature.

The following would apply to the machine handling the old domain.

In /etc/mail/sendmail.cf make sure you have line

CPREDIRECT

In /etc/mail/aliases for each user have

: @.REDIRECT, @

When users send email to @ they would get notification "User had moved, please try @" and recipient would still receive the original message.

Lee Hundley
Valued Contributor

Re: Two Domains, one expires soon, need an auto-responder.

Sorry it took me so long to get back to this thread. I'm almost 100% sure that Ermin's method would work fine. However, I implemented something else before I caught his post. I wound up using my original idea of useing the virtusertable, aliases, and a perl script.

Changes are as folows, script is attatched:
/etc/mail/virtusertable:
@olddomain.net redir@newdomain.net

/etc/mail/aliases:
redir: "| /usr/local/bin/mailredir.pl"

There is one bug I've found thus far. If the message is addressed to more than one user@olddomain.net, it will only detect the first address in the list. I'm not sure how to get around this, but it's not a major concern since this is for a personal mail server. Suggestions welcome.
It is my firm belief that it is a mistake to hold any firm beliefs