SMTP Realy Issue

I just started using mail-in-a-box and was surprised at how good it is. I was up and running in minutes. I managed to connect to it with thunderbird and emails all working perfectly. I have an email account on there with

I want to use it as my SMTP server for my websites, but have been having issues with emails being rejected. I typically got error messages in my /var/log/mail.log file like:

Oct 13 12:07:57 ip-172-31-12-116 postfix/smtp[6830]: ED13560347: to=<>,[178.xx.xx.38]:587, delay=0.15, delays=0.01/0.01/0.1/0.02, dsn=5.7.1, status=bounced (host[178.xx.xx.38] said: 553 5.7.1 <>: Sender address rejected: not owned by user (in reply to RCPT TO command))

It looks like sendmail would always send using the local user that was sending the email, rather than the one that was programmed in. For example, the forum is running as the www-data user so the emails were from instead of the one set in the forum ( Likewise, if I manually tried to run the sendmail command, it would appear in the error logs as coming from the admin user I had SSHd into the server with.

I had to get around this by editing the apache php.ini file and changing the sendmail_path parameter from:

sendmail_path = /usr/sbin/sendmail -t -i
sendmail_path = /usr/sbin/sendmail -t -i -f ""

I swear I have had this work with other SMTP providers where the "from" mail is used in the sendmail usage by the PHP website and that is what is sent from, rather than the www-data user (hopefully that makes sense). For now this works, but I would like to be able to rely on the "from" input field in my website, and not have to remember than I hardcoded it into the php.ini file. Is there some workaround to this other than possibly setting up a

Apologies, but I would correct the formatting, but I get the following error message for some reason:


Your best plan of attack would be to use a SMTP configuration in your forum software if that software supports it - most do.
Next option, I would set postfix on the remote server to relay via your MiaB. In this case you should be able to send as any user that has an account on MiaB.

As a new user to the forum your post count and link count are limited - the limits will be lifted after either 24 or 48 hours.

Try this:

Use your MIAB server as the relay server and BOOM anything using sendmail will send as the configured user (I recommend a account specific for your server - any other addresses you want to send as need to be setup as an alias for the account used in order to be authenticated by MIAB)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.