Can't send emails from the terminal












0















I setup a basic email sending only server on my laptop using the following



sudo tasksel install mail-server


But for some reason I didn't get asked what kind of installation I want to do, i.e. a localhost only, internet etc etc



I used the following command to send an email from the terminal



echo 'body' | sendmail oshirowanen@gmail.com


I did not receive the email. I checked both my inbox and spam box. Plus I don't have a firewall, so no rules would have blocked the email going out. Unless of-course, ubuntu by default has a necessary port closed which is needed for sending emails out?



The mail.log is showing the following and the log is getting bigger and bigger:



Jan 16 09:21:04 ubuntu postfix/master[5923]: daemon started -- version 2.9.3, configuration /etc/postfix
Jan 16 09:21:04 ubuntu postfix/qmgr[5925]: ES8B132738: from=<oshirowanen@ubuntu>, size=233, nrcpt=1 (queue active)
Jan 16 09:21:09 ubuntu postfix/smtp[5927]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable
Jan 16 09:21:27 ubuntu dovecot: master: Dovecot v2.0.19 starting up (core dumps disabled)
Jan 16 09:21:39 ubuntu postfix/smtp[5927]: connect to gmail-smtp-in.l.google.com[173.194.67.27]:25: Connection timed out
Jan 16 09:22:09 ubuntu postfix/smtp[5927]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection timed out
Jan 16 09:22:09 ubuntu postfix/smtp[5927]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4001:c02::1b]:25: Network is unreachable
Jan 16 09:22:39 ubuntu postfix/smtp[5927]: connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out
Jan 16 09:22:39 ubuntu postfix/smtp[5927]: ES8B132738: to=<oshirowanen@gmail.com>, relay=none, delay=1547, delays=1452/0.05/95/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out)


How do I stop my laptop trying to send the email, and how do I setup the mail-server properly. I just want to be able to send emails out so I can use PHP to send emails out. I do not need to receive emails in.










share|improve this question

























  • Most ISPs block port 25 outgoing for connections not specifically assigned for business use or mail server use. This is to prevent spam being sent by malware on PCs. The solution is to use the ISP's relay server as relay server configured in your MTA.

    – gertvdijk
    Feb 2 '13 at 11:30


















0















I setup a basic email sending only server on my laptop using the following



sudo tasksel install mail-server


But for some reason I didn't get asked what kind of installation I want to do, i.e. a localhost only, internet etc etc



I used the following command to send an email from the terminal



echo 'body' | sendmail oshirowanen@gmail.com


I did not receive the email. I checked both my inbox and spam box. Plus I don't have a firewall, so no rules would have blocked the email going out. Unless of-course, ubuntu by default has a necessary port closed which is needed for sending emails out?



The mail.log is showing the following and the log is getting bigger and bigger:



Jan 16 09:21:04 ubuntu postfix/master[5923]: daemon started -- version 2.9.3, configuration /etc/postfix
Jan 16 09:21:04 ubuntu postfix/qmgr[5925]: ES8B132738: from=<oshirowanen@ubuntu>, size=233, nrcpt=1 (queue active)
Jan 16 09:21:09 ubuntu postfix/smtp[5927]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable
Jan 16 09:21:27 ubuntu dovecot: master: Dovecot v2.0.19 starting up (core dumps disabled)
Jan 16 09:21:39 ubuntu postfix/smtp[5927]: connect to gmail-smtp-in.l.google.com[173.194.67.27]:25: Connection timed out
Jan 16 09:22:09 ubuntu postfix/smtp[5927]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection timed out
Jan 16 09:22:09 ubuntu postfix/smtp[5927]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4001:c02::1b]:25: Network is unreachable
Jan 16 09:22:39 ubuntu postfix/smtp[5927]: connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out
Jan 16 09:22:39 ubuntu postfix/smtp[5927]: ES8B132738: to=<oshirowanen@gmail.com>, relay=none, delay=1547, delays=1452/0.05/95/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out)


How do I stop my laptop trying to send the email, and how do I setup the mail-server properly. I just want to be able to send emails out so I can use PHP to send emails out. I do not need to receive emails in.










share|improve this question

























  • Most ISPs block port 25 outgoing for connections not specifically assigned for business use or mail server use. This is to prevent spam being sent by malware on PCs. The solution is to use the ISP's relay server as relay server configured in your MTA.

    – gertvdijk
    Feb 2 '13 at 11:30
















0












0








0


1






I setup a basic email sending only server on my laptop using the following



sudo tasksel install mail-server


But for some reason I didn't get asked what kind of installation I want to do, i.e. a localhost only, internet etc etc



I used the following command to send an email from the terminal



echo 'body' | sendmail oshirowanen@gmail.com


I did not receive the email. I checked both my inbox and spam box. Plus I don't have a firewall, so no rules would have blocked the email going out. Unless of-course, ubuntu by default has a necessary port closed which is needed for sending emails out?



The mail.log is showing the following and the log is getting bigger and bigger:



