Re: relaying mail

2007-08-01 Thread Derek Ragona

At 05:19 PM 7/31/2007, Christopher Cowart wrote:

On Tue, Jul 31, 2007 at 08:03:50PM +0200, Michael Grant wrote:
 In one of my domains, I have the MX record for it set up to my server.
  But for one of the users within that domain, their mail needs to be
 shuffled off to a different server at google.  But I can't just
 forward it because it's like an MX host I'd need to forward it to.
 And I can't alter the MX to point to google for the entire domain
 because it's only one user within that domain, the other users will be
 screwed in that case.

 For example, mydomain.com, let's say the mx for that comes to my box.
 For [EMAIL PROTECTED], I need to send his mail to ASPMX.L.GOOGLE.COM as
 if it were the MX for mydomain.com.

 In the old days, one would simply forward email to
 [EMAIL PROTECTED]  That would cause mydomain.com's
 sendmail to connect to ASPMX.L.GOOGLE.COM and shove down a message for
 [EMAIL PROTECTED]  But that seems long deprecated because it didn't
 seem to work.

 I am using sendmail and procmail.  Can anyone think of some way I can
 cause something like this to happen for just one user, ideally in a
 .procmailrc file?


You can do this with sendmail by user in /etc/mail/virtualusertable.  You 
should see the file /etc/mail/virtualusertable.sample for some explanations 
of this file.  The virtualuser database is read first by sendmail, before 
aliases.  Also the virtualusertable is read serially from top to bottom, so 
you can specific user maps before a general map for the rest of a domain.


-Derek

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: relaying mail

2007-07-31 Thread Christopher Cowart
On Tue, Jul 31, 2007 at 08:03:50PM +0200, Michael Grant wrote:
 In one of my domains, I have the MX record for it set up to my server.
  But for one of the users within that domain, their mail needs to be
 shuffled off to a different server at google.  But I can't just
 forward it because it's like an MX host I'd need to forward it to.
 And I can't alter the MX to point to google for the entire domain
 because it's only one user within that domain, the other users will be
 screwed in that case.
 
 For example, mydomain.com, let's say the mx for that comes to my box.
 For [EMAIL PROTECTED], I need to send his mail to ASPMX.L.GOOGLE.COM as
 if it were the MX for mydomain.com.
 
 In the old days, one would simply forward email to
 [EMAIL PROTECTED]  That would cause mydomain.com's
 sendmail to connect to ASPMX.L.GOOGLE.COM and shove down a message for
 [EMAIL PROTECTED]  But that seems long deprecated because it didn't
 seem to work.
 
 I am using sendmail and procmail.  Can anyone think of some way I can
 cause something like this to happen for just one user, ideally in a
 .procmailrc file?

We use postfix and transport maps to accomplish this for internal mail
routing (bugzilla and RT messages go to an internal web server, user
messages to our internal mailserver).

The map would look something like:
[EMAIL PROTECTED]smtp:[ASPMX.L.GOOGLE.COM]
mydomain.comlocal

I don't know how to accomplish similar routing with sendmail.

In order to solve this completely at the user level, you could write a
little bit of perl that opens an SMTP connection to the server of your
choosing. You could then use .forward or .procmailrc or whatever to pipe
the incoming messages to this script. 

Good luck,

-- 
Chris Cowart
Lead Systems Administrator
Network  Infrastructure Services, RSSP-IT
UC Berkeley


signature.asc
Description: Digital signature


Re: relaying mail

2007-07-31 Thread RW
On Tue, 31 Jul 2007 20:03:50 +0200
Michael Grant [EMAIL PROTECTED] wrote:

 In one of my domains, I have the MX record for it set up to my server.
  But for one of the users within that domain, their mail needs to be
 shuffled off to a different server at google.  But I can't just
 forward it because it's like an MX host I'd need to forward it to.
 And I can't alter the MX to point to google for the entire domain
 because it's only one user within that domain, the other users will be
 screwed in that case.
 
 For example, mydomain.com, let's say the mx for that comes to my box.
 For [EMAIL PROTECTED], I need to send his mail to ASPMX.L.GOOGLE.COM as
 if it were the MX for mydomain.com.
 
 In the old days, one would simply forward email to
 [EMAIL PROTECTED]  That would cause mydomain.com's
 sendmail to connect to ASPMX.L.GOOGLE.COM and shove down a message for
 [EMAIL PROTECTED]  But that seems long deprecated because it didn't
 seem to work.
 
 I am using sendmail and procmail.  Can anyone think of some way I can
 cause something like this to happen for just one user, ideally in a
 .procmailrc file?


I'm not really sure what you asking here, ASPMX.L.GOOGLE.COM doesn't
even have an mx record. If this person has a gmail account, just forward
it to his gmail address, IIRC he has to configure the [EMAIL PROTECTED]
address as one of his own addresses to prevent google seeing it as spam.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]