I don't receive emails

Hello,

There is something wrong on my server.

I can actually send email, we send the newsletter from out server with php list. But, if I try to send an email to a domain that is registered on the server, from domain registered on the server (let’s say I have example.com and I want to send an email to arvi@example.com, from ) then I will never receive it (but all others email work).

We are not using our server to handle email we use another company (all properly configured in the mx dns), but we can’t receive emails from our own server, which is kind if stupid, if we want to receive our newsletter we need to use personal emails (I tried with usermin, same problem).

Also, if I use our 2nd server (also Ubuntu 14.04 with virtualmin) to send email to my company email, then it will work.

Arvi

edit:
Ok, seems to not work from the second server either (works for xxx.example.com but not for example.com), could be a problem with the email provider…

edit 2:
Ok I’m very confused now. We have a wordpress website, with the sucuri plugin. I receive emails all the time from it (so from wordpress@example.com to arvi@example.com) but when I tried to send from webmin with the same settings, it just didn’t work. If I check the mail queue, I can see the email, from has wordpress@example.com. but to is empty (and if I replace by my personal email @gmail it works).

Any help? ^^

Any help? It’s a big problem that we can’t receive our newsletter :frowning:

Nothing? it’s a pretty big issue especially when I want to install service just for the company, and we can’t receive emails…

Just that I understand you correctly:

You’re sending emails from your servers in the name of e.g. newsletter@company.com to newsletter subscribers. Some of these subscribers have their email address registered on the server you are sending the mail from and those do not receive the newsletter? Or are they on the hosted email server? Do they also have @company.com addresses or different domains?
Your Virtualmin server and the hosted email server are on completely different subnets I suppose?

Are you “impersonating” yourself as “newsletter@company.com”, although @company.com addresses are actually handled on the hosted email server? If so it’s completely normal for the email hoster to ignore emails that only he is supposed to send if he receives such from another server (in that case yours). You’d have to add your server to the trusted networks of the email hosters server in that case.

If that’s not the case:

  • Are the emails actually sent out? What does your postfix log file say? Or, if the PHP library has its own SMTP-Client, does it provide debug logs?
  • Is the hoster by any chance using restrictive SPF/DMARC policies?

Howdy,

It sounds like you’re saying you don’t host email on your own server – if that’s the case, you’d want to make sure that the Mail for Domain feature is disabled for any domain which is not hosting email locally. If Mail for Domain is enabled, it will always try to deliver email locally.

-Eric

So, I deactivated mail already in the domains.

The only people who don’t receive emails are people with an address @company.com
If I send an email using the smtp of our email provider, it works, but they kind of suck and if we send too much they block us…

If I check the postfix queue from virtualmin, the “to” section is empty, and in the log, it says: “to=arvi@company.com, relay=mxn.relay.com[IP_ADDRESS]:25 status=bounced (mxn.relay.com[IP_ADDRESS] said: 502 host Mailfrom account is a local account webmaster@company.com (in reply to MAIL FROM command))”

Now that I’ve checked the log (might have done that in the first place…), seems like it’s blocked by our mail provider right?

Also, I realized why I received the emails form wordpress, they are sent as @nameOfTheServer.com but they change the “from” part.

Speaking of getting emails, like many other posts lately, I got the above emailed to me THREE TIMES, and I haven’t even commented in this topic until now.

@AustinTX: Upon every post edit the forum software sends out a new email to all subscribers. Most likely you’re subscribed to the Virtualmin section, so you also get emails for all post edits in this section.

@Arvi89: Seems like you found your problem. Continuing to send email from an address for which another server is authoritative can cause your server to be blacklisted. If your Email-Provider correctly sets up SPF/DKIM/DMARC policies then all mails whose domain is handled by their server and which are sent by yours without authorization won’t reach their recipient (if their email provider uses SPF/DKIM/DMARC).

If you want to continue sending as e.g. newsletter@company.com, you’ll have to use your provider to send those mails.
Check with them if you are allowed to send newsletters and at which rate you are allowed to sent them and configure phpList accordingly:

http://docs.phplist.com/PhpListConfigSendRate.html

Well, it’s a security measure from our provider, we can’t send email from @company to @company using another server. But we can send from @company to anyone else, this is ridiculous. And we can’t use their smtp because they don’t allow mass emailing. They suggested we check each email we send, and if it’s on of ours, we use their smtp, otherwise our server. That’s stupid.

I’m sorry but this is completely normal behavior. As I said, you can be happy they aren’t using SPF, because then you wouldn’t be able to send as @company at all.

But i didn’t want to suggest what they did, because that’s not a good solution at all (think: anyone that is not @company, but has their email at your hoster won’t receive the mails if you hardcode only @company. You’d have to hardcode every domain they are handling to be sure).

Well, they asked to change our spf, so I did add their server to the spf after mine in the DNS records. Anyway, I don’t think that’s a good solution, a lot of people actually use 3rd party software or companies to send newsletter, but well, not much we can do now. We’ll try to change provider in the future ^^

spf looks like this: v=spf1 a mx a:company.com ip4:xxx.xxx.xxx.xxx include:spf.provider.com ?all