Jan 16 09:21:04 ubuntu postfix/master[5923]: daemon started -- version 2.9.3, configuration /etc/postfix
Jan 16 09:21:04 ubuntu postfix/qmgr[5925]: ES8B132738: from=<oshirowanen@ubuntu>, size=233, nrcpt=1 (queue active)
Jan 16 09:21:09 ubuntu postfix/smtp[5927]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable
Jan 16 09:21:27 ubuntu dovecot: master: Dovecot v2.0.19 starting up (core dumps disabled)
Jan 16 09:21:39 ubuntu postfix/smtp[5927]: connect to gmail-smtp-in.l.google.com[173.194.67.27]:25: Connection timed out
Jan 16 09:22:09 ubuntu postfix/smtp[5927]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection timed out
Jan 16 09:22:09 ubuntu postfix/smtp[5927]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4001:c02::1b]:25: Network is unreachable
Jan 16 09:22:39 ubuntu postfix/smtp[5927]: connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out
Jan 16 09:22:39 ubuntu postfix/smtp[5927]: ES8B132738: to=<oshirowanen@gmail.com>, relay=none, delay=1547, delays=1452/0.05/95/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out)


How do I stop my laptop trying to send the email, and how do I setup the mail-server properly. I just want to be able to send emails out so I can use PHP to send emails out. I do not need to receive emails in.










share|improve this question
















I setup a basic email sending only server on my laptop using the following



sudo tasksel install mail-server


But for some reason I didn't get asked what kind of installation I want to do, i.e. a localhost only, internet etc etc



I used the following command to send an email from the terminal



echo 'body' | sendmail oshirowanen@gmail.com


I did not receive the email. I checked both my inbox and spam box. Plus I don't have a firewall, so no rules would have blocked the email going out. Unless of-course, ubuntu by default has a necessary port closed which is needed for sending emails out?



The mail.log is showing the following and the log is getting bigger and bigger:



Jan 16 09:21:04 ubuntu postfix/master[5923]: daemon started -- version 2.9.3, configuration /etc/postfix
Jan 16 09:21:04 ubuntu postfix/qmgr[5925]: ES8B132738: from=<oshirowanen@ubuntu>, size=233, nrcpt=1 (queue active)
Jan 16 09:21:09 ubuntu postfix/smtp[5927]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable
Jan 16 09:21:27 ubuntu dovecot: master: Dovecot v2.0.19 starting up (core dumps disabled)
Jan 16 09:21:39 ubuntu postfix/smtp[5927]: connect to gmail-smtp-in.l.google.com[173.194.67.27]:25: Connection timed out
Jan 16 09:22:09 ubuntu postfix/smtp[5927]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection timed out
Jan 16 09:22:09 ubuntu postfix/smtp[5927]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4001:c02::1b]:25: Network is unreachable
Jan 16 09:22:39 ubuntu postfix/smtp[5927]: connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out
Jan 16 09:22:39 ubuntu postfix/smtp[5927]: ES8B132738: to=<oshirowanen@gmail.com>, relay=none, delay=1547, delays=1452/0.05/95/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out)


How do I stop my laptop trying to send the email, and how do I setup the mail-server properly. I just want to be able to send emails out so I can use PHP to send emails out. I do not need to receive emails in.







command-line mail-server






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 16 '13 at 21:49









guntbert

9,291133170




9,291133170










asked Jan 16 '13 at 9:32









oshirowanenoshirowanen

1,030185991




1,030185991













  • Most ISPs block port 25 outgoing for connections not specifically assigned for business use or mail server use. This is to prevent spam being sent by malware on PCs. The solution is to use the ISP's relay server as relay server configured in your MTA.

    – gertvdijk
    Feb 2 '13 at 11:30





















  • Most ISPs block port 25 outgoing for connections not specifically assigned for business use or mail server use. This is to prevent spam being sent by malware on PCs. The solution is to use the ISP's relay server as relay server configured in your MTA.

    – gertvdijk
    Feb 2 '13 at 11:30



















Most ISPs block port 25 outgoing for connections not specifically assigned for business use or mail server use. This is to prevent spam being sent by malware on PCs. The solution is to use the ISP's relay server as relay server configured in your MTA.

– gertvdijk
Feb 2 '13 at 11:30







Most ISPs block port 25 outgoing for connections not specifically assigned for business use or mail server use. This is to prevent spam being sent by malware on PCs. The solution is to use the ISP's relay server as relay server configured in your MTA.

– gertvdijk
Feb 2 '13 at 11:30












1 Answer
1






active

oldest

votes


















0














First of all, you have to tell your Mail Transport Agent (MTA, in your case postfix) which sender is allowed to send e-mail, additionally you have to tell him, how you want to send it - via an Internet Service Provider, or via a company network? Even if you want to "send an email from the terminal" a mail program is doing the work (e.g. bsd-mailx).



It's essential to get some knowledge about the functions of a MTA, of mail programs and about Spam.
You could start here: https://help.ubuntu.com/community/PostfixBasicSetupHowto



