Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th February 2008, 04:30
kameleon25 kameleon25 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default postfix smtp relaying questions.

I setup postfix on my ISPConfig server to use SMTP relaying using this link: http://www.howtoforge.com/postfix_re...her_mailserver . It worked like a charm.... EXCEPT: When I reply to an email I sent from the server it goes to the gmail account I am relaying through (as in I send myself a test message to another email address). Is there a way I can get around this? Rather than have the recipient change the email address it is going back to?

Basically I am trying to find a way that I can send mails from my server (which is on a static IP with Comcrap) and it function just as a regular e-mail sever. Is there any other way to do this?

Last edited by kameleon25; 9th February 2008 at 15:31.
Reply With Quote
Sponsored Links
  #2  
Old 9th February 2008, 19:09
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

If you have a static IP address which is not blacklisted (see http://www.mxtoolbox.com/blacklists.aspx ), then you don't need relaying.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 9th February 2008, 20:19
kameleon25 kameleon25 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default

It is not a "static" but i have had the same IP since i had the service... Well over a year now. So I call it static. It is blacklisted because it comes from "a dynamic pool of ip's from a residential broadband provider". As in I cannot email my blackberry, my wife at her state job, or alot of others. Hence the need for the relaying. I also have a dreamhost hosting account for my company and tried relaying through it but that did not work either.
Reply With Quote
  #4  
Old 9th February 2008, 20:59
kameleon25 kameleon25 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default

On a side note, I do have access to a linux machine on a static IP that is not on any blacklists. But all I could do on it is possibly setup postfix to allow authenticated relaying. Would that do what I need also? I just can't run the full ISPConfig server on that machine. I do apologize, I am just now getting to where I am having to mess with mail servers this deep. I appreciate any and all help.
Reply With Quote
  #5  
Old 10th February 2008, 17:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by kameleon25
EXCEPT: When I reply to an email I sent from the server it goes to the gmail account I am relaying through (as in I send myself a test message to another email address).
I'm not sure why this is happening. What's in /etc/postfix/main.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 10th February 2008, 21:16
kameleon25 kameleon25 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Here is my main.cf. Thanks for the help!
Code:
cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = machine.domain.tld
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = machine.domain.tld, localhost.domain.tld, , localhost
relayhost = smtp.gmail.com:587
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_local_domain = 
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

virtual_maps = hash:/etc/postfix/virtusertable

mydestination = /etc/postfix/local-host-names
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
Reply With Quote
  #7  
Old 11th February 2008, 16:24
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Is the domain you're sending to listed in /etc/postfix/local-host-names?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 11th February 2008, 16:41
kameleon25 kameleon25 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default

No it isn't. I have tried sending to my work email, my wife's work, gmail, yahoo, and a few other domains. All of them get the emails now that i can relay through gmail but the FROM address is re-written to be the gmail address I am relaying through.

I think at this point I have 3 options.
1. Pay for the actual static IP from my ISP ($250 setup fee plus more per month for less speed than I have now... it's comcraptic!)
2. Pay for the DynDNS outbound mail hop relaying. ($15 a year for up to 150 messages a day)
3. Setup something on this other machine I have access to that will allow authenticated smtp relay that will just pass off the message to whoever I am sending it to without modifying the FROM or whatever.

I don't like #1 because it costs too much at the moment. #2 is ok but I don't learn anything in the process. I would opt for #3 if I could but everywhere I look online for a guide to do that it seems non-existent. Unless I am just blind or not searching for the right stuff. I know it is possible to setup Postfix (or whatever) to allow authenticated SMTP relaying and it should be possible to do so with it just passing the message on to the destination without modifying it any. I figure the reason gmail does that is because anyone can relay through them like that to send spam. Any pointers on a good walkthrough on doing what I want?
Reply With Quote
  #9  
Old 12th February 2008, 19:55
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by kameleon25
No it isn't.
That's the problem. If you're using ISPConfig, please create a web site and an email account for that domain.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 13th February 2008, 17:20
kameleon25 kameleon25 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default

I may not have made my situation clear. Let me take a step back and explain it from the beginning.

I have an ubuntu 7.10 server running ISPConfig with 2 domains on it at the moment. Both are fully functional and can receive mail. Although when I send mail TO certain domains FROM any of the email address's on the server (either domain) I get blocked because I am sending mail "from an IP that is part of a dynamic pool of IP's assigned to a residential broadband internet provider". Basically my IP is blacklisted. And without having to spend more money I don't have on getting switched to a "business" setup w/ static ip I decided to try to relay through gmail. I sucsefully setup postfix to relay through gmail. I am now able to send mail TO anyone FROM any email address at any domain on my server. The only problem now is that when I send an email from any address hosted on my server it is relayed through gmail and gmail rewrites my FROM: address to be that of the gmail account I am relaying through. This is not ideal as my customers would all be showing up as sending "from" the gmail address. I read that gmail does this to prevent spam.

So now I am looking at setting up a dedicated mail relay machine. I have access to a machine on a static IP that is not on any blacklist. I guess what I need to know and cannot seem to find through my searches online is how to setup postfix (or anything similar) to where I can set it as my "relayhost=" in my main.cf on my ISPConfig box and it not rewrite the FROM: address on every outgoing mail message. Unless I am totally missing something. Is there a way to setup postfix to allow mail "relay" from only one host (my ISPConfig server)?

I hope that clears up what I am wanting to do. Sorry for the confusion.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sending e-mail using mail() function linuxuser1 HOWTO-Related Questions 38 21st April 2009 12:20
securing postfix - smtp auth on port 587 only rtg20 Server Operation 12 4th July 2008 20:08
Postfix SMTP Authorization Problems? matto1376 Server Operation 6 16th December 2007 03:59
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 15:47
Verify email setup meekish Installation/Configuration 28 27th October 2006 15:36


All times are GMT +2. The time now is 12:35.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.