Find the answer to your Linux question:
Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By rafaelrssa
My postfix (v2.6.6) outgoing email trafic is routed to a specific smarthost for antispam purposes by "main.cf" configuration (relayhost = relayserverFQDN), but i need to exclude this relay to specifics ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2013
    Posts
    3

    Postfix relayhost and transport maps cuestion


    My postfix (v2.6.6) outgoing email trafic is routed to a specific smarthost for antispam purposes by "main.cf" configuration (relayhost = relayserverFQDN), but i need to exclude this relay to specifics domains.
    How can i do to skip the relay for emails sent to specific domains by transport maps feature.

  2. #2
    Just Joined!
    Join Date
    Sep 2007
    Location
    Silver Spring, MD
    Posts
    95

    Comment Relayhost items

    The easiest thing to do would be to comment out the line item out of the main.cf file and restart postfix

    Code:
    Go into main.cf file and comment out the relayhost section
    # relayhost = 
    
    service postfix restart # Restart Postfix
    
    sysv-rc-conf # Lists startup
    Todd

  3. #3
    Just Joined!
    Join Date
    Dec 2008
    Location
    Berlin Germany
    Posts
    4
    Comment Relayhost items

    As I am not yet allowed to post links here, here is what I have found on a
    dabi dabi dabi.nooblet.org/blog/2007/postfix-transport-maps-diverting-mail-traffic
    begin of the paste:
    -------------------------------
    Find out what your ISP’s SMTP server address is, usually smtp.yourisp.com. Create a file named transport in /etc/postfix and add the following text,

    gmail.com smtp:smtp.yourisp.com:25 googlemail.com smtp:smtp.yourisp.com:25

    Remember to swap “smtp.yourisp.com” for the address of your ISP’s smtp relay server.

    Now we need to compile this file using the postmap command,

    postmap /etc/postfix/transport

    Edit /etc/postfix/main.cf and add this line at the bottom,

    transport_maps = hash:/etc/postfix/transport

    Restart postfix and you should find all mail addressed to @gmail.com or @googlemail.com will be redirected to your smtp relay.
    ------------------------------ end of the paste.

    Ah yes, should you have "relayhost= " set to the IP|Name of some mail.server."tldp" the rest of your mail will be still sent through that old relay server, and only that for gmal, using that other of your isp, thanks to transport maps.

    Set your relayhost= (new line) only if you want to desable the relaying of the mail,
    making in this way, - your postfix try to be an internet email server, which have only sence if you have a static public IP Address
    for your postfix server computer nic.

    Hope you day will be a little bit easier
    Last edited by satyr09; 08-28-2013 at 06:43 AM. Reason: added the title

  4. #4
    Just Joined!
    Join Date
    Aug 2013
    Posts
    3
    Quote Originally Posted by tdsan View Post
    The easiest thing to do would be to comment out the line item out of the main.cf file and restart postfix

    Code:
    Go into main.cf file and comment out the relayhost section
    # relayhost = 
    
    service postfix restart # Restart Postfix
    
    sysv-rc-conf # Lists startup
    Todd
    Hi Todd,
    I understand your point, but i need this parameter enabled for outgoing mail scanning and omit certain emails sent to certain domains.

    Thanx for your help.

  5. #5
    Just Joined!
    Join Date
    Aug 2013
    Posts
    3
    Quote Originally Posted by satyr09 View Post
    Comment Relayhost items

    As I am not yet allowed to post links here, here is what I have found on a
    dabi dabi dabi.nooblet.org/blog/2007/postfix-transport-maps-diverting-mail-traffic
    begin of the paste:
    -------------------------------
    Find out what your ISP’s SMTP server address is, usually smtp.yourisp.com. Create a file named transport in /etc/postfix and add the following text,

    gmail.com smtp:smtp.yourisp.com:25 googlemail.com smtp:smtp.yourisp.com:25

    Remember to swap “smtp.yourisp.com” for the address of your ISP’s smtp relay server.

    Now we need to compile this file using the postmap command,

    postmap /etc/postfix/transport

    Edit /etc/postfix/main.cf and add this line at the bottom,

    transport_maps = hash:/etc/postfix/transport

    Restart postfix and you should find all mail addressed to @gmail.com or @googlemail.com will be redirected to your smtp relay.
    ------------------------------ end of the paste.

    Ah yes, should you have "relayhost= " set to the IP|Name of some mail.server."tldp" the rest of your mail will be still sent through that old relay server, and only that for gmal, using that other of your isp, thanks to transport maps.

    Set your relayhost= (new line) only if you want to desable the relaying of the mail,
    making in this way, - your postfix try to be an internet email server, which have only sence if you have a static public IP Address
    for your postfix server computer nic.

    Hope you day will be a little bit easier

    Hi Satyr,

    Thanx for your help,
    I solved this case with your indication.

    Have a nice day.
    satyr09 likes this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •