Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Users with Remote Addresses

Status
Not open for further replies.

nbjayme

Programmer
Jun 25, 2002
13
PH
Hello Ppl,

:)

I'm a newbie on qmail and I was able to set it up according to "Life With Qmail" guide.

I have some users with remote emails, say for example :

sue@internetmail.com

How do I configure qmail to treat sue@internetmail.com to become local mail sue@ourcompany.com?
That way any mails from local connection going to sue@internetmail.com will be treated locally.

In addition to that, any mails going to internetmail.com that is not for sue will be treated as remotemails; say:

someguy@internetmail.com

Also when user sue sends an email for remote destination the address will be sue@intenetmail.com not sue@mycompany.com

My other users also have different remote email address and I want it to behave just like sue's; say for example:

mike@remotemail.com
jan@freepop.com

Thanks for the help.

NBJayme :)

 
Just a follow up.

My system is Linux (Fedora Core 1)

NBJayme ;)
 
If you do not control the entire email domain, you cannot do this. Sue@internetmail.tld must use a service at THEIR end to forward the email BACK to you as another email address.

If you DID have full control of hosting that domain you could use .qmail forwarding files to accomplish this easily.

 
hello,
Thanks for the reply.

If I could just fill in some more details:

- I have created a local domain ourcompany.com

- Our connection is behind a modem.

- Users have different pop accounts in the internet

i.e. pop.freepop.com
pop.internetmail.com
If there are any mails sent to :
sue@internetmail.com
pedro@freepop.com
it should be treated locally or delivered on their
local Maildir.

- Any mails from local going to internetmail.com and
freepop.com shall be sent remotely if not for sue and
pedro email address.

- I want sue and pedro to maintain their remote email
address in the 'From:' or 'Reply-to:' field when they
send mails. That way they can be certain that mails
from remote users will be sent to their internet mails
at pop.freepop.com and pop.internetmail.com and fetch
by fetchmail.

I'm still having trouble with .qmail files. If it could help me, I would appreciate anybody showing me how I could accomplish the above.

NBJayme :)

 
- Users have different pop accounts in the internet

i.e. pop.freepop.com
pop.internetmail.com
If there are any mails sent to :
sue@internetmail.com
pedro@freepop.com
it should be treated locally or delivered on their
local Maildir.


** You cannot do this because you do not own those domains!
IF you define them as local, then you won't be able to deliver to their remote boxes. You need to set an alias on those domains remotely using whatever tools those providers offer.

Why aren't you setting up Sue and Pedro to open that other account as part of their client software?



 
Hello thedaver,

Thanks for the prompt reply.

**** "Why aren't you setting up Sue and Pedro to open that other account as part of their client software?"

We connect through modem and we want (Sysadmins) to be able to have full control of the time when remote mails are fetch say every 45 minutes or so.

Thus, we sadly, cannot give the feature of polling remote mails to the client.

**** "
i.e. pop.freepop.com
pop.internetmail.com
If there are any mails sent to :
sue@internetmail.com
pedro@freepop.com
it should be treated locally or delivered on their
local Maildir.

** You cannot do this because you do not own those domains!
"

I understand that I cannot directly get mails for those domains above. So, I'd use fetchmail to get it and settings from my qmail will deliver it to sue's and pedro's local mailbox in our domain.

I was able to set up a virtual domain internetmail.com. Any mails sent to sue@internetmail.com will go to her local mailbox. But I'm having a problem on how to setup qmail of treating mails for internetmail.com, not for sue, as remote mails.

Probably the easiest(?) way it to be able to know the recipient of the mail through script and direct it to locals maildir of my known users. I know that .qmail can execute commands but I'm not so sure about the environment variables to catch nor how to create such script being a newbie to qmail and linux.

NBJayme
 
You cannot forward from a locally faked copy of a domain "internetmail" to the real, external instance of the same domain.

Qmail treats a domain as entirely local or entirely remote. You were trying to use .qmail files to selectively forward through that domain and you just cannot do that...

Think about the rules:

1) All deliveries to domain "internetmail.com" are local (using /var/qmail/locals)
2) All deliveries to user "sue" are remote forwards using a .qmail file
3) All other deliveries are remote to the same domain you defined as local.

Qmail cannot support this.

You would do better to use scheduled fetchmail runs against the remote domain's POP3 accounts to bring that mail into the accounts of "sue" and "pedro".

If you are using SMTP-AUTH on your SMTP outbound, you can fake the From and Reply-to fields for "sue" and "pedro" to appear to be from the external domain. The headers will reveal your qmail as the real source. This is likely to trigger certain spam filters which require these fields to match.

 
hello thedaver,

I have engrossed myself on configuring qmail and I think I am now on track to the solution.

You're right about the dot-qmail files, it does solve my problem.

Okay here it goes:

My Problem:

I am behind a dial-up connection.

my local domain is ourcompany.com.

but sue and pedro has an external pop address

sue@internetmail.com
pedro@remotemail.com

and I want them to maintain that address.
sue@internetmail.com & sue@ourcompany.com is one mailbox
pedro@remotemail.com & perdro@ourcompany.com is one mailbox


The Solution:

I could set up a virtual domain and somehow add entries in users/assign file but that would be too much to maintain.

I need to somehow have a way to allow more than one email address per user without having to resolve to virtual domains. Let us say "virtual emails" not "virtual domains".

I placed this line to the control/virtualdomains file.
:alias-unresolved

and created a maildir in ~alias
# cd /var/qmail/alias
# /var/qmail/bin/maildirmake ./unresolved

created a dot-qmail-default file
# vi .qmail-default
--- contents of file ---
./unresolved/
|/var/alias/unresolved.php.script
--- end of contents ----

(more about the script later)

and remember to chown it to user alias
chown alias unresolved -Rf
chown alias .qmail-unresolved

All mails not locally known or unresolved by qmail shall be placed in /var/qmail/alias/unresolved/new

What's left for me to do now is create a script (/var/qmail/alias/unresolved.php.script) that checks the second line of each mails and store it to the correct maildir of my known users. An additional control file is needed with emailaddress : uid : gid: directory.

Thanks for your inputs.

nbjayme :)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top