Postfix server mirroring (backup server) - postfix-mta

I have to set up a remote mirror for a postfix server (where the content of both mail servers should be the same at any time).
The idea is that if the main server comes down at some point the mirror server will take its place, manage the new incoming mails, and when the e-mail server comes up again, it will update it with the new e-mails and return it the control to manage the new incoming mails.
The mail servers will be hosted in different places (i.e. maindomain.com, themirrorsite.com).
Getting a simple back-up server doesn't seem too difficult:
http://beginlinux.com/blog/2010/03/backup-mx-with-postfix/ http://www.postfix.org/STANDARD_CONFIGURATION_README.html#backup http://www.linuxmail.info/postfix-backup-mx/
But the problem is that this configuration wouldn't make the back-up site a complete mirror of the main mail server (it will hold only the e-mails received while the main server is down).
Is there a way to achieve the required configuration?

You can use recipient_bcc_maps in maindomain mail server so that send every mail to the backup mail server too.
eg. ebal#maindomain.com ---> ebal#themirrorsite.com
plus you have to hack themirrorsite mail server to accept any mail for example.com & example2.com.
This isnt a straightforward solution, just a workflow till you figure out the problem one maindomain mail server.
You have a lot of problems with that scheme. For example index files (read/unread flags etc) but you will have an active mail server till you fix maindomain mail server.
On other solution is to rsync mails every one hour (maildir helps a lot) from on mail server to one other

Related

Can I tell within application code, on what outermost port of my server the app is accessed?

I'm trying to open with the question that I really want answered. I want the URL at which outside users can access a particular part of my application.
In my server's setup, we're using Nginx as a reverse proxy, so my app is confugured to be at port 9000. But I can't point users at this, because they can't access that port. Users can access port 8080. But this is part of my system configuration and could (I think) change. Also it does change from development to staging to production. So, I would like to avoid hard-coding this if possible.
So then my question, can I somehow, dynamically, tell the "outermost" port that an incoming request is received at? Possibly through passing a header down from Nginx? I'm thinking of X-Forwarded-For, except I want to know what URL the client contacted to reach me (the server), not what IP address the client is contacting the server from. Is this possible?
$server_port variable holds the port the client connected to.

SMTP and A record

I am a front-end developer so the server stuff goes a bit over my head. Please excuse me if the question is dumb.
I am hosting a wordpress site on our server with contact form 7, but we only have a A-records for www pointing to our site. The email management for said domain is held by a third party.
How is contact form sending the emails to the admins? It is using our hosts SMTP service? I am asking because I am getting the emails on gmail, but the client is not receiving them on his service.
Thank you!
When your server is sending email without you configuring anything, the most likely cause is that it is using the server itself. For that, it does not need to "know" any DNS entries, as it just connects to localhost, which always points to the server itself.
When you receive the mail, and your client is not, this is most likely the result of a spam filter. Have you asked your client to check the spam folder?
The problem of - mainly - shared hosting servers is that they tend to end up on spam lists like that of spamhaus.org etc. which greatly enhances your risk to end up in the spam folder. If you control the server, you could request deblocking or even whitelisting your server, but before you do that, you should be certain that your server is not inadvertedly relaying mail because of a misconfiguation, vulnerability, or outright being hacked. Your applications or the server itself could be configured to use an external smtp server, but that's not something that's easily explained here. Maybe try on serverfault.com?

About http post from desktop application

My q is whats can stop http post from desktop applications ?
e.g
i have a desktop application before it start it's ask users form some information
like a username ad Email ,,, and then take this information and post it on php webpage and php insert it into MySql Server any way the problem now is lets say like
6 of 16 download(s) are registered and the others not so whats can make http post not run correctly ?
Note :
Software tested on every windows os and runs ok
Software run with all anti viruses programs ok
Software add port throw windows firewall ok
So whats can make http post not run correctly ?
Regards
There are many things that could stop communication between your application, and your database.
If the client has a firewall that requires authorisation for outbound requests.
If the client has to connect via a proxy server, and you application is not proxy aware
If your website fails to process your request (perhaps, if the MySql server is too busy to allow connections, etc.)
So, consider an end user behind a WebSense proxy that additionally allows administrators to filter out unwanted traffic. If your application is not proxy server aware, it will fail to connect; If your application is proxy aware, and whatever WebSense category you fall into is filtered for that client, it will also fail to connect.

View SMTP traffic from IIS7

I have a situation where a 2008 server with IIS7 has been application level compromised and is sending spam from port 25. We have ran a virus scan and removed the infected files yet the spam is still being sent.
We know the spam is coming from a local file as the firewall has port 25 blocked inbound and the SMTP log is showing all requests appearing from the local server. We have ran a LogParser scan of the sites (which there are many) for any POST data to files on the server but the results all look genuine. The PID sending the data on port 25 is simply inetinfo.exe so this isn't much use either.
I would like to identify what file is sending this e-mail, can anyone think of a way to do this?
Have you shut down the smtp server under properties for local outbound? meaning 127. etc...? also, have you looked in the que folder under inetpub to see if the offending message is in there? In some cases a file can change the remote server on smtp in IIS to send via aproxy or some other service so it would ignore your scans.
in addition, not all mail has to use port 25 to send emails. it can hit any port if the creator tells it to.

SMTP email not sent in one server, but sent in another server

I have a section of code that sends email from SMTP server.
The code is carried out webservice & smtp server value is picked up from web.config, while the code hosted on server1 works (send/receive emails), whereas the same code hosted in server2 doesn't send/receive email.
Can you tell your thoughts?
Thanks
This really belongs on ServerFault.com, and there isn't enough information to give you a definitive answer, but I can give you my thoughts on it (as asked).
Most likely, if the SMTP server is a different server than the one your app is hosted on, then probably there is some configuration that needs to be done on the SMTP server. Usually, the SMTP server needs to grant pass-through permissions on a per-user and/or per-server basis. So, most likely your situation is that the SMTP server has an "Allow pass-through" list that includes the server where your code works, and does not include the server where the email is NOT sent.
At least, this is usually the problem in our network...
If the SMTP server is on the same server as your app, of course, you'd want to check to ensure that SMTP is installed on both servers with the same configuration.
If this fails, look for errors... In your app code, or in the event log.. .If my guesses are wrong, you're going to need more info to go on.
Finally, here is a good resource for a coder, not necessarily for an Admin, but it may have info that will help you. http://systemnetmail.com/
first thing to check is the windows firewall and if there is an antivirus or third party firewall installed on the machine.
also check the event log for some useful information about the details of the error.

Resources