LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-14-2012, 12:35 PM   #1
vpapadop
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Rep: Reputation: Disabled
How to send emails from different IP


Hello,

I have bellow VPS account:
- CentOS 5.6 OS
- Webmin control panel installed
- Postfix server installed
- 3 domains created (3 Virtual servers)
e.g. domain1.com, domain2.com and domain3.com
- 2 available IPs
e.g. 44.44.44.44 and 55.55.55.55

Currently all domains use the main (shared 44.44.44.44) IP. What i would like to do is:
1. to use the second IP (55.55.55.55) for domain3.com, and
2. every email sent from domain3.com to be sent also from the second IP (55.55.55.55).

Till now I have changed the IP of domain3.com from Webmin menu, but when I hit domain3.com in my browser I see the primary Virtual Server (domain1.com). Only when i hit directly the second IP (55.55.55.55) in my browser i see the domain3.com. Do you know how i can fix this? Is there something i should do with the Name Servers of domain3.com?

Then after I fix this, do you know how i will tell Postfix to send emails name@domain3.com from the second IP (55.55.55.55)?

Thank you in advance,
Best Regards,
Vasilis.
 
Old 01-14-2012, 12:54 PM   #2
MartinStrec
Member
 
Registered: Jan 2012
Location: Czech
Distribution: Fedora, RHEL, Ubuntu, Mint
Posts: 110

Rep: Reputation: 13
If you want to specify IP address to send mail from (postfix), use smtp_bind_address key in your config.

See
http://www.postfix.org/postconf.5.ht...p_bind_address
http://www.postfix.org/postconf.5.html#inet_interfaces


Overview http://www.postfix.org/smtp.8.html
 
Old 01-18-2012, 04:24 AM   #3
vpapadop
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thank you for your reply,

I will look deeper into those Postfix parameters.
My main purpose was only to send e-mails from different IP and giving domain3.com the second available IP seemed to me like an answer.
Now i see that i only have to configure Postfix and send emails from different IP (by initializing a new Postfix instance maybe?).

Regards,
Vasilis.
 
Old 01-18-2012, 04:50 AM   #4
MartinStrec
Member
 
Registered: Jan 2012
Location: Czech
Distribution: Fedora, RHEL, Ubuntu, Mint
Posts: 110

Rep: Reputation: 13
If postfix supports 'proxy:' and 'hash:' as a value of 'smtp_bind_address' (see documentation of postfix) you needn't run the second instance of postfix.
 
Old 01-24-2012, 01:11 PM   #5
vpapadop
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I have made the following modifications in order to tell postfix that mails sent from domain3.com should be sent through second IP:

1. In /etc/postfix/transport:
domain3.com smtphandler1

2. In /etc/postfix/main.cf:
transport_maps = hash:/etc/postfix/transport

3. In /etc/postfix/master.cf:
smtp unix - - n - - smtp -o smtp_bind_address=44.44.44.44
smtphandler1 unix - - n - - smtp -o smtp_bind_address=55.55.55.55

4. Then run command "postmap /etc/postfix/transport" (in order to create transport.db file)

5. stop and start postfix

But still mails sent through user@domain3.com are sent from main IP 44.44.44.44 (actually all mails in VPS are sent throught main IP 44.44.44.44).
Any ideas?

Regards,
Vasilis.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
send emails kopper27 Linux - Newbie 7 06-11-2010 02:49 AM
localhost never send emails masimiqbal Linux - Server 4 02-17-2010 08:20 AM
hmm.. I can't send emails twlilinux Linux - Newbie 2 06-19-2008 02:39 PM
Can snort send emails? mikeghet Linux - Security 3 05-01-2005 07:40 PM
send 50-100 emails? codec Linux - Software 1 11-23-2004 07:28 AM


All times are GMT -5. The time now is 03:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration