We had a shared hosting for, let's say myndd.com. then we migrated to a VPS
I installed postfix and I'm able to send emails to everyone except addresses from my own domain.
The hosting company told me it is normal because the MX zone is managed my mail01.myndd.com, so I have to forward emails to mail01.myndd.com
Problem is if I go to /etc/postfix/main.cf and add relayhost=mail01.myndd.com I cannot send emails to anyone anymore.
A temporary solution could be to forward our email to some others in another account like for example forward example1#myndd.com to example1#myotherndd.com . It will help but I find it a bit dirty.
Any idea how I can handle this problem?
Thanks !
My Bad. I found a way using transport.
I had to add the following line into /etc/postfix/transport:
myndd.com smtp:mail01.myndd.com
Tehn I launched
=> postmap /etc/postfix/transport.
Then I added the line transport_maps = hash:/etc/postfix/transport into /etc/postfix/main.cf
then
=> run postfix reload
So I can send emails in #myndd.com
Related
Some background and my challenge:
Background
I am using Magento 2.x using a virtual machine set-up which runs on Ubuntu 16.04
Challenge
My goal is to be able to test emails sent to me from the Magento application. In an ideal situation, I would not use an extension or third-party service (although a third-party SMTP server on the linux box could work).
To achieve my goal, I need to be able to register as a customer in the Magento application with any email address (fake or real) and have the email sent to the same external email address, no matter what.
What I've done so far
I've installed postfix
I've installed Magento using luma.com as the domain (and set up my hosts file accordingly on my host machine, etc.)
I've created a linux user account called "contact"
I've configured inet_interfaces in /etc/postfix/main.cf as loopback-only
I've set mydestination to $myhostname, localhost.$mydomain, $mydomain
I've configured Magento to send its store emails from contact#luma.com
I've set up an aliases file as the following:
postmaster: root
root: contact
contact: me#gmail.com
Then I ran newaliases As far as I recall, email sends fine with this setup. Hooray!
Next, the catch-all part. For this, I've tried loads of things, and none seem to work. From the reading I've done, I've tried the following:
In /etc/postfix/main.cf, I added the following:
virtual_alias_domains = luma.com
virtual_alias_maps = hash:/etc/postfix/virtual
Next, in /etc/postfix/virtual, I encountered my first problem. As far as I understand from the reading I've done, I'm supposed to use something like:
#example.com contact
This step apparently ensures that any email sent via postfix (e.g. from the Magento application) which uses an #example.com email address would be routed to the contact linux user I created above. Then, my thinking was that the system would use the alias I set up to ultimately send out that email from contact#luma.com (via the settings in Magento) through to the external address I set up in the aliases file. This approach would theoretically allow a user to register for an account with Magento using, say, joe#example.com, and then send the associated Welcome email to my external email address.
The issue with this is that I need the system to do this for any email, not just for emails ending in #example.com
Just for sake of completeness, I'll say that before asking this question, I was most recently researching how to achieve this part of the challenge using pcre tables. I've also tried configuring something using luser_relay, but both of these things are over my head at this point, so I'm lost.
My hope is that someone can offer some guidance as to whether I'm on the right path, where I may have missed something, and ultimately, offer some advice on whether my challenge can be solved and how I might go about solving it.
Thanks for reading.
This is a question that was asked a while ago on Server Fault, but was never really answered.
I have attempted to follow multiple guides, however, every single time I test it out I get
The error that the other server returned was:
550 5.7.1 Relaying denied
Does anyone have any advice on using Mailgun to achieve split delivery for Google Apps?
The way I do it, is setup a subdomain that has the mx records set to point at mailgun, then on the main domain, any addresses I want to go to mailgun I setup to forward to the subdomain
so say I want website#example.com to go to mailgun, i set this to forward to website#mailgun.example.com
You just need to make sure your code swaps out #mailgun.example.com with #example.com in the to fields if that matters to what you are doing
Hope that helps
my boss told me to do this weird think for our client (forgive my english):
On our server with old ISPconfig (propably first version) we have an email for one site called info#domain.com and it's set up to catch all emails to this domain. Our client downloads all emails from there and then sorts them by email name. They only have like three email adresses that they want (for example: desk#domain.com, boss#domain.com, assistant#domain.com). However among emails to these mentioned adresses there are thousands of spam emails sent to whatever#domain.com and our client doesn't want to download these.
My question is: How can I setup postfix for a info#domain.com with CatchAll to keep only emails sent to these three mentioned adresses and delete the others?
P.S.
I don't need another and smarter workaround because our client wants his emails handled exactly this way
Thank you for your advice!
It sounds like what you really want are aliases, not a catch-all - i.e. remove the catch-all from info#domain.com, then make desk#domain.com, boss#domain.com, assistant#domain.com aliases of info#domiain.com. This will make is so that mail sent to any one of these four addresses will be routed to the mailbox for info#domain.com, and mail sent to any_other_address#domain.com would be undeliverable. See http://www.postfix.org/aliases.5.html.
So I have this weird problem at my company with our email system.
(And I'll preface this by saying that I'm a web/graphic designer forced into an IT role as well, so forgive my noobish-ness please)
I just switched our company over to Google Apps for Business to take advantage of all of Google's apps and features.
The MX records for all six of our domains have been switched over to Google for days now, and it seems to be working very well except for a couple of things...
Those users in the organization who haven't switched their Outlook/Thunderbird/Mail App to Google's settings are still sending and receiving mail through the old system, which is hosted by MyHosting.com, even though the MX records clearly show that mail should be going to Google's servers.
Our website contact forms are still sending through the old system as well and NOT Google. For instance, woodshedsmokehouse.com contact form sends an email to info#woodshedsmokehouse.com on the old system, instead of sending it to info#woodshedsmokehouse.com at our Google Apps account (which is a 'nickname' of info#cheftimlove.com).
Now, here's where I think there might be some confusion... maybe, again I'm a noob.
All six of our domains have A Records of SMTP and MAIL that still point to MyHosting.com's mail servers.
Is this the issue? If so, how can I fix it? Google Apps support has not said a word about altering A Records
Any insight and help is more than greatly appreciated. Thank you!
I can understand why it's sending through the old domain, but I can't understand the receiving part. Are the emails they are receiving through the old domain a "Reply To Email" Or "New Emails".
I know A records are used as backup MX Records. And MX record are not needed at all, if your hosting the mail server off the A record location.
I'm curious, if you found a solution and an explanation. I checked your MX Records and they seem fine of the 2 domains you listed. I also use MyHosting, but I host my own email servers.
If you can post the headers of the email on the ones they receive and send, that would be helpful.
I am developing a website -- in the prototype stage, soon to be alpha. I will provide an email address to each account that allows the user to deposit stuff -- not a real email account, just an endpoint for sending things to the site. Many sites provide this kind of service nowadays. I think the first one I saw was Photobucket, which let's you send photos as email attachments.
My question is, what is the best way to implement this kind of service?
In my prototype, I have written a POP3 client which fetches all newly delivered mail (currently from a test Gmail account). My service processes each new mail and attachments, and immediately removes it from the email server.
I could certainly outsource to an email service with POP3 and be done with it. The problem is cost. Most services I have seen provide much more than I need, and they charge per account. I expect to have many accounts and low traffic volume.
So I'm leaning towards hosting email receipt myself. I am open to Windows or Linux. The code that processes incoming emails runs on Windows, but I have other services running on Linux. I have seen a number of open source and free email servers, such as hMailServer and MailEnable (Windows) and qmail, Postfix and exim (Linux).
I guess I have a slight preference towards Linux because of lower hosting costs, but if a Windows service can provide cleaner integration, that might be worth it. As far as features, I would like to have some spam filtering, but it's is not a huge priority. POP3 is adequate for retrieval, but a more direct API would be nice. I will need some kind of API for programmatically provisioning new accounts.
All suggestions are appreciated. Do you know how others implement this kind of service?
UPDATE: I ended up using hMailServer, which is a free mail server that runs on Windows. It seems to be quite mature and robust. It has a COM interop library which makes accessing emails, accounts, etc. from my .NET server app very easy indeed.
If you're going the host-your-own-email-server route, I would probably just use POSTFIX and pipe all your email to a PHP script, which processes the email.
Here's a quick'n dirty tutorial on setting up the email pipe if you're using cPanel:
http://kb.siteground.com/article/How_to_pipe_an_email_to_a_PHP_script.html
If not, here's how to do it:
http://answers.google.com/answers/threadview?id=562518
The bottom line is, you need to have an open SMTP connection to accept email. If you have your own server, then you can install a SMTP server on the machine. Usually, you have filesystem access to the location the email files are placed. Be sure to select a SMTP server that allows this, and that the email are in a format that you can parse.
Then, you can just monitor the file location for incoming emails.
If you can't pipe your emails (using the Postfix suggestion), and you don't have your own server (for example, on a shared hosting plan), then you will need to query a POP3 or IMAP mailbox server for your emails, and parse them accordingly.
I wanted to get emails in real time so I worked out my own solution with google app engine. I basically made a small dedicated google app engine app to receive and POST emails to my main site. That way I could avoid having to set up an email server.
You can check out Emailization (a little weekend project I did to do it for you), or you this small GAE app that should do the trick.
I kinda explained it more on another question.
Hope that helps!