Modify sender domain address in Postfix

NethServer Version: 7.6.1810
Module: Postfix
I’m new to the linux world. but have now tried to make me a domain and mail as well as a file server for home use. and now just needs to send it to the right mail domain. I use my ISP mail server so the mail must have the right domain.
So I want to hear about someone who can help me.


I don’t know if can works but you can try to send emails via smarthost using your ISP settings.

If you want a mail @ispdomain.ext you can’t use your own mail server but you have to use settings provided by ISP.

Alternatively you can set the ISP email address into SMTP settings of Outlook to exit as @ispdomain.ext
But people will answer you on this email address so you will need pop3 connector to download the emails from NS.

I have set up smarthost so that it sends to my ISP and I also use pop3 connector to receive mails from my ISP.
So it is not possible to translate my local domain to the ISP domain when I send an email.

About Outlook setup and I really understand you. Then I put my ISP “mail domain” into it.Udklip1%20-%20Kopi

If u want to exit with @ispdomain.ext you can set this configuration:

  • POP3 connector on NS that downloads emails from address@ispdomain.ext
  • IMAP configuration on Outlook that download emails from NethServer address@yourdomain.ext
  • SMTP configuration on Outlook using ISP settings and send emails like address@ispdomain.ext (use mail server settings of your ISP). But I think that these emails (with this configuration only send emails) will not saved on NS automatically. You have to set in Outlook to do a copy of sent emails into “sent” folder of your NS account.

so I can’t use sogo EAS?
i have read that in postfix setup you can make a setup where it make a generic mapping for outgoing SMTP mail between local mail address ex dahlgren@lokaldomain.local to But I just don’t know how.
but is it not possible in nethserver?

My solution works if you want to read/answer emails from Outlook and only read from external (SOGo).
Can you install Roundcube? Then enter with the user and change identity putting in the field ISP address. Then try to send an email with smarthost enabled and check if it works.

it is not a problem to get Sogo and Roundcube to send with the ISP domain.
So I need to use IMAP and webdav as well as carddav, in order to get mail contacts and channels in Outlook to work.

it is not a problem to get Sogo and Roundcube to send with the ISP domain.
So I need to use IMAP and webdav as well as carddav, in order to get mail contacts and channels in Outlook to work.

With this configuration the only thing you can’t do is send email from SOGo/Roundcube with ispdomain.ext.
You can start with this configuration and check if is enough for your needs. What do you think?
Or you can try to search on the Internet how to set smtp settings to exit with isp domain. But it’s a very particular configuration in my opinion.

Probably I’ve found what do you need. You have to modify the file /etc/postfix/canonical by adding at the end of the file this line:

user@yourdomain.ext user@ispdomain.ext

Replace user and yourdomain/ispdomain with real values.
Then launch command postmap /etc/postfix/canonical and check that it doesn’t return errors.
If yes restart postfix with systemctl restart postfix

I don’t know if you can send emails with ISP domain without finish in SPAM: you can try. Remember to keep enabled smarthost configuration.

If it works you can set your NethServer as SMTP server into Outlook configuration.

Wait for feedback.


Will test it :slight_smile:

You are the man … :slight_smile: :slight_smile: :smile:

I just send 10 mails to my gmail. and they all came through:point_up:
Should this be a worse option in your web gui.
Because I can’t be the only “private” person to use for this opportunity.

Good! I think that it’s not necessary to implement this configuration… with one line and two command you’ve solve the problem.
Please mark the answer as solution: it can be helpful for any other person.

1 Like