1

Topic: Send mail to localhost

==== Required information ====
- iRedMail version (check /etc/iredmail-release):     v0.9.4
- Linux/BSD distribution name and version: Centos 7.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====
Good morning,
      I have a problem to configure IREDMAIL to send email to @localhost users.

I modified postfix :
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$mydomain, $mydomain

Before I received an error :
to=<mark@localhost.xxxxxxxx.xx>, relay=local, delay=189, delays=189/0.03/0/0.03, dsn=4.3.0, status=deferred (temporary failure. Command output: Can't open log file /var/log/dovecot-sieve.log: Permission denied )

Then i changed the permissions to /var/log/dovecot-sieve.log, so i received another error :
May  3 09:23:01 iredmail-server postfix/local[7081]: 45765EBF: to=<mark@localhost.xxxxxxxx.xx>, relay=local, delay=2028, delays=2028/0/0/0.03, dsn=4.3.0, status=deferred (temporary failure)

May 03 09:27:02 lda(mark): Fatal: setgid(2000(vmail) from mail_gid setting) failed with euid=2003(mark), gid=2003(mark), egid=2003(mark): Operation not permitted (This binary should probably be called with process group set to 2000(vmail) instead of 2003(mark))

Thank you
Mark

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Send mail to localhost

Adding below settings in /etc/postfix/main.cf, restart Postfix service and try again:

local_recipient_maps = proxy:unix:passwd.byname
local_transport = local:$myhostname

3

Re: Send mail to localhost

Thank you for your reply, but it doesn't works, I received same error message :

May 03 09:44:50 lda(mark): Fatal: setgid(2000(vmail) from mail_gid setting) failed with euid=2003(mark), gid=2003(mark), egid=2003(mark): Operation not permitted (This binary should probably be called with process group set to 2000(vmail) instead of 2003(mark))

Thank you
Mark

ZhangHuangbin wrote:

Adding below settings in /etc/postfix/main.cf, restart Postfix service and try again:

local_recipient_maps = proxy:unix:passwd.byname
local_transport = local:$myhostname

4

Re: Send mail to localhost

Alright, try this:

*) Add a new mail user with iRedAdmin. e.g. mark@your_domain.com.
*) Add an entry in /etc/postfix/aliases, forward emails sent to system account 'mark' to a real email address - the newly created one 'mark@your_domain.com'.

mark: mark@your_domain.com

*) Run command:

postalias /etc/postfix/aliases

5

Re: Send mail to localhost

Yes, it works, but this means that I have to edit aliases whenever I have a new user ?

It is not very convenient... alternatives ? It would solve using iredmail-PRO ?

Thank you very much
Mark


ZhangHuangbin wrote:

Alright, try this:

*) Add a new mail user with iRedAdmin. e.g. mark@your_domain.com.
*) Add an entry in /etc/postfix/aliases, forward emails sent to system account 'mark' to a real email address - the newly created one 'mark@your_domain.com'.

mark: mark@your_domain.com

*) Run command:

postalias /etc/postfix/aliases

6

Re: Send mail to localhost

Do you have many system accounts? and changed frequently?

7

Re: Send mail to localhost

Yes, I must often add accounts

ZhangHuangbin wrote:

Do you have many system accounts? and changed frequently?

8

Re: Send mail to localhost

My mistake, try this:

*) Revert your changes to main.cf (comment out "local_recipient_maps =" and "local_transport").
*) Comment out "mailbox_command =" and "home_mailbox =".
*) Restart Postfix service.

Then try to send some testing emails to local users.

User will be notified on terminal when he typed any command and there's new email arrived, and you can view the mails with command 'mail'.