gitlab can't deliver email normally - gitlab

I have installed the gitlab-omnibus version in my centos.It seems that everything is OK.But when a newer want to sign up, he/she must recieve the comfirm enalbe which send from gitlab.I have config the /etc/gitlab/gitlab.rb according to the gitlab's office document.
And I check my var/log/email,I found the message is as follow:
Apr 22 15:05:39 iZ23syflhhzZ postfix/cleanup[5899]: 9789EC3907: message-id=<201504220705.t3M75dkU005893#iZ23syflhhzZ>
Apr 22 15:05:39 iZ23syflhhzZ sendmail[5893]: t3M75dkU005893: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32576, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 9789EC3907)
Apr 22 15:05:39 iZ23syflhhzZ postfix/qmgr[5724]: 9789EC3907: from=<>, size=4301, nrcpt=1 (queue active)
Apr 22 15:05:39 iZ23syflhhzZ postfix/smtpd[5896]: disconnect from localhost[127.0.0.1]
Apr 22 15:05:39 iZ23syflhhzZ postfix/cleanup[5899]: A6D63C38FD: message-id=<201504220705.t3M75dkU005893#iZ23syflhhzZ>
Apr 22 15:05:39 iZ23syflhhzZ postfix/qmgr[5724]: A6D63C38FD: from=<>, size=4456, nrcpt=1 (queue active)
Apr 22 15:05:39 iZ23syflhhzZ postfix/local[5900]: 9789EC3907: to=<postmaster#iZ23syflhhzZ.localdomain>, orig_to=<postmaster#iZ23syflhhzZ>, relay=local, delay=0.1, delays=0.05/0.04/0/0.01, dsn=2.0.0, status=sent (forwarded as A6D63C38FD)
Apr 22 15:05:39 iZ23syflhhzZ postfix/qmgr[5724]: 9789EC3907: removed
Apr 22 15:05:40 iZ23syflhhzZ postfix/smtp[5902]: A6D63C38FD: to=<hiufan#qq.com>, orig_to=<postmaster#iZ23syflhhzZ>, relay=mx3.qq.com[113.108.16.62]:25, delay=0.73, delays=0.01/0.03/0.12/0.57, dsn=5.0.0, status=bounced (host mx3.qq.com[113.108.16.62] said: 550 Mail content denied. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 (in reply to end of DATA command))
Apr 22 15:05:40 iZ23syflhhzZ postfix/qmgr[5724]: A6D63C38FD: removed
It is very confused that I am not setting the email called hiufan#qq.com,I just setting the 066337#sina.com as the default sender email.
Here is my setting of /etc/gitlab/gitlab.rb:
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.sina.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "066337#sina.com"
gitlab_rails['smtp_password'] = "xxxxxx"
gitlab_rails['smtp_domain'] = "sina.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['gitlab_email_from'] = "066337#sina.com"
user["git_user_email"] = "066337#sina.com"
Could anyone tell me why this happened?Thank you very much.

