Can't send emails from the terminal [duplicate]





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0
















This question already has an answer here:




  • Why can't I send emails from the command line to my gmail account

    2 answers




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















marked as duplicate by terdon command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
12 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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
















This question already has an answer here:




  • Why can't I send emails from the command line to my gmail account

    2 answers




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















marked as duplicate by terdon command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
12 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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







This question already has an answer here:




  • Why can't I send emails from the command line to my gmail account

    2 answers




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

















This question already has an answer here:




  • Why can't I send emails from the command line to my gmail account

    2 answers




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.





This question already has an answer here:




  • Why can't I send emails from the command line to my gmail account

    2 answers








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,486133170




9,486133170










asked Jan 16 '13 at 9:32









oshirowanenoshirowanen

850185992




850185992




marked as duplicate by terdon command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
12 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by terdon command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
12 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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





















  • 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


















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



Popular posts from this blog

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?