After you decided how you want to send your emails you could ask some more specific questions, depending if you want to build up an Internet Site, an Internet smarthost, a satellite system or a local system.






share|improve this answer


























  • You also should setup your network card/gateway to clear "Network is unreachable" error. Without internet access you will never connect to gmail servers! As MTA can't connect, the email is stored in a queue (mailq command to see it), and MTA retries to send it periodically (status=deferred)

    – Arcadien
    Jan 16 '13 at 11:01











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f243758%2fcant-send-emails-from-the-terminal%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









0














First of all, you have to tell your Mail Transport Agent (MTA, in your case postfix) which sender is allowed to send e-mail, additionally you have to tell him, how you want to send it - via an Internet Service Provider, or via a company network? Even if you want to "send an email from the terminal" a mail program is doing the work (e.g. bsd-mailx).



It's essential to get some knowledge about the functions of a MTA, of mail programs and about Spam.
You could start here: https://help.ubuntu.com/community/PostfixBasicSetupHowto



After you decided how you want to send your emails you could ask some more specific questions, depending if you want to build up an Internet Site, an Internet smarthost, a satellite system or a local system.






share|improve this answer


























  • You also should setup your network card/gateway to clear "Network is unreachable" error. Without internet access you will never connect to gmail servers! As MTA can't connect, the email is stored in a queue (mailq command to see it), and MTA retries to send it periodically (status=deferred)

    – Arcadien
    Jan 16 '13 at 11:01
















0














First of all, you have to tell your Mail Transport Agent (MTA, in your case postfix) which sender is allowed to send e-mail, additionally you have to tell him, how you want to send it - via an Internet Service Provider, or via a company network? Even if you want to "send an email from the terminal" a mail program is doing the work (e.g. bsd-mailx).



It's essential to get some knowledge about the functions of a MTA, of mail programs and about Spam.
You could start here: https://help.ubuntu.com/community/PostfixBasicSetupHowto



After you decided how you want to send your emails you could ask some more specific questions, depending if you want to build up an Internet Site, an Internet smarthost, a satellite system or a local system.






share|improve this answer


























  • You also should setup your network card/gateway to clear "Network is unreachable" error. Without internet access you will never connect to gmail servers! As MTA can't connect, the email is stored in a queue (mailq command to see it), and MTA retries to send it periodically (status=deferred)

    – Arcadien
    Jan 16 '13 at 11:01














0












0








0







First of all, you have to tell your Mail Transport Agent (MTA, in your case postfix) which sender is allowed to send e-mail, additionally you have to tell him, how you want to send it - via an Internet Service Provider, or via a company network? Even if you want to "send an email from the terminal" a mail program is doing the work (e.g. bsd-mailx).



It's essential to get some knowledge about the functions of a MTA, of mail programs and about Spam.
You could start here: https://help.ubuntu.com/community/PostfixBasicSetupHowto



After you decided how you want to send your emails you could ask some more specific questions, depending if you want to build up an Internet Site, an Internet smarthost, a satellite system or a local system.






share|improve this answer















First of all, you have to tell your Mail Transport Agent (MTA, in your case postfix) which sender is allowed to send e-mail, additionally you have to tell him, how you want to send it - via an Internet Service Provider, or via a company network? Even if you want to "send an email from the terminal" a mail program is doing the work (e.g. bsd-mailx).



It's essential to get some knowledge about the functions of a MTA, of mail programs and about Spam.
You could start here: https://help.ubuntu.com/community/PostfixBasicSetupHowto



After you decided how you want to send your emails you could ask some more specific questions, depending if you want to build up an Internet Site, an Internet smarthost, a satellite system or a local system.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 2 '13 at 11:24

























answered Jan 16 '13 at 9:52









jueshirejueshire

1025




1025













  • You also should setup your network card/gateway to clear "Network is unreachable" error. Without internet access you will never connect to gmail servers! As MTA can't connect, the email is stored in a queue (mailq command to see it), and MTA retries to send it periodically (status=deferred)

    – Arcadien
    Jan 16 '13 at 11:01



















  • You also should setup your network card/gateway to clear "Network is unreachable" error. Without internet access you will never connect to gmail servers! As MTA can't connect, the email is stored in a queue (mailq command to see it), and MTA retries to send it periodically (status=deferred)

    – Arcadien
    Jan 16 '13 at 11:01

















You also should setup your network card/gateway to clear "Network is unreachable" error. Without internet access you will never connect to gmail servers! As MTA can't connect, the email is stored in a queue (mailq command to see it), and MTA retries to send it periodically (status=deferred)

– Arcadien
Jan 16 '13 at 11:01





You also should setup your network card/gateway to clear "Network is unreachable" error. Without internet access you will never connect to gmail servers! As MTA can't connect, the email is stored in a queue (mailq command to see it), and MTA retries to send it periodically (status=deferred)

– Arcadien
Jan 16 '13 at 11:01


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f243758%2fcant-send-emails-from-the-terminal%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

Eduardo VII do Reino Unido