LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Postfix - relay mail to internet for specified users (https://www.linuxquestions.org/questions/linux-software-2/postfix-relay-mail-to-internet-for-specified-users-303117/)

FatOldSun 03-18-2005 06:26 AM

Postfix - relay mail to internet for specified users
 
A company network has one catch-all mailbox at their ISP, and 3-4 more mailboxes for users who work remotely. The catch-all mailbox is being collected by fetchmail and delivered by Postfix to the correct user from the /etc/mail/aliases file. Let's say for this example that the domain is example.co.uk, and that one of the remote users has an address remoteuser1@example.co.uk. However this remote user has been set up as a user on the server as he sometimes visits the office and needs to access files on the server.

At the moment this is a problem, as any mail sent to him from within the company network is being sent via the server, which then recognises it as a local domain and doesn't relay it to the ISP's SMTP server, it just puts it into his server mailbox. Is there a way, using Postfix, that you can specify that mail for given users is to be treated as non-local and sent to the ISP rather than the local mailbox?

Berhanie 03-19-2005 12:57 AM

So, if I understand you correctly:

Mail originating outside the company network and addressed to remoteuser1@example.co.uk gets stored on the ISP's server, while mail originating within the company network addressed to the same gets stored on the local (company) server.

If so, then something like this should work (I think):

In main.cf, set transport_maps:
Code:

transport_maps = hash:/etc/postfix/transport
Add this line to /etc/postfix/transport:
Code:

remoteuser1@example.co.uk      smtp:smtp.isp.com
where smtp.isp.com is the name of your ISP's smtp server.

Make the transport database:
Code:

# postmap /etc/postfix/transport

FatOldSun 03-21-2005 03:32 AM

Yes that's exactly what I want to do. I'll test this out. Thanks for your help.


All times are GMT -5. The time now is 02:08 PM.