niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Apps » Qmail
Forwarding spec. users w/o local domain
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
Author Message
Ted Fines
*nix forums addict


Joined: 21 Jan 2005
Posts: 73

PostPosted: Wed Jun 28, 2006 11:50 am    Post subject: Forwarding spec. users w/o local domain Reply with quote

Hi,

Our system: netqmail-1.05 on RHEL4.

I have a 'gateway' qmail system. It delivers nothing locally, and just does some filtering and logging before passing all messages through. "locals" contains only "LOCALHOST", and there are no virtual domains. "smtproutes" contains the line "macalester.edu:141.140.1.31:26", and "rcpthosts" contains "macalester.edu".

I'd like to do something I would think is very simple and possible, but I am stuck. I would like to setup some user forwards on this system. For example, if a message comes in for "user1@macalester.edu" I would like to be able to set a forward for that address to "something@hotmail.com" or wherever. I would like to have a file with entries like:
user1@macalester.edu:something@hotmail.com
user45@macalester.edu:something.else@adifferent.edu
....and so on... Of course I don't care about the syntax, but you get the idea. All other addresses would just follow the rule in smtproutes.

Here's the line of thinking I've been following and the conclusions I've come to.
1. Since no mail is delivered locally, creating local user qmail accounts with .qmail files has no effect.
2. The moresmtproutes patch is not applicable here because it is for forwarding a given address to a specific destination host, not a specific destination address.
3. Since no mail is delivered locally, the ~alias/.qmail-default file isn't processed either. I had tried populating that file wth the line "| /var/qmail/bin/fastforward -d /etc/aliases.cdb", created an aliases file, installed fastforward, etc., but it just doesn't get used.

I was thinking one option would be to change qmail's locals file to include "macalester.edu", create accounts only for the users with forwards, then create a line in ~alias/.qmail-default to send everything else on to 141.140.1.31:26, as I currently have in my smtproutes file? That seems possible, but what would such a line look like?

Thanks in advance,
Ted
Back to top
Thomas Raef
*nix forums beginner


Joined: 10 Apr 2006
Posts: 21

PostPosted: Wed Jun 28, 2006 12:18 pm    Post subject: RE: Forwarding spec. users w/o local domain Reply with quote

I believe you could use qmailtap http://www.inter7.com/?page=qmailtap

This will give you the functionality you seek and you can use it exactly
as you have envisioned.

-----Original Message-----
From: Ted Fines [mailto:fines@macalester.edu]
Sent: Wednesday, June 28, 2006 6:51 AM
To: qmail_mailing_list
Subject: Forwarding spec. users w/o local domain

Hi,

Our system: netqmail-1.05 on RHEL4.

I have a 'gateway' qmail system. It delivers nothing locally, and just
does some filtering and logging before passing all messages through.
"locals" contains only "LOCALHOST", and there are no virtual domains.
"smtproutes" contains the line "macalester.edu:141.140.1.31:26", and
"rcpthosts" contains "macalester.edu".

I'd like to do something I would think is very simple and possible, but
I am stuck. I would like to setup some user forwards on this system.
For example, if a message comes in for "user1@macalester.edu" I would
like to be able to set a forward for that address to
"something@hotmail.com" or wherever. I would like to have a file with
entries like:
user1@macalester.edu:something@hotmail.com
user45@macalester.edu:something.else@adifferent.edu
....and so on... Of course I don't care about the syntax, but you get the
idea. All other addresses would just follow the rule in smtproutes.

Here's the line of thinking I've been following and the conclusions I've
come to.
1. Since no mail is delivered locally, creating local user qmail
accounts with .qmail files has no effect.
2. The moresmtproutes patch is not applicable here because it is for
forwarding a given address to a specific destination host, not a
specific destination address.
3. Since no mail is delivered locally, the ~alias/.qmail-default file
isn't processed either. I had tried populating that file wth the line
"| /var/qmail/bin/fastforward -d /etc/aliases.cdb", created an aliases
file, installed fastforward, etc., but it just doesn't get used.

I was thinking one option would be to change qmail's locals file to
include "macalester.edu", create accounts only for the users with
forwards, then create a line in ~alias/.qmail-default to send everything
else on to 141.140.1.31:26, as I currently have in my smtproutes file?
That seems possible, but what would such a line look like?

Thanks in advance,
Ted
Back to top
Ted Fines
*nix forums addict


Joined: 21 Jan 2005
Posts: 73

PostPosted: Wed Jun 28, 2006 1:00 pm    Post subject: RE: Forwarding spec. users w/o local domain Reply with quote

