The first two lines tell it we are running as a client in the background. The third line disables FIPS (Federal Information Processing Standards) which is on by default in stunnel. An error occured when stunnel started on my system unless FIPS was disabled. Line 5 begins the service name smtps. It will accept connections with the localhost on port 10025 and then connect to the ISP mail server smtp.att.yahoo.com on port 465. You can choose a port other than 10025 as long as it is an unused port and you use the same port when it comes time to configure the outgoing port in sendmail. Once installed and configured you can start stunnel by simply typing stunnel at the command line. Remember to run stunnel as root.
To allow sendmail to act as a client you will need to set up an authinfo file in /etc/mail. The authinfo file allows sendmail to login and authenticate with your ISP's SMTP server by passing it your username and password. Since the file contains your username and password it needs to be secure. As root it will be created with a user:group of root:root and privileges of -rw-r----- which should be sufficient.
Sendmail Authinfo File Format
I had a few challenges getting this to work and will explain the entries as I understand them. After AuthInfo: is the name of the relay host. In this case, your server is relaying the login information using stunnel to smtp.att.yahoo.com port 465. That is why localhost.localdomain is used rather than going directly to smtp.att.yahoo.com. After U: is the user (authorization) id, root seems to work for me. The I: is the authentication id, the username on your ISP. P: password is self explanatory and M: tells sendmail to send this info in plain text format.
The configuration file sendmail.cf is generated with m4 using macros contained in sendmail.mc. These configuration files are not very intuitive and I always create a backup of whatever is in place before making any changes.
If you have not configured anything, then the first time you try tosend mail via a server and the SMTP server reports back that itrequires authentication, Emacs (version 24.1 and later) prompts youfor the user name and password to use, and then offers to save theinformation. By default, Emacs stores authentication information in afile /.authinfo.
When the SMTP library connects to a host on a certain port, itsearches the /.authinfo file for a matching entry. If anentry is found, the authentication process is invoked and thecredentials are used. If the variable smtpmail-smtp-user isset to a non-nil value, then only entries for that user areconsidered. For more information on the /.authinfofile, see auth-source in Emacs auth-source Library.
Next, create an authinfo file. In your favorite editor open /etc/mail/authinfo and add a line like the one below, replacing domain.com with your domain and YoUrPaSSw0rd with your password. All one line, remember:
Note: This configuration was tested with Red Hat EL3 and EL4 running Sendmail 8.12 and 8.13, respectively. Sendmail 8.14 should work as well. There are some differences if you are using Sendmail 8.11, like the format of the authinfo file. Please see your documentation for the changes.
It gives the message "Message accepted for delivery" at the end, but at the beginning it says connecting to 127.0.0.1 (localhost), should it not instead be connecting to the smtp-relay.gmail.com host I specified in the sendmail.mc and auth / authinfo files' configuration?
The sendmail.mc file governs the behaviour of Sendmail when it runs as a daemon, listening on port 25 for incoming mail connections. This is the sendmail that delivers mail to local mailboxes such as /var/mail/fred or /var/mail/root. If that is all you want to accomplish (often desirable on the average server), then sendmail.mc can be quite a bit simpler than submit.mc. You must have sendmail running as a daemon to deliver locally.
On REDHAT, I have setup an authinfo file with user/password to authenticate to my MS Exchange server, some modification to sendmail.mc file and now my sendmail daemon is able to send email as long as the from address is the user that I use to connect or at least one of the aliases that we have defined for that user.
I would like the emails written through the `mail' command of myNetBSD station to be relayed through gmail SMTP.I am getting these errors : /etc/mail/certs/sendmail.pem unsafe: Permission denied /etc/mail/certs/ca-bundle.crt unsafe: Permission deniedHowever the permissions look fine to me :bash-4.1# ls -lrtd /etc/mail,/certs,/sendmail.pem-rw------- 1 root wheel 1657 Dec 25 07:27 /etc/mail/certs/sendmail.pemdr-x------ 2 root wheel 512 Dec 25 07:41 /etc/mail/certsdrwxr-xr-x 4 root wheel 512 Dec 25 08:25 /etc/mailI have `O RunAsUser=root' in my /etc/mail/sendmail.cfIn _source/installation_and_op_guide.pdfI found option related to silencing errors related to unsafe filepermissions but mostly for the `.forward' files, no for the SASLcertificates.Please, can anyone help ?Germain===8
You may need to compile this file to hash db (on many OSses you may call make inside of /etc/mail) and convert .mc file to sendmail.cf (command is OS specific, make may work) and restart sendmail (make restart in /etc/mail or ``systemctl restart sendmail'')
The get-gmail-token script can be found from the source files of the msmtp-oauth2 package. See more information on getmail link about how this works. And see Gmail API quickstart for instruction on registering a Gmail APP and authorizing it to access emails.
Note that you can not use a user configuration file (ie: one under /) if you plan on using msmtp as a sendmail replacement with php or something similar.In that case just create /etc/msmtprc, and remove your user configuration (or not if you plan on using it for something else). Also make sure it is readable by whatever you are using it with (php, django, etc...).
You need sendmail 8.11 or a later one to do this. Edit with your favorite text editor the file /etc/mail/sendmail.mc and add this line dnl define(SMART_HOST',smtpserver.domain.xxx') [change smtpserver.domain.xxx for your ISP server or any server that is open for you. Now generate the sendmai.cf file, for that use this command
Make sure the email address is provisioned, voicemail notification is set to E-mail notification, E-mail format is set to Full (the other options were removed from the EmailFormat.properties template file found in the Sipfoundry wiki), and the Attach audio option is selected.
The client-info file will placed in a separate directory for ease of administration - the sendmail.mc file will point to the location of the client-info file (.i.e. /etc/mail/auth/client-info) in Step 6. Issue the following commands:
The sendmail macro file (sendmail.mc) is found in the /etc/mail/ directory. The file varies slightly depending on whether sendmail on the SipXcom server is talking to the 1and1.com SMTP server, gmail.com SMTP server, Cablevision optimum.net SMTP server, or Microsoft Exchange SMTP server without authentication. Configuration files for 1and1, gmail, and optimum are documented with and without SASL authentication using certificates.
Select the appropriate provider and edit the /etc/mail/sendmail.mc file. The following statements should be inserted just above the first mailer instance in the default sendmail.mc file that is installed with a new SipXcom installation.
For 1and1.com without enabling SASL certificates, add the following statements above the first "MAILER" instance in the sendmail.mc file.
For 1and1.com with SASL authentication, add the following statements above the first "MAILER" instance in the sendmail.mc file. Enable the Cyrus mailer statement by removing the beginning dnl macro in the 'dnl MAILER(cyrusv2) dnl' statement (see code block).
For gmail.com without enabling SASL certificates, add the following statements above the first "MAILER" instance in the sendmail.mc file.
For gmail.com with SASL authentication, add the following statements above the first "MAILER" instance in the sendmail.mc file. Enable the Cyrus mailer statement by removing the beginning dnl macro in the 'dnl MAILER(cyrusv2) dnl' statement (see code block).
For optimum.net without enabling SASL certificates, add the following statements above the first "MAILER" instance in the sendmail.mc file.
For optimum.net with SASL authentication, add the following statements above the first "MAILER" instance in the sendmail.mc file. Enable the Cyrus mailer statement by removing the beginning dnl macro in the 'dnl MAILER(cyrusv2) dnl' statement (see code block).
For Microsoft Exchange with no authentication or SASL certificates, add the following statements above the first "MAILER" instance in the sendmail.mc file.
Now that everything in the OCI services is set up correctly, connect to the compute instance from which you will be sending emails and sudo to root. Edit the /etc/mail/authinfo file. The file needs to be created if it does not exist. Add the following line, replacing the AuthInfo, I, and P values with the SMTP server name and generated SMTP credentials from the previous step:
Rather than keeping the SMTP credentials stored in plain text, the following command is used to generate the password database file in an encrypted format. After executing the following command, delete the /etc/mail/authinfo file. Use this command: 2ff7e9595c
Comentarios