Sendmail very slow - /etc/hosts configuration












11















It takes ~15 seconds to send single e-mail using sendmail.



/var/log/mail.log:



Jul 31 09:52:42 piotr-probook sendmail[2912]: My unqualified host name (piotr-probook) unknown; sleeping for retry


/etc/hostname:



piotr-probook


/etc/hosts:



127.0.0.1   piotr-probook localdev localhost
192.168.1.1 router


/etc/mail/sendmail.cf:



# hosts file (normally /etc/hosts)
O HostsFile=/etc/hosts


Obviously I can ping piotr-probook host and HTTP server popups in browser when i type url http://piotr-probook



What am I doing wrong? How to fix the problem?










share|improve this question

























  • Your question and Problem is unclear. Please add more information about what you're trying to archive and what your Problems are (e.g. How do you use sendmail? In a PHP script? Python? Java? Is Apache involved?). Basically: What are you doing?

    – mondjunge
    Jul 31 '13 at 9:20











  • @mondjunge My problem is quite clear. It takes ~15 seconds to send single e-mail using sendmail. I even posted the cause of the issue (see log), and I am just asking how to fix it. I just want to execute sendmail -t mail.txt. No PHP, Java, etc. plain sendmail.

    – Piotr
    Jul 31 '13 at 9:55








  • 1





    Got the answer: superuser.com/a/626219/242163

    – Piotr
    Jul 31 '13 at 10:22
















11















It takes ~15 seconds to send single e-mail using sendmail.



/var/log/mail.log:



Jul 31 09:52:42 piotr-probook sendmail[2912]: My unqualified host name (piotr-probook) unknown; sleeping for retry


/etc/hostname:



piotr-probook


/etc/hosts:



127.0.0.1   piotr-probook localdev localhost
192.168.1.1 router


/etc/mail/sendmail.cf:



# hosts file (normally /etc/hosts)
O HostsFile=/etc/hosts


Obviously I can ping piotr-probook host and HTTP server popups in browser when i type url http://piotr-probook



What am I doing wrong? How to fix the problem?










share|improve this question

























  • Your question and Problem is unclear. Please add more information about what you're trying to archive and what your Problems are (e.g. How do you use sendmail? In a PHP script? Python? Java? Is Apache involved?). Basically: What are you doing?

    – mondjunge
    Jul 31 '13 at 9:20











  • @mondjunge My problem is quite clear. It takes ~15 seconds to send single e-mail using sendmail. I even posted the cause of the issue (see log), and I am just asking how to fix it. I just want to execute sendmail -t mail.txt. No PHP, Java, etc. plain sendmail.

    – Piotr
    Jul 31 '13 at 9:55








  • 1





    Got the answer: superuser.com/a/626219/242163

    – Piotr
    Jul 31 '13 at 10:22














11












11








11


3






It takes ~15 seconds to send single e-mail using sendmail.



/var/log/mail.log:



Jul 31 09:52:42 piotr-probook sendmail[2912]: My unqualified host name (piotr-probook) unknown; sleeping for retry


/etc/hostname:



piotr-probook


/etc/hosts:



127.0.0.1   piotr-probook localdev localhost
192.168.1.1 router


/etc/mail/sendmail.cf:



# hosts file (normally /etc/hosts)
O HostsFile=/etc/hosts


Obviously I can ping piotr-probook host and HTTP server popups in browser when i type url http://piotr-probook



What am I doing wrong? How to fix the problem?










share|improve this question
















It takes ~15 seconds to send single e-mail using sendmail.



/var/log/mail.log:



Jul 31 09:52:42 piotr-probook sendmail[2912]: My unqualified host name (piotr-probook) unknown; sleeping for retry


/etc/hostname:



piotr-probook


/etc/hosts:



127.0.0.1   piotr-probook localdev localhost
192.168.1.1 router


/etc/mail/sendmail.cf:



# hosts file (normally /etc/hosts)
O HostsFile=/etc/hosts


Obviously I can ping piotr-probook host and HTTP server popups in browser when i type url http://piotr-probook



What am I doing wrong? How to fix the problem?







sendmail






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 31 '13 at 9:53







Piotr

















asked Jul 31 '13 at 8:56









PiotrPiotr

196118