--- Original Message ---
Quote:
I'd like to do something I would think is very simple and
possible, but
I am stuck. I would like to setup some user forwards on this
system.
For example, if a message comes in for "user1@macalester.edu"
I would
like to be able to set a forward for that address to
"something@hotmail.com" or wherever. I would like to have a
file with
entries like:
user1@macalester.edu:something@hotmail.com
user45@macalester.edu:something.else@adifferent.edu
...and so on... Of course I don't care about the syntax, but
you get the
idea. All other addresses would just follow the rule in
smtproutes.

--- Original Message ---
I believe you could use qmailtap http://www.inter7.com/?page=qmailtap


This will give you the functionality you seek and you can use
it exactly
as you have envisioned.

Thanks. I'd not really looked at that patch before. I think it is close to what I need, but not quite. The specific addresses I'd like to *forward* to, not send a copy to. The normal destination system named in smtproutes will not accept messages for these users. So if I used qmailtap, the user would receive a forwarded copy, but the sender would also receive a failure notice. If I have this wrong, please let me know!

Thanks,
Ted
Back to top
Thomas Raef
*nix forums beginner


Joined: 10 Apr 2006
Posts: 21

PostPosted: Wed Jun 28, 2006 1:03 pm    Post subject: RE: Forwarding spec. users w/o local domain Reply with quote

No, I believe you are correct. I think it will deliver to the original
and send a copy to the other address.

Sorry.

-----Original Message-----
From: Ted Fines [mailto:fines@macalester.edu]
Sent: Wednesday, June 28, 2006 8:00 AM
To: qmail_mailing_list
Subject: RE: Forwarding spec. users w/o local domain

--- Original Message ---
Quote:
I'd like to do something I would think is very simple and
possible, but
I am stuck. I would like to setup some user forwards on this
system.
For example, if a message comes in for "user1@macalester.edu"
I would
like to be able to set a forward for that address to
"something@hotmail.com" or wherever. I would like to have a
file with
entries like:
user1@macalester.edu:something@hotmail.com
user45@macalester.edu:something.else@adifferent.edu
...and so on... Of course I don't care about the syntax, but
you get the
idea. All other addresses would just follow the rule in
smtproutes.

--- Original Message ---
I believe you could use qmailtap http://www.inter7.com/?page=qmailtap


This will give you the functionality you seek and you can use
it exactly
as you have envisioned.

Thanks. I'd not really looked at that patch before. I think it is
close to what I need, but not quite. The specific addresses I'd like to
*forward* to, not send a copy to. The normal destination system named
in smtproutes will not accept messages for these users. So if I used
qmailtap, the user would receive a forwarded copy, but the sender would
also receive a failure notice. If I have this wrong, please let me
know!

Thanks,
Ted
Back to top
Kyle Wheeler
*nix forums Guru Wannabe


Joined: 07 Jan 2005
Posts: 208

PostPosted: Wed Jun 28, 2006 1:45 pm    Post subject: Re: Forwarding spec. users w/o local domain Reply with quote

On Wednesday, June 28 at 06:50 AM, quoth Ted Fines:
Quote:
I'd like to do something I would think is very simple and possible,
but I am stuck. I would like to setup some user forwards on this
system. For example, if a message comes in for
"user1@macalester.edu" I would like to be able to set a forward for
that address to "something@hotmail.com" or wherever. I would like to
have a file with entries like:
user1@macalester.edu:something@hotmail.com
user45@macalester.edu:something.else@adifferent.edu
...and so on... Of course I don't care about the syntax, but you get the idea. All other addresses would just follow the rule in smtproutes.

From the man page of qmail-send:

virtualdomains
List of virtual users or domains, one per line. A virtual user
has the form user@domain:prepend, without any extra spaces.
When qmail-send sees the recipient address user@domain, it
converts it to prepend-user@domain and treats it as local.

So what you do is put:

user1@macalester.edu:forward1

…into your virtualdomains file. Then create a file,
~alias/.qmail-forward1-default that contains:

&something@hotmail.com

Presto, you’re done. No patches needed.

~Kyle
--
Strong coffee, much strong coffee, is what awakens me. Coffee gives me
warmth, waking, an unusual force and a pain that is not without very
great pleasure.
-- Napoleon Bonaparte
Back to top
Jeremy Kitchen
*nix forums Guru Wannabe


Joined: 14 Jan 2005
Posts: 212

PostPosted: Wed Jun 28, 2006 5:07 pm    Post subject: Re: Forwarding spec. users w/o local domain Reply with quote

