Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| email:forward [2025/03/06 09:55] – willy | email:forward [2026/04/14 07:37] (current) – willy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Forwarding Email Setup ====== | + | ====== |
| - | Assuming you already have a full email server (either hosted by you or you are using some third party service), you will need your **internal** server (the home server) to be able to send emails. This is true even if you host your email server, because as i say [[:email|here]], | + | Assuming you already have a full email server (either hosted by you or you are using some third party service), you will need your **internal** server (the home server) to be able to send emails. This is true even if you host your email server, because as i say [[email:start|here]], you cannot self-host a real email server on your home server. |
| The following must be performed on your internal server. | The following must be performed on your internal server. | ||
| Line 10: | Line 10: | ||
| emerge mail-mta/ | emerge mail-mta/ | ||
| </ | </ | ||
| + | |||
| + | For future memory, Nullmailer home page is [[https:// | ||
| ===== Configuration ===== | ===== Configuration ===== | ||
| - | I assume | + | Nullmailer is pretty much undocumented. [[https:// |
| + | |||
| + | First of all, you **must** | ||
| + | |||
| + | The key point is to configure the home@mydomain.com as the source address to send all email from, which doesn' | ||
| + | |||
| + | All the following files need to be under **/ | ||
| + | |||
| + | So, configure relay: | ||
| + | <file - remotes> | ||
| + | mail.mydomain.com smtp port=587 user=home@mydomain.com pass=**** starttls | ||
| + | </ | ||
| - | All the following files need to be under **/etc/nullmailer**: | + | Then define an //admin// email address to send important emails (errors, etc): |
| <file - adminaddr> | <file - adminaddr> | ||
| myself@mydomain.com | myself@mydomain.com | ||
| </ | </ | ||
| + | Now the tricky part, there are three files you must configure properly: | ||
| + | - defaultdomain: | ||
| + | - defaulthost: | ||
| + | - me: again, not clear what this stand for, but it works if you replicate again the content of default domain. | ||
| + | |||
| + | so: | ||
| <file - defaultdomain> | <file - defaultdomain> | ||
| mydomain.com | mydomain.com | ||
| Line 25: | Line 44: | ||
| <file - defaulthost> | <file - defaulthost> | ||
| - | + | mydomain.com | |
| </ | </ | ||
| <file - me> | <file - me> | ||
| - | + | mydomain.com | |
| </ | </ | ||
| - | <file - remotes> | + | Yeah, doesn' |
| - | mail.mydomain.com smtp port=587 user=home@mydomain.com pass=**** starttls | + | |
| - | </ | + | |
| ===== Usage ===== | ===== Usage ===== | ||
| - | Try it from the command line: | + | In order for your root (or any user) emails to be sent to a specific address (example, myself@mydomain.com) you need to create a **~/ |
| + | <file - .forward> | ||
| + | myself@mydomain.com | ||
| + | </ | ||
| + | |||
| + | Now, try it from the command line: | ||
| <code bash> | <code bash> | ||
| (echo " | (echo " | ||
| </ | </ | ||
| + | |||
| + | Now test that the forward setting works as well: | ||
| + | <code bash> | ||
| + | echo "This is a test email from root" | mail -s "Test Subject" | ||
| + | </ | ||
| + | |||
| + | you should receive both emails at myself@mydomain.com, | ||