Forward “local mails” to external SMTP server
I have a standalone 18.04 server just for running a simple LAMP website. Sometimes when I log in to the server I get notified that I have mail (like cron/at job outputs), and then I read them using mutt. The problem is that I get to know their existence only when I log in. Is there a configuration somewhere to automatically forward these local mails to my company email address so that I really get active notifications?
p.s. Sendmail is also installed but the only configuration I made to it is define(`SMART_HOST', `smtp.mycompany.com')dnl
in /etc/mail/sendmail.mc
, so that my PHP application can send emails through SMTP server with just a few lines of codes.
mail smtp
add a comment |
I have a standalone 18.04 server just for running a simple LAMP website. Sometimes when I log in to the server I get notified that I have mail (like cron/at job outputs), and then I read them using mutt. The problem is that I get to know their existence only when I log in. Is there a configuration somewhere to automatically forward these local mails to my company email address so that I really get active notifications?
p.s. Sendmail is also installed but the only configuration I made to it is define(`SMART_HOST', `smtp.mycompany.com')dnl
in /etc/mail/sendmail.mc
, so that my PHP application can send emails through SMTP server with just a few lines of codes.
mail smtp
What is in/etc/aliases
?
– fkraiem
Jan 24 at 14:30
add a comment |
I have a standalone 18.04 server just for running a simple LAMP website. Sometimes when I log in to the server I get notified that I have mail (like cron/at job outputs), and then I read them using mutt. The problem is that I get to know their existence only when I log in. Is there a configuration somewhere to automatically forward these local mails to my company email address so that I really get active notifications?
p.s. Sendmail is also installed but the only configuration I made to it is define(`SMART_HOST', `smtp.mycompany.com')dnl
in /etc/mail/sendmail.mc
, so that my PHP application can send emails through SMTP server with just a few lines of codes.
mail smtp
I have a standalone 18.04 server just for running a simple LAMP website. Sometimes when I log in to the server I get notified that I have mail (like cron/at job outputs), and then I read them using mutt. The problem is that I get to know their existence only when I log in. Is there a configuration somewhere to automatically forward these local mails to my company email address so that I really get active notifications?
p.s. Sendmail is also installed but the only configuration I made to it is define(`SMART_HOST', `smtp.mycompany.com')dnl
in /etc/mail/sendmail.mc
, so that my PHP application can send emails through SMTP server with just a few lines of codes.
mail smtp
mail smtp
asked Jan 24 at 13:57
Jyunhao ShihJyunhao Shih
113
113
What is in/etc/aliases
?
– fkraiem
Jan 24 at 14:30
add a comment |
What is in/etc/aliases
?
– fkraiem
Jan 24 at 14:30
What is in
/etc/aliases
?– fkraiem
Jan 24 at 14:30
What is in
/etc/aliases
?– fkraiem
Jan 24 at 14:30
add a comment |
1 Answer
1
active
oldest
votes
If you'r Sendmail/Postfix is configured and running.
Just insert/replace in /etc/aliases
root: email@yourcompany.com
IMHO it is better to keep local copy too.root: email@yourcompany.com, local_account_name
– AnFi
Jan 25 at 7:24
My /etc/aliases is likeroot: my_local_account,my_company_account@mycompany.com (new line) my_local_account: my_local_account,my_company_account@mycompany.com
, and I ransudo newaliases
after editing this file. However none of the mails get sent to my company mailbox, though mails for root do get sent to my_local_account. Just now I tested my PHP application, which sends mail to users as usual, so it seems that the SMART_HOST setting in sendmail.mc as mentioned in my original post does work.
– Jyunhao Shih
Jan 28 at 0:52
add a comment |
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%2f1112510%2fforward-local-mails-to-external-smtp-server%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
If you'r Sendmail/Postfix is configured and running.
Just insert/replace in /etc/aliases
root: email@yourcompany.com
IMHO it is better to keep local copy too.root: email@yourcompany.com, local_account_name
– AnFi
Jan 25 at 7:24
My /etc/aliases is likeroot: my_local_account,my_company_account@mycompany.com (new line) my_local_account: my_local_account,my_company_account@mycompany.com
, and I ransudo newaliases
after editing this file. However none of the mails get sent to my company mailbox, though mails for root do get sent to my_local_account. Just now I tested my PHP application, which sends mail to users as usual, so it seems that the SMART_HOST setting in sendmail.mc as mentioned in my original post does work.
– Jyunhao Shih
Jan 28 at 0:52
add a comment |
If you'r Sendmail/Postfix is configured and running.
Just insert/replace in /etc/aliases
root: email@yourcompany.com
IMHO it is better to keep local copy too.root: email@yourcompany.com, local_account_name
– AnFi
Jan 25 at 7:24
My /etc/aliases is likeroot: my_local_account,my_company_account@mycompany.com (new line) my_local_account: my_local_account,my_company_account@mycompany.com
, and I ransudo newaliases
after editing this file. However none of the mails get sent to my company mailbox, though mails for root do get sent to my_local_account. Just now I tested my PHP application, which sends mail to users as usual, so it seems that the SMART_HOST setting in sendmail.mc as mentioned in my original post does work.
– Jyunhao Shih
Jan 28 at 0:52
add a comment |
If you'r Sendmail/Postfix is configured and running.
Just insert/replace in /etc/aliases
root: email@yourcompany.com
If you'r Sendmail/Postfix is configured and running.
Just insert/replace in /etc/aliases
root: email@yourcompany.com
answered Jan 24 at 14:48
maxmmaxm
266
266
IMHO it is better to keep local copy too.root: email@yourcompany.com, local_account_name
– AnFi
Jan 25 at 7:24
My /etc/aliases is likeroot: my_local_account,my_company_account@mycompany.com (new line) my_local_account: my_local_account,my_company_account@mycompany.com
, and I ransudo newaliases
after editing this file. However none of the mails get sent to my company mailbox, though mails for root do get sent to my_local_account. Just now I tested my PHP application, which sends mail to users as usual, so it seems that the SMART_HOST setting in sendmail.mc as mentioned in my original post does work.
– Jyunhao Shih
Jan 28 at 0:52
add a comment |
IMHO it is better to keep local copy too.root: email@yourcompany.com, local_account_name
– AnFi
Jan 25 at 7:24
My /etc/aliases is likeroot: my_local_account,my_company_account@mycompany.com (new line) my_local_account: my_local_account,my_company_account@mycompany.com
, and I ransudo newaliases
after editing this file. However none of the mails get sent to my company mailbox, though mails for root do get sent to my_local_account. Just now I tested my PHP application, which sends mail to users as usual, so it seems that the SMART_HOST setting in sendmail.mc as mentioned in my original post does work.
– Jyunhao Shih
Jan 28 at 0:52
IMHO it is better to keep local copy too.
root: email@yourcompany.com, local_account_name
– AnFi
Jan 25 at 7:24
IMHO it is better to keep local copy too.
root: email@yourcompany.com, local_account_name
– AnFi
Jan 25 at 7:24
My /etc/aliases is like
root: my_local_account,my_company_account@mycompany.com (new line) my_local_account: my_local_account,my_company_account@mycompany.com
, and I ran sudo newaliases
after editing this file. However none of the mails get sent to my company mailbox, though mails for root do get sent to my_local_account. Just now I tested my PHP application, which sends mail to users as usual, so it seems that the SMART_HOST setting in sendmail.mc as mentioned in my original post does work.– Jyunhao Shih
Jan 28 at 0:52
My /etc/aliases is like
root: my_local_account,my_company_account@mycompany.com (new line) my_local_account: my_local_account,my_company_account@mycompany.com
, and I ran sudo newaliases
after editing this file. However none of the mails get sent to my company mailbox, though mails for root do get sent to my_local_account. Just now I tested my PHP application, which sends mail to users as usual, so it seems that the SMART_HOST setting in sendmail.mc as mentioned in my original post does work.– Jyunhao Shih
Jan 28 at 0:52
add a comment |
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%2f1112510%2fforward-local-mails-to-external-smtp-server%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
What is in
/etc/aliases
?– fkraiem
Jan 24 at 14:30