196118













  • Your question and Problem is unclear. Please add more information about what you're trying to archive and what your Problems are (e.g. How do you use sendmail? In a PHP script? Python? Java? Is Apache involved?). Basically: What are you doing?

    – mondjunge
    Jul 31 '13 at 9:20











  • @mondjunge My problem is quite clear. It takes ~15 seconds to send single e-mail using sendmail. I even posted the cause of the issue (see log), and I am just asking how to fix it. I just want to execute sendmail -t mail.txt. No PHP, Java, etc. plain sendmail.

    – Piotr
    Jul 31 '13 at 9:55








  • 1





    Got the answer: superuser.com/a/626219/242163

    – Piotr
    Jul 31 '13 at 10:22



















  • Your question and Problem is unclear. Please add more information about what you're trying to archive and what your Problems are (e.g. How do you use sendmail? In a PHP script? Python? Java? Is Apache involved?). Basically: What are you doing?

    – mondjunge
    Jul 31 '13 at 9:20











  • @mondjunge My problem is quite clear. It takes ~15 seconds to send single e-mail using sendmail. I even posted the cause of the issue (see log), and I am just asking how to fix it. I just want to execute sendmail -t mail.txt. No PHP, Java, etc. plain sendmail.

    – Piotr
    Jul 31 '13 at 9:55








  • 1





    Got the answer: superuser.com/a/626219/242163

    – Piotr
    Jul 31 '13 at 10:22

















Your question and Problem is unclear. Please add more information about what you're trying to archive and what your Problems are (e.g. How do you use sendmail? In a PHP script? Python? Java? Is Apache involved?). Basically: What are you doing?

– mondjunge
Jul 31 '13 at 9:20





Your question and Problem is unclear. Please add more information about what you're trying to archive and what your Problems are (e.g. How do you use sendmail? In a PHP script? Python? Java? Is Apache involved?). Basically: What are you doing?

– mondjunge
Jul 31 '13 at 9:20













@mondjunge My problem is quite clear. It takes ~15 seconds to send single e-mail using sendmail. I even posted the cause of the issue (see log), and I am just asking how to fix it. I just want to execute sendmail -t mail.txt. No PHP, Java, etc. plain sendmail.

– Piotr
Jul 31 '13 at 9:55







@mondjunge My problem is quite clear. It takes ~15 seconds to send single e-mail using sendmail. I even posted the cause of the issue (see log), and I am just asking how to fix it. I just want to execute sendmail -t mail.txt. No PHP, Java, etc. plain sendmail.

– Piotr
Jul 31 '13 at 9:55






1




1





Got the answer: superuser.com/a/626219/242163

– Piotr
Jul 31 '13 at 10:22





Got the answer: superuser.com/a/626219/242163

– Piotr
Jul 31 '13 at 10:22










2 Answers
2






active

oldest

votes


















14














Got the answer at superuser.com https://superuser.com/a/626219/242163:





Sendmail requires that the result of "hostname" be a fully qualified domain name to start cleanly.



Set the hostname to something like piotr-probook.localdomain and update /etc/hosts.



/etc/hosts



127.0.0.1   piotr-probook.localdomain piotr-probook localdev localhost





