LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Postfix Transport(5) (http://www.linuxquestions.org/questions/linux-software-2/postfix-transport-5-a-677108/)

Wheddod 10-17-2008 10:26 AM

Postfix Transport(5)
 
Hi all, now that i have postfix installed and working in a fasion i decided that i should be checking some of its other features. The one that strikes me as most useful is the transport file. But i currently don't know how to set it up. Would someone be able to help me?

Many Thanks in Advance
Dan

billymayday 10-18-2008 03:19 AM

Transport can do a lot of things. Here's an example.

In main.cf, you have the entry

Code:

transport_maps = hash:/etc/postfix/transport
or similar.

Now in my transport file, I have entries like:

Code:

fax.mydomain.com        fax:localhost
fax_ps.mydomain.com        fax_ps:localhost


In master.cf

Code:

fax    unix    -      n      n      -      1      pipe
  flags= user=fax argv=/usr/local/bin/faxmail -d -n ${user}

fax_ps    unix    -      n      n      -      1      pipe
  flags= user=fax argv=/etc/postfix/fax_ps -u ${user}

When a message is sent to user@fax.mydomain.com, the fax transport agent is called with the user (in this case the fax num,ber) as a parameter (fax_ps faxes a postscript file, the basic version faxes the mail body)

Hope that makes some sense.

Mr. C. 10-18-2008 03:21 AM

Set it up to do what?

Search transport here: http://www.postfix.org/STANDARD_CONF...ON_README.html for examples.

billymayday 10-18-2008 03:29 AM

I'm assuming he just wants to have a play

Wheddod 10-20-2008 08:09 AM

So if i wanted to redirect all internal mail to one destination and then have everything external going to another address, would i just have to vi /etc/postfix/transport then add a couple of lines in to the bottom of the file? Would the following lines suffice?

my.domain.com :[Internal.my.domain.com]
.my.domain.com :[external.my.domain.com]

Mr. C. 10-20-2008 11:15 AM

You would use a regexp or pcre map:

Code:

/^domain\.com$/  smtp:[Internal.my.domain.com]
/./              smtp:[external.ip]

If parent_domain_matches_subdomains is set, no need to list the extra subdomain pattern.


All times are GMT -5. The time now is 07:22 AM.