On Wednesday 28 June 2006 04:50, you wrote:
Quote:
I have a 'gateway' qmail system. It delivers nothing locally, and just
does some filtering and logging before passing all messages through.
"locals" contains only "LOCALHOST", and there are no virtual domains.
"smtproutes" contains the line "macalester.edu:141.140.1.31:26", and
"rcpthosts" contains "macalester.edu".

I'd like to do something I would think is very simple and possible, but I
am stuck. I would like to setup some user forwards on this system. For
example, if a message comes in for "user1@macalester.edu" I would like to
be able to set a forward for that address to "something@hotmail.com" or
wherever. I would like to have a file with entries like:
user1@macalester.edu:something@hotmail.com
user45@macalester.edu:something.else@adifferent.edu
...and so on... Of course I don't care about the syntax, but you get the
idea. All other addresses would just follow the rule in smtproutes.

well there are a couple of ways you can do it. one of them being similar to
what you described:

1) set up a virtualdomain, let's say your line looks like:
macalester.edu:macalester
in ~macalester/.qmail-default put a line like:
|forward "$default@int.macalester.edu"
then set up your other mail server to accept mail destined for
int.macalester.edu as the same as macalester.edu
then for each forward you want to add, simply make ~macalester/.qmail-luser
files for them.

2) same virtualdomain as above, but slightly different:
use a second qmail instance in the machine.. let's say /var/qmail2
instead of simply |forward, you'd use:
|/var/qmail2/bin/forward "$default@macalester.edu"
then your other /var/qmail2 instance is configured with no virtualdomains, and
the smtproutes is the same as it is now.

3) set up a 'virtualdomain' for each user:
one of the features(?) of qmail's virtualdomain system is that you have
user-level granularity on the virtualdomains file. So, let's say you want to
forward postmaster@macalester.edu and abuse@macalester.edu to
ted@example.com. You would create a virtualdomains file like:
postmaster@macalester.edu:macalester-ted
abuse@macalester.edu:macalester-ted
and then you'd create ~macalester/.qmail-ted with your forward. This requires
no internal domain, no second qmail instance, but will make for a slightly
larger virtualdomains file, and will also require sending a HUP to qmail-send
after each forward is added or removed.

-Jeremy



Quote:
Thanks in advance,
Ted

--
Jeremy Kitchen ++ kitchen@scriptkitchen.com

http://www.pirate-party.us/ -- defend your rights
Back to top
Ted Fines
*nix forums addict


Joined: 21 Jan 2005
Posts: 73

PostPosted: Tue Jul 11, 2006 2:26 pm    Post subject: Re: Forwarding spec. users w/o local domain Reply with quote

--- Original Message ---
Quote:
On Wednesday, June 28 at 06:50 AM, quoth Ted Fines:
I'd like to do something I would think is very simple and possible,
but I am stuck. I would like to setup some user forwards on this
system. For example, if a message comes in for
"user1@macalester.edu" I would like to be able to set a forward for
that address to "something@hotmail.com" or wherever. I would like to
have a file with entries like:
user1@macalester.edu:something@hotmail.com
user45@macalester.edu:something.else@adifferent.edu
...and so on... Of course I don't care about the syntax, but you get the idea. All other addresses would just follow the rule in smtproutes.

From the man page of qmail-send:

virtualdomains
List of virtual users or domains, one per line. A
virtual user
has the form user@domain:prepend, without any extra
spaces.
When qmail-send sees the recipient address user@domain,
it
converts it to prepend-user@domain and treats it as
local.

So what you do is put:

user1@macalester.edu:forward1

?into your virtualdomains file. Then create a file,
~alias/.qmail-forward1-default that contains:

&something@hotmail.com

Presto, you?re done. No patches needed.

~Kyle

Great. Worked perfectly, thanks.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 1:16 pm | All times are GMT
navigation Forum index » Apps » Qmail
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts spoofed local email addresses watkykjy Postfix 0 Thu Nov 20, 2008 8:49 am
No new posts Postfix relay to specific domain and to everybody else golgotha Postfix 0 Thu Oct 23, 2008 11:11 pm
No new posts Need to convert domain name before relaying jfinn Postfix 0 Tue Sep 16, 2008 12:51 pm
No new posts Filtering internal mail and forwarding to another domain fmaa1 Postfix 0 Wed Apr 30, 2008 12:50 pm
No new posts Postfix sending problem for local domain remote email monkey_magix Postfix 0 Mon Sep 10, 2007 10:17 am

Debt Consolidation | Repair Bad Credit | Loans | Loans | Credit Cards
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2305s ][ Queries: 16 (0.1213s) ][ GZIP on - Debug on ]