Look at the second last line of the log file
to=<hiufan#qq.com>, orig_to=<postmaster#iZ23syflhhzZ>, relay=mx3.qq.com[113.108.16.62]:25, delay=0.73, delays=0.01/0.03/0.12/0.57, dsn=5.0.0, status=bounced (host mx3.qq.com[113.108.16.62] said: 550 Mail content denied. (in reply to end of DATA command))
If hiufan#qq.com is the email address of the user registering, that
indicates that the message was sent by the gitlab machine but rejected by the receiving mail server (at qq.com):
status=bounced (host mx3.qq.com[113.108.16.62] said: 550 Mail content denied
Looking at the given link (using google translate)
http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726
it seems that it was rejected as it is identified as spam/bulk email. (I guess that if you do read chinese the error message makes more sense)
If so, I don't think there is much you can do at the gitlab side. You can perhaps try to edit the confirmation message template, but it is and automatically generated email and there is always a risk of a spam filter identifying it as such.

Gitlab confirmation emails can easily be identified as spam. And QQMail is really powerful in identifying and rejecting spam.
My suggestion would be changing the config of Gitlab, to stop needing confirmation email for registration.

Related

running background tasks through dramatic does not work

I'm trying to run background task processing, redis and rabbitMQ work in separate docker containers
#dramatiq.actor(store_results=True)
def count_words(url):
try:
response = requests.get(url)
count = len(response.text.split(" "))
print(f"There are {count} words at {url!r}.")
except requests.exceptions.MissingSchema:
print(f"Message dropped due to invalid url: {url!r}")
result_backend = RedisBackend(host="172.17.0.2", port=6379)
result_broker = RabbitmqBroker(host="172.17.0.5", port=5672)
result_broker.add_middleware(Results(backend=result_backend))
dramatiq.set_broker(result_broker)
message = count_words.send('https://github.com/Bogdanp/dramatiq')
print(message.get_result(block=True))
RabbitMQ:
{"queue_name":"default","actor_name":"count_words","args":["https://github.com/Bogdanp/dramatiq"],"kwargs":{},"options":{},"message_id":"8e10b6ef-dfef-47dc-9f28-c6e07493efe4","message_timestamp":1608877514655}
Redis
1:C 22 Dec 2020 13:38:15.415 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 22 Dec 2020 13:38:15.417 * Running mode=standalone, port=6379.
1:M 22 Dec 2020 13:38:15.417 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 22 Dec 2020 13:38:15.417 # Server initialized
1:M 22 Dec 2020 13:38:15.417 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 22 Dec 2020 13:38:15.417 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').
1:M 25 Dec 2020 10:08:12.274 * Background saving terminated with success
1:M 26 Dec 2020 19:23:59.445 * 1 changes in 3600 seconds. Saving...
1:M 26 Dec 2020 19:23:59.660 * Background saving started by pid 24
24:C 26 Dec 2020 19:23:59.890 * DB saved on disk
24:C 26 Dec 2020 19:23:59.905 * RDB: 4 MB of memory used by copy-on-write
1:M 26 Dec 2020 19:23:59.961 * Background saving terminated with success
Error:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/dramatiq/message.py", line 147, in get_result
return backend.get_result(self, block=block, timeout=timeout)
File "/usr/local/lib/python3.6/dist-packages/dramatiq/results/backends/redis.py", line 81, in get_result
raise ResultTimeout(message)
dramatiq.results.errors.ResultTimeout: count_words('https://github.com/Bogdanp/dramatiq')

How to send mail to #m.facebook.com with mail command line

I want to update my facebook status by sending an email to xxx#m.facebook.com. It works with Thunderbird or webmail. But with mail command of Linux, it does not send emails to xxx#m.facebook.com but works with emails to #gmail.com and others.
How can I send emails to xxx#m.facebook.com by using the mail or sendmail command?
Below is the log from mail.log:
Aug 4 04:02:34 s17773461 sm-mta[28533]: s7492YBE028533: from=<root#xxxx>, size=397, class=0, nrcpts=1, msgid=<201408040902.s7492YQJ028532#xxxx>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Aug 4 04:02:34 s17773461 sendmail[28532]: s7492YQJ028532: to=xxx#m.facebook.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30053, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s7492YBE028533 Message accepted for delivery)
Aug 4 04:02:34 s17773461 sm-mta[28535]: s7492YBE028533: to=<xxx#star.c10r.facebook.com>, ctladdr=<root#xxxx> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120397, relay=msgin.t.facebook.com. [173.252.113.23], dsn=5.0.0, stat=Service unavailable
Aug 4 04:02:34 s17773461 sm-mta[28535]: s7492YBE028533: s7492YBE028535: DSN: Service unavailable

Cannot add members to MongoDB Replica Set

I'm trying to configure a MongoDB Replica Set but every time I try to add another member it fails.
I have 3 members I'm trying to configure. Their mongod.conf files all look like this:
# mongo.conf
#where to log
logpath=/log/mongod.log
logappend=true
# fork and run in background
fork = true
smallfiles=true
rest=true
port = 27017
replSet=KidzpaceReplSet
dbpath=/data
With the acception of the ports. They are 27017(Primary), 27018(Secondary) and 27019(Arbiter) respectively.
I have verified that the members can see each other:
[ec2-user#domU-12-31-39-06-C4-74 ~]$ mongo --host 174.129.232.170 --port 27018
MongoDB shell version: 2.4.3
connecting to: 174.129.232.170:27018/test
>
[ec2-user#domU-12-31-39-0A-30-E8 ~]$ mongo --host 174.129.230.20 --port 27017
MongoDB shell version: 2.4.3
connecting to: 174.129.230.20:27017/test
>
When adding the second member to the set it returns OK:
KidzpaceReplSet:PRIMARY> rs.add("174.129.232.170:27018")
{ "ok" : 1 }
However whatever the next command I run is, In this case it's adding my Arbiter, the set fails with this error:
KidzpaceReplSet:PRIMARY> rs.add("174.129.232.177:27019", true)
Tue May 28 20:24:07.139 DBClientCursor::init call() failed
Tue May 28 20:24:07.140 trying reconnect to 127.0.0.1:27017
Tue May 28 20:24:07.141 reconnect 127.0.0.1:27017 ok
reconnected to server after rs command (which is normal)
This is the the log file:
Tue May 28 20:44:06.173 [rsStart] replSet I am domU-12-31-39-06-C4-74:27017
Tue May 28 20:44:06.173 [rsStart] replSet STARTUP2
Tue May 28 20:44:07.175 [rsSync] replSet SECONDARY
Tue May 28 20:44:07.175 [rsMgr] replSet info electSelf 0
Tue May 28 20:44:08.174 [rsMgr] replSet PRIMARY
Tue May 28 20:44:29.813 [conn1] replSet replSetReconfig config object parses ok, 2 members specified
Tue May 28 20:44:29.817 [conn1] replSet replSetReconfig [2]
Tue May 28 20:44:29.817 [conn1] replSet info saving a newer config version to local.system.replset
Tue May 28 20:44:29.834 [conn1] replSet saveConfigLocally done
Tue May 28 20:44:29.834 [conn1] replSet info : additive change to configuration
Tue May 28 20:44:29.834 [conn1] replSet replSetReconfig new config saved locally
Tue May 28 20:44:39.835 [rsHealthPoll] DBClientCursor::init call() failed
Tue May 28 20:44:39.835 [rsHealthPoll] replset info 174.129.232.170:27018 heartbeat failed, retrying
Tue May 28 20:44:40.834 [rsHealthPoll] DBClientCursor::init call() failed
Tue May 28 20:44:40.834 [rsHealthPoll] replSet info 174.129.232.170:27018 is down (or slow to respond):
Tue May 28 20:44:40.835 [rsHealthPoll] replSet member 174.129.232.170:27018 is now in state DOWN
Tue May 28 20:44:40.835 [rsMgr] replSet total number of votes is even - add arbiter or give one member an extra vote
Tue May 28 20:44:40.835 [rsMgr] can't see a majority of the set, relinquishing primary
Tue May 28 20:44:40.835 [rsMgr] replSet relinquishing primary state
Tue May 28 20:44:40.835 [rsMgr] replSet SECONDARY
Tue May 28 20:44:40.835 [rsMgr] replSet closing client sockets after relinquishing primary
Tue May 28 20:44:42.044 [conn1] end connection 127.0.0.1:58727 (0 connections now open)
Tue May 28 20:44:46.150 [rsHealthPoll] replSet member 174.129.232.170:27018 is up
Tue May 28 20:44:46.151 [rsMgr] replSet not electing self, not all members up and we have been up less than 5 minutes
Tue May 28 20:44:52.156 [rsMgr] replSet not electing self, not all members up and we have been up less than 5 minutes
UPDATE
I'm wondering if maybe the problem is when I run rs.initiate(). It gives me this output:
{
"set" : "KidzpaceReplSet",
"date" : ISODate("2013-05-28T20:59:05Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "domU-12-31-39-06-C4-74:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 23,
"optime" : {
"t" : 1369774732,
"i" : 1
},
"optimeDate" : ISODate("2013-05-28T20:58:52Z"),
"self" : true
}
],
"ok" : 1
}
Notice the name of the member? "name" : "domU-12-31-39-06-C4-74:27017" Where does this name come from? It's not my IP Address. I'm not sure but maybe this could be the source of the problem.
So it turns out rs.initiate() might give the member that launches it some kind of internal alias for it's IP address. In my case it was: domU-12-31-39-06-C4-74.
The initial connection to the secondary is fine because the primary instigates it. However since the secondary now has this alias to use when it tries to talk back to the primary, it fails.
The solution was a to copy the existing configuration:
cfg = rs.conf()
manually change the name(host) of the primary node:
cfg.members[0].host = 666.666.666.666:27017
And reconfigure the replica set:
rs.reconfig(cfg)

Need help - SoapUi testRunner.getStatus() is returning the status as "RUNNING" indefinitely

In SoapUI after executing a soap request test step (which is under a test suite -> test case)
through testRunner.runTestStepByName("Soap Request Name")
and waiting for 10 seconds after that soap request execution testRunner.getStatus() is returning RUNNING status . below is the groovy script (which is under same test suite -> test case)
import groovy.sql.Sql;
import com.eviware.soapui.model.testsuite.TestRunner.Status
testRunner.runTestStepByName("GetCitiesByCountry - Request 1")
sleep(10000)
log.info( "...${testRunner.getStatus()}...")
while ( testRunner.getStatus() == Status.RUNNING ) {
log.info(testRunner.getStatus())
}
the output is below
Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
Wed Apr 17 21:06:22 IST 2013:INFO:RUNNING
.
.
continuing for infinite time...
Ideally it should return FINISHED since the above test step is executed ,
Advanced thanks for any help to this
It sounds logical, as long as you are in the loop, the test is 'running'. You can get the status with this:
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
myTestStepResult = testRunner.runTestStepByName("GetCitiesByCountry - Request 1")
myStatus = myTestStepResult.getStatus()
if (myStatus == TestStepStatus.OK)
log.info "The step status is: " + myStatus.toString()
else
log.error "The step status is: " + myStatus.toString()
Also, as the call to runTestStepByName is synchronous, there is no 'running' status, only 'CANCELED', 'FAILED', 'OK' or 'UNKNOWN'.
See the doc here

linux ftp server log file to include additional information

I am implementing the ftp server on linux box (fedora 11, vsftpd). Everything works good so far but i need Ftp server log files to contain transfer rate information.
At the moment when I use "get " or " put" command from client end , I got following message on ftp client
example
ftp: 18 bytes received in 0.00seconds 18000.00kbytes/sec.
Is there is any way , I can get same message on ftp server side?
Below is the sample of my xferlog file
Tue Oct 23 01:28:52 2012 1 10.65.112.55 1 /home/test/testfile b _ o r test ftp 0 * c
Tue Oct 23 01:32:46 2012 1 10.65.112.55 18 /home/test/uploadServer b _ i r test ftp 0 * c
Tue Oct 23 01:50:23 2012 1 192.168.10.27 1 /home/test/testfile a _ o r test ftp 0 * c
Tue Oct 23 01:50:36 2012 1 192.168.10.27 19 /home/test/test a _ i r test ftp 0 * c
I really appreciate everyone's help here.
Well I have solved that.
I have included
*dual_log_enable= yes* in the vsftpd.conf file and as a result it created the new log file as /var/log/vsftpd.log and it contains all the information that I need.

Resources