How can i configure the smtp server running for gitlab(omnibus) which running on the same machine - smtp

I run the smtp server and gitlab on the same machine, and i am sure the the smtp server which runs the 25 port works because i receive the mail after running the this command --echo "This is the body of the email" | mail -s "This is the subject line" user#example.com. And i configure the gitlab like this in the /etc/gitlab/gitlab.rb
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "localhost"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "myRootName"
gitlab_rails['smtp_password'] = "myRootPassword"
#gitlab_rails['smtp_domain'] = "example.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = false
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = false
Can someone help? Thanks!

If you run a local MTA on the gitlab server there is nothing you need to configure explicitly. The SMTP settings in the gitlab.rb are only required if you use an external server or needs special configuration.
We run gitlab on Debian 8 here with the default installation of postfix. Works out of the box. But exim4 should work just fine as well.
You DO have to configure the following properties:
gitlab_rails['gitlab_email_from'] = 'gitlab#example.com'
gitlab_rails['gitlab_email_display_name'] = 'GitLab'

Related

Getting error while sending email from GCP composer airflow

I am trying to configure email but getting following error.
when running task getting following error: -
I am using Python3 with airflow 10.3 versions in GCP Composer need help.
My airflow.cfg
[email]
email_backend = airflow.contrib.utils.sendgrid.send_email
[smtp]
smtp_host = smtp.gmail.com
smtp_starttls = True
smtp_ssl = False
smtp_user = airflow
smtp_port = 587
smtp_password = mypassword
smtp_mail_from = myemail#gamil.com
in my dag file I have created task :-
dag.py file:-
from airflow.operators.email_operator import EmailOperator
email_task=EmailOperator(task_id='email_task',to="email#gamil.com", subject="test", html_content="<h1>Most important heading here</h1>", files=None, cc=None, bcc=None, mime_subtype='mixed', mime_charset='us_ascii', dag=dag)
Getting error:
ERROR - HTTP Error 401: Unauthorized
python_http_client.exceptions.UnauthorizedError: HTTP Error 401: Unauthorize
The error is an Authorization error, so you need to check that you're setting your Sendgrid API Key (or password, if using a smtp-server) correctly.
Based on your airflow.cfg, it seems to me that you are trying to use both Sendgrid and a third-party smtp server.
The email flag determines which one to use. In this case, the flag email_backend = airflow.contrib.utils.sendgrid.send_email is specifying that you are going to use Sendgrid.
To configure Sendgrid as your email server, you need to obtain your SENDGRID_API_KEY and set both the key and SENDGRID_MAIL_FROM as environment variables.
On the other hand, if you want to use another smtp server, you have to change the email flag to email_backend = airflow.utils.email.send_email_smtp. In this case, you need to override the smtp user and password.
With Google Cloud Composer, you must set the:
SENDGRID_MAIL_FROM
and the:
SENDGRID_API_KEY
Composer "ENVIRONMENT VARIABLES"

WORKING QMAIL TOASTER - QMAIL, VPOPMAIL, DOVECOT AND ROUNDCUBE

Am on an Amazon AWS EC2 Linux AMI Server. I used "Bill's Linux Qmail Toaster v. 0.9.4" at Bill's Linux Qmail Toaster v. 0.9.4 to install the various software packages there, specifically: daemontools, ucspi-tcp, qmail, vpopmail, dovecot, squirrel mail, autorespond, ezmlm-idx and qmailadmin. Qmail, Vpopmail and Dovecot are all working well, having tested as below...
Testing SMTP using telnet localhost 25 has no errors.
Testing IMAP using telnet localhost 143 has no errors.
Testing POP3 using telnet localhost 110 has no errors.
Question #1
Attempting to use squirrel mail brought the frontend error "ERROR: Connection dropped by IMAP server." which I couldn't figure where to check for error log(s). Someone please help. Where do I check to understand this error and fix it?
Question #2
I installed roundcube after squirrel mail failed. I followed the approach at RoundCube Installation. Attempting to login with roundcube shows no frontend error but does not login either. When I survey the roundcube/config/config.inc.php I find only the following basic settings...
$config = array();
$config['db_dsnw'] = 'mysqli://acc:passwd#localhost/roundcube';
$config['default_host'] = 'localhost';
$config['smtp_server'] = 'localhost';
$config['smtp_port'] = 25;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['support_url'] = '';
$config['product_name'] = 'Roundcube Webmail';
$config['des_key'] = 'some_des_key';
$config['plugins'] = array(
'archive',
'zipdownload',
);
$config['skin'] = 'larry';
Are these settings essential for a successful roundcube setup?
Question #3
When I investigate dovecot.conf, which I got after applying the exact steps at Dovecot Installation I see that almost all options and paths are actually commented out, for instance:
base_dir = /var/run/dovecot/
login_dir = /var/run/dovecot/login
login_executable = /usr/local/libexec/dovecot/imap-login
mail_executable = /usr/local/libexec/dovecot/imap
...
login_executable = /usr/local/libexec/dovecot/pop3-login
mail_executable = /usr/local/libexec/dovecot/pop3
auth_socket_path = /var/run/dovecot/auth-master
...
auth_executable = /usr/local/libexec/dovecot/dovecot-auth
...
I haven't tried uncommenting because some like /var/run/dovecot/auth-master do not even seem to exist on my system.
Is this configuration file with such (apparent mistakes) usual and usable?

Unable to retrieve Puppet agent SSL certificate from Puppet master

