Ubuntu postfix help
I now have this setup in postfix:
sudo nano main.cf
inet_interfaces = loopback-only
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CApath = /etc/ssl/certs
smtp_use_tls = yes
Sudo nano sasl_password
[smtp.gmail.com]:587 user:password
And if I run the command:
echo "Test mail thingy" | mail -s "Test Postfix Subject" R*******@gmail.com
Does it work :)
How do i force postfix to send message to root local to my mail ?
server email postfix
add a comment |
I now have this setup in postfix:
sudo nano main.cf
inet_interfaces = loopback-only
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CApath = /etc/ssl/certs
smtp_use_tls = yes
Sudo nano sasl_password
[smtp.gmail.com]:587 user:password
And if I run the command:
echo "Test mail thingy" | mail -s "Test Postfix Subject" R*******@gmail.com
Does it work :)
How do i force postfix to send message to root local to my mail ?
server email postfix
First of all I am a Linux noob but I want a system that sends me an email in case there are problems on the server such as if it unmount a drive a service goes down or else :)
– Rene Mortensen
Jan 25 at 17:07
add a comment |
I now have this setup in postfix:
sudo nano main.cf
inet_interfaces = loopback-only
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CApath = /etc/ssl/certs
smtp_use_tls = yes
Sudo nano sasl_password
[smtp.gmail.com]:587 user:password
And if I run the command:
echo "Test mail thingy" | mail -s "Test Postfix Subject" R*******@gmail.com
Does it work :)
How do i force postfix to send message to root local to my mail ?
server email postfix
I now have this setup in postfix:
sudo nano main.cf
inet_interfaces = loopback-only
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CApath = /etc/ssl/certs
smtp_use_tls = yes
Sudo nano sasl_password
[smtp.gmail.com]:587 user:password
And if I run the command:
echo "Test mail thingy" | mail -s "Test Postfix Subject" R*******@gmail.com
Does it work :)
How do i force postfix to send message to root local to my mail ?
server email postfix
server email postfix
edited Jan 25 at 17:53
Rene Mortensen
asked Jan 25 at 16:25
Rene MortensenRene Mortensen
105
105
First of all I am a Linux noob but I want a system that sends me an email in case there are problems on the server such as if it unmount a drive a service goes down or else :)
– Rene Mortensen
Jan 25 at 17:07
add a comment |
First of all I am a Linux noob but I want a system that sends me an email in case there are problems on the server such as if it unmount a drive a service goes down or else :)
– Rene Mortensen
Jan 25 at 17:07
First of all I am a Linux noob but I want a system that sends me an email in case there are problems on the server such as if it unmount a drive a service goes down or else :)
– Rene Mortensen
Jan 25 at 17:07
First of all I am a Linux noob but I want a system that sends me an email in case there are problems on the server such as if it unmount a drive a service goes down or else :)
– Rene Mortensen
Jan 25 at 17:07
add a comment |
1 Answer
1
active
oldest
votes
Add the following line to /etc/aliases:
root: username@gmail.com
If there's an existing alias for root, place a # in front of it to comment it out. If you want it sent to multiple users, you can specify multiple addresses like this:
root: username@gmail.com, anotheruser@gmail.com
After editing /etc/aliases, apply it with sudo newaliases.
Addendum: It did not work, as per comments, because postfix was not configured to accept mail bound for rene-desktop, which was the local host name.
This was fixed by adding
mydestionation = rene-desktop
near the top of /etc/postfix/main.cf.
Thank you When i run this to test : mail -s "Test Email for Root $(date)" root <<< "This is a test email."
– Rene Mortensen
Jan 25 at 18:14
Your message was not delivered to the root@rene-desktop because the domain rened-esktop was not found. Check if there are spelling errors or excess spaces and try again. - I think its because I made a mistake at the beginning of the postfix installation how do I correct this :)?
– Rene Mortensen
Jan 25 at 18:17
What's the local hostname, and what's/etc/mailnamecontaining?
– vidarlo
Jan 25 at 18:19
rene-desktop :) - I dont have that folder "/etc/mailname"
– Rene Mortensen
Jan 25 at 18:21
Doesmail root@localhostwork?
– vidarlo
Jan 25 at 18:23
|
show 6 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112840%2fubuntu-postfix-help%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add the following line to /etc/aliases:
root: username@gmail.com
If there's an existing alias for root, place a # in front of it to comment it out. If you want it sent to multiple users, you can specify multiple addresses like this:
root: username@gmail.com, anotheruser@gmail.com
After editing /etc/aliases, apply it with sudo newaliases.
Addendum: It did not work, as per comments, because postfix was not configured to accept mail bound for rene-desktop, which was the local host name.
This was fixed by adding
mydestionation = rene-desktop
near the top of /etc/postfix/main.cf.
Thank you When i run this to test : mail -s "Test Email for Root $(date)" root <<< "This is a test email."
– Rene Mortensen
Jan 25 at 18:14
Your message was not delivered to the root@rene-desktop because the domain rened-esktop was not found. Check if there are spelling errors or excess spaces and try again. - I think its because I made a mistake at the beginning of the postfix installation how do I correct this :)?
– Rene Mortensen
Jan 25 at 18:17
What's the local hostname, and what's/etc/mailnamecontaining?
– vidarlo
Jan 25 at 18:19
rene-desktop :) - I dont have that folder "/etc/mailname"
– Rene Mortensen
Jan 25 at 18:21
Doesmail root@localhostwork?
– vidarlo
Jan 25 at 18:23
|
show 6 more comments
Add the following line to /etc/aliases:
root: username@gmail.com
If there's an existing alias for root, place a # in front of it to comment it out. If you want it sent to multiple users, you can specify multiple addresses like this:
root: username@gmail.com, anotheruser@gmail.com
After editing /etc/aliases, apply it with sudo newaliases.
Addendum: It did not work, as per comments, because postfix was not configured to accept mail bound for rene-desktop, which was the local host name.
This was fixed by adding
mydestionation = rene-desktop
near the top of /etc/postfix/main.cf.
Thank you When i run this to test : mail -s "Test Email for Root $(date)" root <<< "This is a test email."
– Rene Mortensen
Jan 25 at 18:14
Your message was not delivered to the root@rene-desktop because the domain rened-esktop was not found. Check if there are spelling errors or excess spaces and try again. - I think its because I made a mistake at the beginning of the postfix installation how do I correct this :)?
– Rene Mortensen
Jan 25 at 18:17
What's the local hostname, and what's/etc/mailnamecontaining?
– vidarlo
Jan 25 at 18:19
rene-desktop :) - I dont have that folder "/etc/mailname"
– Rene Mortensen
Jan 25 at 18:21
Doesmail root@localhostwork?
– vidarlo
Jan 25 at 18:23
|
show 6 more comments
Add the following line to /etc/aliases:
root: username@gmail.com
If there's an existing alias for root, place a # in front of it to comment it out. If you want it sent to multiple users, you can specify multiple addresses like this:
root: username@gmail.com, anotheruser@gmail.com
After editing /etc/aliases, apply it with sudo newaliases.
Addendum: It did not work, as per comments, because postfix was not configured to accept mail bound for rene-desktop, which was the local host name.
This was fixed by adding
mydestionation = rene-desktop
near the top of /etc/postfix/main.cf.
Add the following line to /etc/aliases:
root: username@gmail.com
If there's an existing alias for root, place a # in front of it to comment it out. If you want it sent to multiple users, you can specify multiple addresses like this:
root: username@gmail.com, anotheruser@gmail.com
After editing /etc/aliases, apply it with sudo newaliases.
Addendum: It did not work, as per comments, because postfix was not configured to accept mail bound for rene-desktop, which was the local host name.
This was fixed by adding
mydestionation = rene-desktop
near the top of /etc/postfix/main.cf.
edited Jan 25 at 18:41
answered Jan 25 at 17:59
vidarlovidarlo
10.5k52547
10.5k52547
Thank you When i run this to test : mail -s "Test Email for Root $(date)" root <<< "This is a test email."
– Rene Mortensen
Jan 25 at 18:14
Your message was not delivered to the root@rene-desktop because the domain rened-esktop was not found. Check if there are spelling errors or excess spaces and try again. - I think its because I made a mistake at the beginning of the postfix installation how do I correct this :)?
– Rene Mortensen
Jan 25 at 18:17
What's the local hostname, and what's/etc/mailnamecontaining?
– vidarlo
Jan 25 at 18:19
rene-desktop :) - I dont have that folder "/etc/mailname"
– Rene Mortensen
Jan 25 at 18:21
Doesmail root@localhostwork?
– vidarlo
Jan 25 at 18:23
|
show 6 more comments
Thank you When i run this to test : mail -s "Test Email for Root $(date)" root <<< "This is a test email."
– Rene Mortensen
Jan 25 at 18:14
Your message was not delivered to the root@rene-desktop because the domain rened-esktop was not found. Check if there are spelling errors or excess spaces and try again. - I think its because I made a mistake at the beginning of the postfix installation how do I correct this :)?
– Rene Mortensen
Jan 25 at 18:17
What's the local hostname, and what's/etc/mailnamecontaining?
– vidarlo
Jan 25 at 18:19
rene-desktop :) - I dont have that folder "/etc/mailname"
– Rene Mortensen
Jan 25 at 18:21
Doesmail root@localhostwork?
– vidarlo
Jan 25 at 18:23
Thank you When i run this to test : mail -s "Test Email for Root $(date)" root <<< "This is a test email."
– Rene Mortensen
Jan 25 at 18:14
Thank you When i run this to test : mail -s "Test Email for Root $(date)" root <<< "This is a test email."
– Rene Mortensen
Jan 25 at 18:14
Your message was not delivered to the root@rene-desktop because the domain rened-esktop was not found. Check if there are spelling errors or excess spaces and try again. - I think its because I made a mistake at the beginning of the postfix installation how do I correct this :)?
– Rene Mortensen
Jan 25 at 18:17
Your message was not delivered to the root@rene-desktop because the domain rened-esktop was not found. Check if there are spelling errors or excess spaces and try again. - I think its because I made a mistake at the beginning of the postfix installation how do I correct this :)?
– Rene Mortensen
Jan 25 at 18:17
What's the local hostname, and what's
/etc/mailname containing?– vidarlo
Jan 25 at 18:19
What's the local hostname, and what's
/etc/mailname containing?– vidarlo
Jan 25 at 18:19
rene-desktop :) - I dont have that folder "/etc/mailname"
– Rene Mortensen
Jan 25 at 18:21
rene-desktop :) - I dont have that folder "/etc/mailname"
– Rene Mortensen
Jan 25 at 18:21
Does
mail root@localhost work?– vidarlo
Jan 25 at 18:23
Does
mail root@localhost work?– vidarlo
Jan 25 at 18:23
|
show 6 more comments
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112840%2fubuntu-postfix-help%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
First of all I am a Linux noob but I want a system that sends me an email in case there are problems on the server such as if it unmount a drive a service goes down or else :)
– Rene Mortensen
Jan 25 at 17:07