Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Regarding Postfix and local Delivery I have a strange request. I dont want postfix to deliver mail locally, I want all mail to go out via the internet even if it is for a user on the local box.
Therefore if user1@company.com sends to user2@company.com it must go via the internet and ISP.
The reason I want to do this is that I use fetchmail to retrieve mail for some of the users from our ISP, that are based locally, but some of the users are based remotly, even though they have the same @companyname.com address.
well i assume you'd simply not set the $mydomain variables so it didn't class anything as being local, and instead just relay anything from your trusted sources of destinations.
would it not be a better approach to look at letting your remote users use pop3 though? if your internet connectivity is as reliable as your ISP's (or near enough) then how do you benefit sending it all back to an isp?
Thanks for the quick replies, basically this is how it is setup.
We have 10 users which have the user@company.com email address, they are all located at the HQ, we then have approximatly 50 users all over the country with the user@company.com address. These remote users use POP3 to download mail from the ISP (so that is fine), Now when the users inside HQ wanted to send mail to one of the users that was remote, it would give a "550 error user not found in local table" (or something like that), so we added all the remote users on the main server at the HQ, now when we send mail internally it goes to the local user on the server and the people that get their mail from the ISP don't receive it, because it is sitting on the local server.
SP how do I specify which users mail should stay on the local Server and which users mail should go to the ISP, even though their @company.com is the same??
as much as i'm aware it's not what you're actually asking for, i really would suggest exploring serving pop3 from your own site directly. i can't see a downside to this and it massively simplifies things... is there a real reason you can't do this?
Well the main reason is I have a ADSL, which has a dynamic IP address.So the server uses fetchmail to collect the mail.
Also if I serve the POP3 I need a static IP address for all the users to connect to, as the company is a Non-Profit Organization they need to save $$$ where ever they can.(in South Africa Broadband is very expensive)
I have tried the DynDNS update service, to assign a domain to my dynamic IP address,but it causes problems and lags when the DNS is updated, can take up to 4 hours to show the correct DNS entries and therefore mail goes missing.
I some how need to send some mail internally, for the users that are at the HQ, and the rest needs to go to their POP mail boxes at the ISP even though they have the same @company.com address
dynamic? how dynamic actually is it? if the router is online you should really see no change... i'd suggest trying an alternative service, maybe like zoneedit.com, they've been great for me, and updated really fast, although naturally it's out of their hands once a downstream dns decides to hold a cache. i'm sure there are other simple ways around the dynamicness though, if it's only for connectivity from certain clients.
Now when the users inside HQ wanted to send mail to one of the users that was remote, it would give a "550 error user not found in local table" (or something like that)
You can still have local users' mail delivered locally and the rest delivered offsite:
In main.cf:
I dont think I am being clear enough.I have 14 users that collect their mail from a local mail server that uses fetchmail to go and fetch the mail from an ISP.
The other 50 users go directly to the ISP to collect mail.(these other 50 users are situated around the country).All these users all 64 of them have the same email address eg, shawn@company.com
Now when the users at the HQ (14 users ) send to one of the other external users I get this error
Oct 20 09:35:15 UPCSAMAIL postfix/smtpd[6305]: NOQUEUE: reject: RCPT from unknown[192.168.0.45]: 550 <mailadmin@presbyterian.org.za>: Recipient address rejected: User unknown in local recipient table; from=<itadmin@presbyterian.org.za> to=<mailadmin@presbyterian.org.za> proto=SMTP helo=<BACKUPSERVER>
Oct 20 09:35:15 UPCSAMAIL postfix/smtpd[6305]: disconnect from unknown[192.168.0.45]
That is because the user is not on the local Server.I need postfix to ignore this and send the mail out anyway and not look at a local user.Or look at local users, and if it isnt present in a table of some sort, send the mail out via the Internet.
That way the mail will be delivered to the mailbox on the ISP server.
By the way my hostname is UPCSA.presbyterian.org.za
this is defined by $hostname and my $domain is presbyterian.org.za
Regards
Shawn
Last edited by shawnbishop; 10-20-2006 at 03:46 AM.
Sounds to me like Berhanie does what you want. Note that you don't need a table of local users, because Postfix will automatically check the user file.
If I read that post correctly, local users' mail will be delivered directly to their inboxes without going via the isp/fetchmail, but non local users will go to the isp.
If not, try something like
transport_maps = hash:/etc/postfix/transport
in main.cf
and
in transport_maps, have
example.com smtp:mail.at.your.isp
where your domain is example.com and your ips's mail server is mail.at.your.isp
Have a look at
man transport
Last edited by billymayday; 10-20-2006 at 05:05 AM.
$ man 5 postconf
...
fallback_transport (default: empty)
Optional message delivery transport that the local(8)
delivery agent should use for names that are not found in
the aliases(5) or UNIX password database.
...
Step2:
Make sure that your domain (ie: example.com) is listed as a relay domain. This means that Postfix will accept the responsibility to deliver this email, but instead of delivering it locally, it will forward it to another mail host (ie: your ISP's MX host). The magic parameter here is "relay_domains".
To view what it is currently set to.
Code:
postconf relay_domains
To set it to example.com:
Code:
postconf -e "relay_domains = example.com"
Step3:
Make sure Postfix knows which host to forward email to. The magic parameter here is "relay_transport".
To view what it is currently set to.
Code:
postconf relay_transport
To set it to your ISP's email server (ie:mx1.isp.com):
NOTE: The reason I put the hostname of your ISP's email server in [] brackets is to avoid an MX DNS lookup. In other words, since you already know the hostname of your ISP's email server, we don't want Postfix to do a DNS query everytime.
Step4:
Once you did this, make sure you don't have any overriding settings in your "transport_maps" file. This is an optional parameter (ie: not set by default), and I'd recommend unsetting it for now, to make sure mail is redirected elsewhere.
To view what it is currently set to.
Code:
postconf transport_maps
To set it back to the default value:
Code:
postconf -e "transport_maps = "
Step5:
Now that everything is set, refresh Postfix with
Code:
postfix reload
Or if it's not running, start it with
Code:
postfix start
Last edited by WindowBreaker; 10-20-2006 at 03:44 PM.
With your setup, the local users email leaves the building, so if the ADSL line is unplugged the local users dont get email as well, so not what I was looking for.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.