share|improve this answer


























  • Also make sure you have a resolvable FQDN in /etc/mailname

    – jeremiah
    Aug 1 '13 at 8:08











  • in my case localhost.localdomain along with localhoat and hostname was the missing piece (debian's sendmail inside docker)

    – vladkras
    Jun 19 '17 at 9:36



















13














The above answer didn't work for me. So I am posting here what I have done to make it work.



Installed send mail through terminal



apt-get install sendmail


then opened the hosts file



# edited from: sudo gedit etc/hosts
sudo gedit /etc/hosts


replaced the the line



127.0.0.1 localhost


with



127.0.0.1 localhost localhost.localdomain mydomainname


To get the domain name please type



hostname


in terminal and run.



restart apache



sudo service apache2 restart





share|improve this answer





















  • 2





    sendmail should not be related to apache

    – Zitrax
    Jan 30 '15 at 14:54











  • @Zitrax i didn't get you. Can you please explain what do you mean?

    – Mad Angle
    Apr 2 '15 at 6:16






  • 1





    Your last step restarts apache, I just meant that shouldn't be needed for fixing the sendmail issue.

    – Zitrax
    Apr 2 '15 at 7:38






  • 1





    Very clear and worked like a charm. Thanks!

    – Andrew Swift
    Apr 30 '15 at 13:53











  • The apache restart ins't necessary I'm guessing, since you changed the hosts file and it is independent form apache. Anyway, I might be wrong and restarting apache also does something weird to sendmail, maybe it touches some files used by both Apache and Senmail but I doubt it.

    – loco.loop
    Sep 1 '16 at 19:13










protected by Thomas Ward Jan 3 at 14:36



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?














2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









14














Got the answer at superuser.com https://superuser.com/a/626219/242163:





Sendmail requires that the result of "hostname" be a fully qualified domain name to start cleanly.



Set the hostname to something like piotr-probook.localdomain and update /etc/hosts.



/etc/hosts



127.0.0.1   piotr-probook.localdomain piotr-probook localdev localhost





share|improve this answer


























  • Also make sure you have a resolvable FQDN in /etc/mailname

    – jeremiah
    Aug 1 '13 at 8:08











  • in my case localhost.localdomain along with localhoat and hostname was the missing piece (debian's sendmail inside docker)

    – vladkras
    Jun 19 '17 at 9:36
















14














Got the answer at superuser.com https://superuser.com/a/626219/242163:





Sendmail requires that the result of "hostname" be a fully qualified domain name to start cleanly.



Set the hostname to something like piotr-probook.localdomain and update /etc/hosts.



/etc/hosts



127.0.0.1   piotr-probook.localdomain piotr-probook localdev localhost





share|improve this answer


























  • Also make sure you have a resolvable FQDN in /etc/mailname

    – jeremiah
    Aug 1 '13 at 8:08











  • in my case localhost.localdomain along with localhoat and hostname was the missing piece (debian's sendmail inside docker)

    – vladkras
    Jun 19 '17 at 9:36














14












14








14







Got the answer at superuser.com https://superuser.com/a/626219/242163:





Sendmail requires that the result of "hostname" be a fully qualified domain name to start cleanly.



Set the hostname to something like piotr-probook.localdomain and update /etc/hosts.



/etc/hosts



127.0.0.1   piotr-probook.localdomain piotr-probook localdev localhost





share|improve this answer















Got the answer at superuser.com https://superuser.com/a/626219/242163:





Sendmail requires that the result of "hostname" be a fully qualified domain name to start cleanly.



Set the hostname to something like piotr-probook.localdomain and update /etc/hosts.



/etc/hosts



127.0.0.1   piotr-probook.localdomain piotr-probook localdev localhost






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 20 '17 at 10:04









Community

1




1










answered Aug 1 '13 at 8:01









PiotrPiotr

196118




196118













  • Also make sure you have a resolvable FQDN in /etc/mailname

    – jeremiah
    Aug 1 '13 at 8:08











  • in my case localhost.localdomain along with localhoat and hostname was the missing piece (debian's sendmail inside docker)

    – vladkras
    Jun 19 '17 at 9:36



















  • Also make sure you have a resolvable FQDN in /etc/mailname

    – jeremiah
    Aug 1 '13 at 8:08











  • in my case localhost.localdomain along with localhoat and hostname was the missing piece (debian's sendmail inside docker)

    – vladkras
    Jun 19 '17 at 9:36

















Also make sure you have a resolvable FQDN in /etc/mailname

– jeremiah
Aug 1 '13 at 8:08





Also make sure you have a resolvable FQDN in /etc/mailname

– jeremiah
Aug 1 '13 at 8:08













in my case localhost.localdomain along with localhoat and hostname was the missing piece (debian's sendmail inside docker)

– vladkras
Jun 19 '17 at 9:36





in my case localhost.localdomain along with localhoat and hostname was the missing piece (debian's sendmail inside docker)

– vladkras
Jun 19 '17 at 9:36













13














The above answer didn't work for me. So I am posting here what I have done to make it work.



Installed send mail through terminal



apt-get install sendmail


then opened the hosts file



# edited from: sudo gedit etc/hosts
sudo gedit /etc/hosts


replaced the the line



127.0.0.1 localhost


with



127.0.0.1 localhost localhost.localdomain mydomainname


To get the domain name please type



hostname


in terminal and run.



restart apache



sudo service apache2 restart





share|improve this answer





















  • 2





    sendmail should not be related to apache

    – Zitrax
    Jan 30 '15 at 14:54











  • @Zitrax i didn't get you. Can you please explain what do you mean?

    – Mad Angle
    Apr 2 '15 at 6:16






  • 1





    Your last step restarts apache, I just meant that shouldn't be needed for fixing the sendmail issue.

    – Zitrax
    Apr 2 '15 at 7:38






  • 1





    Very clear and worked like a charm. Thanks!

    – Andrew Swift
    Apr 30 '15 at 13:53











  • The apache restart ins't necessary I'm guessing, since you changed the hosts file and it is independent form apache. Anyway, I might be wrong and restarting apache also does something weird to sendmail, maybe it touches some files used by both Apache and Senmail but I doubt it.

    – loco.loop
    Sep 1 '16 at 19:13
















13














The above answer didn't work for me. So I am posting here what I have done to make it work.



Installed send mail through terminal



apt-get install sendmail


then opened the hosts file



# edited from: sudo gedit etc/hosts
sudo gedit /etc/hosts


replaced the the line



127.0.0.1 localhost


with



127.0.0.1 localhost localhost.localdomain mydomainname


To get the domain name please type



hostname


in terminal and run.



restart apache



sudo service apache2 restart





share|improve this answer





















  • 2





    sendmail should not be related to apache

    – Zitrax
    Jan 30 '15 at 14:54











  • @Zitrax i didn't get you. Can you please explain what do you mean?

    – Mad Angle
    Apr 2 '15 at 6:16






  • 1





    Your last step restarts apache, I just meant that shouldn't be needed for fixing the sendmail issue.

    – Zitrax
    Apr 2 '15 at 7:38






  • 1





    Very clear and worked like a charm. Thanks!

    – Andrew Swift
    Apr 30 '15 at 13:53











  • The apache restart ins't necessary I'm guessing, since you changed the hosts file and it is independent form apache. Anyway, I might be wrong and restarting apache also does something weird to sendmail, maybe it touches some files used by both Apache and Senmail but I doubt it.

    – loco.loop
    Sep 1 '16 at 19:13














13












13








13







The above answer didn't work for me. So I am posting here what I have done to make it work.



Installed send mail through terminal



apt-get install sendmail


then opened the hosts file



# edited from: sudo gedit etc/hosts
sudo gedit /etc/hosts


replaced the the line



127.0.0.1 localhost


with



127.0.0.1 localhost localhost.localdomain mydomainname


To get the domain name please type



hostname


in terminal and run.



restart apache



sudo service apache2 restart





share|improve this answer















The above answer didn't work for me. So I am posting here what I have done to make it work.



Installed send mail through terminal



apt-get install sendmail


then opened the hosts file



# edited from: sudo gedit etc/hosts
sudo gedit /etc/hosts


replaced the the line



127.0.0.1 localhost


with



127.0.0.1 localhost localhost.localdomain mydomainname


To get the domain name please type



hostname


in terminal and run.



restart apache



sudo service apache2 restart






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 11 '16 at 14:35









VishKicka

1034




1034










answered Nov 25 '14 at 6:34









Mad AngleMad Angle

23127




23127








  • 2





    sendmail should not be related to apache

    – Zitrax
    Jan 30 '15 at 14:54











  • @Zitrax i didn't get you. Can you please explain what do you mean?

    – Mad Angle
    Apr 2 '15 at 6:16






  • 1





    Your last step restarts apache, I just meant that shouldn't be needed for fixing the sendmail issue.

    – Zitrax
    Apr 2 '15 at 7:38






  • 1





    Very clear and worked like a charm. Thanks!

    – Andrew Swift
    Apr 30 '15 at 13:53











  • The apache restart ins't necessary I'm guessing, since you changed the hosts file and it is independent form apache. Anyway, I might be wrong and restarting apache also does something weird to sendmail, maybe it touches some files used by both Apache and Senmail but I doubt it.

    – loco.loop
    Sep 1 '16 at 19:13














  • 2





    sendmail should not be related to apache

    – Zitrax
    Jan 30 '15 at 14:54











  • @Zitrax i didn't get you. Can you please explain what do you mean?

    – Mad Angle
    Apr 2 '15 at 6:16






  • 1





    Your last step restarts apache, I just meant that shouldn't be needed for fixing the sendmail issue.

    – Zitrax
    Apr 2 '15 at 7:38






  • 1





    Very clear and worked like a charm. Thanks!

    – Andrew Swift
    Apr 30 '15 at 13:53











  • The apache restart ins't necessary I'm guessing, since you changed the hosts file and it is independent form apache. Anyway, I might be wrong and restarting apache also does something weird to sendmail, maybe it touches some files used by both Apache and Senmail but I doubt it.

    – loco.loop
    Sep 1 '16 at 19:13








2




2





sendmail should not be related to apache

– Zitrax
Jan 30 '15 at 14:54





sendmail should not be related to apache

– Zitrax
Jan 30 '15 at 14:54













@Zitrax i didn't get you. Can you please explain what do you mean?

– Mad Angle
Apr 2 '15 at 6:16





@Zitrax i didn't get you. Can you please explain what do you mean?

– Mad Angle
Apr 2 '15 at 6:16




1




1





Your last step restarts apache, I just meant that shouldn't be needed for fixing the sendmail issue.

– Zitrax
Apr 2 '15 at 7:38





Your last step restarts apache, I just meant that shouldn't be needed for fixing the sendmail issue.

– Zitrax
Apr 2 '15 at 7:38




1




1





Very clear and worked like a charm. Thanks!

– Andrew Swift
Apr 30 '15 at 13:53





Very clear and worked like a charm. Thanks!

– Andrew Swift
Apr 30 '15 at 13:53













The apache restart ins't necessary I'm guessing, since you changed the hosts file and it is independent form apache. Anyway, I might be wrong and restarting apache also does something weird to sendmail, maybe it touches some files used by both Apache and Senmail but I doubt it.

– loco.loop
Sep 1 '16 at 19:13





The apache restart ins't necessary I'm guessing, since you changed the hosts file and it is independent form apache. Anyway, I might be wrong and restarting apache also does something weird to sendmail, maybe it touches some files used by both Apache and Senmail but I doubt it.

– loco.loop
Sep 1 '16 at 19:13





protected by Thomas Ward Jan 3 at 14:36



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?



Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

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