I have configured a Puppet Master-Agent setup (OS: Ubuntu). Both can ping/ssh each other. DNS is set properly. Master is able to generate new CA and cert while Agent is throwing error when 'puppet agent -t' is executed to generate the certificates.
I received error along with the solution and I performed as suggested and further received:
Exiting; failed to retrieve certificate and waitforcert is disabled
Kindly help in getting this one resolved.
Below is the /etc/puppet/puppet.conf (Same on Master-Agent)
#Settings in [main] are used if a more specific section does not set a value.
[main]
certname = puppetmaster01.example.com
logdir=/var/log/puppet
vardir=/var/lib/puppet
basemodulepath = /etc/puppetlabs/puppet/environments/production/modules:/opt/puppet/share/puppet/modules
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
server = puppetmaster01.example.com
user = puppet
group = puppet
archive_files = true
archive_file_server = puppetmaster01.example.com
[master]
# This section is used by the Puppet master and Puppet cert applications.
dns_alt_names = puppet,puppet.example.com,puppetmaster01,puppetmaster01.example.com,puppetagent01,puppetagent01.example.com
certname = puppetmaster01.example.com
reports = http,puppetdb
reporturl = https://localhost:443/reports/upload
node_terminus = exec
external_nodes = /etc/puppetlabs/puppet-dashboard/external_node
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
storeconfigs_backend = puppetdb
storeconfigs = true
autosign = true
# This section is used by the Puppet agent application.
[agent]
report = true
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
graph = true
pluginsync = true
environment = production
In a puppet master/agent deployment and from the docs, the administrator will need to sign the client's Cert on the puppet master. Have you signed the cert on your puppet master?
Depending on which version of puppet you're on:
Try running sudo puppetserver ca sign fullnameOFhost.something.com
or
sudo puppet cert sign <name of host>
You can look at outstanding client certs that need signing by running sudo puppet cert list or sudo puppetserver ca list, again depending on the version.

Postfix relay on multiple local smtp servers

I have two SMTP servers listening on ports 2525 and 2526.
But I have only 1 public IP address.
I'd like to use postfix (already installed on my server) to receive emails only for domain xxx.company.com and domain yyy.company.com, and redirect those emails to server 1 (port 2525) for domain xxx.company.com and server 2 (port 2526) for domain yyy.company.com.
Postfix will not be used to send emails. Just receive.
I tried several postfix configurations but I haven't figured out how to do this properly.
For now, I end up with this:
In main.cf:
mydomain = company.com
mydestination = xxx.company.com, yyy.company.com
relay_domains = xxx.company.com, yyy.company.com
transport_maps = hash:/etc/postfix/transport
local_recipient_maps =
unknown_local_recipient_reject_code = 550
In transport.cf:
*xxx.company.com 2525:[localhost]
*yyy.company.com 2526:[localhost]
In master.cf, the following line has been uncommented:
local unix - n n - - local
But I still have an "unknown user" error if my maillog file.
I would like to be more accurate for local_recipients so I don't let the entire world enter my postfix.
Does anyone have an out-of-the-box example of such kind of configuration ?
Thanks,
Jeremy B.
Your main.cf should be
#/etc/postfix/main.cf
mydomain = company.com
mydestination = xxx.company.com, yyy.company.com
relay_domains =
transport_maps = hash:/etc/postfix/transport
local_recipient_maps = hash:/etc/postfix/local_users
also add the following files
#/etc/postfix/local_users
# Here ACCEPT can be anything,postfix doesn't use it.
someuser#xxx.company.com ACCEPT
someuser#yyy.company.com ACCEPT
#/etc/postfix/transport
xxx.company.com smtp:[localhost]:2525
yyy.company.com smtp:[localhost]:2526
# modify localhost, if the server1 and server2 is not on localhost
Hope that helps.

Debian Exim4 SMTP-AUTH stopped working

I have a strange problem that recently popped on my Debian Squeeze server.
I've had Exim4 configured to use SMTP-AUTH with encryption setup and running on this box for a long time, but now it doesn't work.
At first I thought it was maybe my certificates expired, but that wasn't the case, they're good for several more years.
It appears that the server isn't listening on port 25 any longer.
If I try to telnet to port 25 it times out.
If I run netstat -tulpen on the server nothing is listening on port 25.
I'm using the splitconf for Exim4.
In conf.d/main I'm enabling MAIN_TLS_ENABLE=true
In conf.d/auth/30_exim4-config_examples I have the following
# Authenticate against local passwords using sasl2-bin
# Requires exim_uid to be a member of sasl group, see README.Debian.gz
plain_saslauthd_server:
driver = plaintext
public_name = PLAIN
server_condition = ${if saslauthd{{$auth2}{$auth3}}{1}{0}}
server_set_id = $auth2
server_prompts = :
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif
#
login_saslauthd_server:
driver = plaintext
public_name = LOGIN
server_prompts = "Username:: : Password::"
# don't send system passwords over unencrypted connections
server_condition = ${if saslauthd{{$auth1}{$auth2}}{1}{0}}
server_set_id = $auth1
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif
On the server if I run this command:
swaks -a -tls -q HELO -s localhost -au A_USER_NAME -ap '<>'
I get this ...
=== Trying localhost:25...
* Error connecting 0.0.0.0 to localhost:25:
* IO::Socket::INET: connect: Connection refused
Can someone point me to some more advanced debugging techniques?
OK. I figured it out.
Comcast blocks port 25. I don't know why this is coming up now, unless they've recently started blocking it.
I had to change a line in /etc/default/exim4
From this
SMTPLISTENEROPTIONS='-oX 25 -oP /var/run/exim4/exim.pid'
To this
SMTPLISTENEROPTIONS='-oX 465:25 -oP /var/run/exim4/exim.pid'
I also added this to /etc/exim4/conf.d/main/03_exim4-config_tlsoptions
tls_on_connect_ports=465
It's odd that this just popped up, unless a Debian package updated the /etc/default/exim4 file. It's confusing, but it's working. Hopefully this will be helpful to someone in the future.
Cheers.