configuration - sendmail: how to configure sendmail on ubuntu?

ID : 20178

viewed : 18

Tags : ubuntuconfigurationsendmailubuntu

Top 5 Answer for configuration - sendmail: how to configure sendmail on ubuntu?

vote vote

100

When you typed in sudo sendmailconfig, you should have been prompted to configure sendmail.

For reference, the files that are updated during configuration are located at the following (in case you want to update them manually):

/etc/mail/sendmail.conf /etc/cron.d/sendmail /etc/mail/sendmail.mc 

You can test sendmail to see if it is properly configured and setup by typing the following into the command line:

$ echo "My test email being sent from sendmail" | /usr/sbin/sendmail myemail@domain.com 

The following will allow you to add smtp relay to sendmail:

#Change to your mail config directory: cd /etc/mail  #Make a auth subdirectory mkdir auth chmod 700 auth  #Create a file with your auth information to the smtp server cd auth touch client-info  #In the file, put the following, matching up to your smtp server: AuthInfo:your.isp.net "U:root" "I:user" "P:password"  #Generate the Authentication database, make both files readable only by root makemap hash client-info < client-info chmod 600 client-info cd .. 

Add the following lines to sendmail.mc, but before the MAILERDEFINITIONS. Make sure you update your smtp server.

define(`SMART_HOST',`your.isp.net')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info.db')dnl 

Invoke creation sendmail.cf (alternatively run make -C /etc/mail):

m4 sendmail.mc > sendmail.cf 

Restart the sendmail daemon:

service sendmail restart 
vote vote

85

I got the top answer working (can't reply yet) after one small edit

This did not work for me:

FEATURE('authinfo','hash /etc/mail/auth/client-info')dnl 

The first single quote for each string should be changed to a backtick (`) like this:

FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl 

After the change I run:

sudo sendmailconfig 

And I'm in business :)

vote vote

71

Combine two answers above, I finally make it work. Just be careful that the first single quote for each string is a backtick (`) in file sendmail.mc.

#Change to your mail config directory: cd /etc/mail  #Make a auth subdirectory mkdir auth chmod 700 auth  #maybe not, because I cannot apply cmd "cd auth" if I do so.  #Create a file with your auth information to the smtp server cd auth touch client-info  #In the file, put the following, matching up to your smtp server: AuthInfo:your.isp.net "U:root" "I:user" "P:password"  #Generate the Authentication database, make both files readable only by root makemap hash client-info < client-info chmod 600 client-info cd ..  #Add the following lines to sendmail.mc. Make sure you update your smtp server #The first single quote for each string should be changed to a backtick (`) like this: define(`SMART_HOST',`your.isp.net')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl  #run  sudo sendmailconfig 
vote vote

65

C is a language and in its definition, there do not need to be any functions available to you. No IO, no math routines and so on. By convention, there are a set of routines available to you that you can link into your executable, but you don't need to use them. This is, however, such a common thing to do that most linkers don't ask you to link to the C runtime libraries anymore.

There are times when you don't want them - for example, in working with embedded systems, it might be impractical to have malloc, for example. I used to work on embedding PostScript into printers and we had our own set of runtime libraries that were much happier on embedded systems, so we didn't bother with the "standard".

vote vote

55

The runtime library is that library that is automatically compiled in for any C program you run. The version of the library you would use depends on your compiler, platform, debugging options, and multithreading options.

A good description of the different choices for runtime libraries: http://www.davidlenihan.com/2008/01/choosing_the_correct_cc_runtim.html

It includes those functions you don't normally think of as needing a library to call:

  • malloc
  • enum, struct
  • abs, min
  • assert

Microsoft has a nice list of their runtime library functions:

http://msdn.microsoft.com/en-us/library/2aza74he(VS.71).aspx

The exact list of functions would vary depending on compiler, so for iOS you would get other functions like dispatch_async() or NSLog().

Top 3 video Explaining configuration - sendmail: how to configure sendmail on ubuntu?

Related QUESTION?