Swiftmailer: Problems with sending mails using CLI - symfony

I use Symfony and SwiftMailer as post manager. I can send post using console command, but when I send using browser client the post is not sent and there is nothing in log files. What can be the reason of such strange behavior?

CLI - Command Line Interface
CGI - Common Gateway Interface
You probably mean CGI php that deals with browser routine.
I faced the same problem using nginx. Swiftmailer refuse to send any e-mails triggered by CGI PHP, but nevertheless it successfully sends e-mails by swiftmailer:email:send command in console.
I found that the cause of this problem is function stream_socket_client in disabled_functions of my nginx config. Just remove stream_socket_client from disabled functions, reboot your server and try again, it should help.

Related

Configuring symfony to send mail via Postfix

After installing Postfix on my Ubuntu server and getting my Symfony application running, I'm attempting to have the system send emails via Postfix. I tested it out in the terminal to make sure that it sends properly and it does, but I'm confused as to what the Symfony configurations are to have SwiftMailer send email through Postfix.
In the .env file, there is a MAILER_URL attribute. What do I input there? My hostname? One of the destinations? Something else entirely? Help would be appreciated.

Requested action aborted: Access violation at address 005F6DB2 in module '***.exe'. Read of address 00000000

I am using Apache Jmeter to send FTP load on a Server. After setting up the FTP request on specific IP and port, I get this error:
Requested action aborted: Access violation at address 005F6DB2 in module '***.exe'. Read of address 00000000
I know that I have all the access and I don't know why a module can block me, although I know that software (***.exe) is not blocking my ports. What is the problem?
Here is the attached Wireshark screenshot from the server when sending the clients request, the red line is the problem and it occurs in different places each time I run the test.
The problem doesn't seem to be related to JMeter
Try uploading file(s) using "normal" FTP client like FileZilla or WinSCP.
If the problem persists:
try identifying its cause using Windows Event Viewer
try to trace system calls using i.e. WinDbg
or just raise an issue on your application (FTP component)
If the problem does not occur on "real" FTP clients:
double check that your FTP Request sampler configuration is correct, see Load Testing FTP and SFTP Servers Using JMeter guide for details.
try uploading the file to the other, i.e. public FTP server to see if it works
try implementing file upload purely in Groovy using JSR223 Sampler. See FTPClientExample.java for the code you could re-use. Make sure you have the following line in your script:
ftpClient.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true))

How to respond to HTTP POST from unix (AIX, RHEL, or UB) server?

I am building a custom slash command for slack. When the slack user types a command, ex /uptime, a HTTP POST message is sent to the server URL.
The tutorials I've read all include installing a tool such as ngrok, pagekite, or localtunnel to generate a URL for the local machine.
Since I am working with a server, can I not just open a port and have slack connect directly to that hostname and port? How can I do this?
Doing some research, I came across opening a port with nc, then listening with curl, however I don't understand how to put it all together.
Yes, if you are running your script for handling the POST requests from Slack on a server that has a URL that can be reached on the Internet you do not need a local tunnel like ngrok.
If you starting from scratch I can recommend using a standard Apache + PHP [+ MySql] stack and have a PHP script to interpret and react to the POST request. Of course other script languages (e.g. Python) work just as well.

Issue sending email with postfix via sendgrid

I followed the instructions at https://developers.google.com/compute/docs/sending-mail to setup postfix to send via sendgrid. I believe I have it all setup correctly, but mail is failing. The bounce is not very helpful other than status: 5.0.0 and Action: failed.
Any ideas?
As a wild guess, you might not have run postmap from step 5, or reloaded postfix after updating your /etc/postfix/main.cf. Can you post the log messages from postfix from /var/log/syslog along with your postfix main.cf?
One other question: are you running on Debian, CentOS or something else? I think that the SendGrid instructions you linked to assume Debian, and file locations may be different in CentOS.

Yum client configuration: How to use basic authentication with a port other than 80?

I've run into an issue configuring a Yum repository which I'm serving up with HTTP/Apache.
I want to use http basic authentication, and set the listening port to something other than 80, because this repo is in my DMZ. I was trying to do that by setting up my baseurl as follows (from my repo file):
baseurl=http://user:password#<my-ip>:<my-non-80-port>/yum/RHEL/7/base/$basearch/
The documentation for yum.conf indicates you can do basic http authentication by adding the username/password to the URL as I did above. I get the following error when I try to do a yum search mysql from a client:
[Errno 14] HTTP Error 401: Authorization Required
This indicated to me that the extra ":" specifying the port was confusing yum's parsing of my url. I removed the port, set the server back to port 80, and it works.
So it appears you cannot do basic http authentication AND change the port number that the web server listens on. I noticed that there are username and password directives in newer version of Yum, but my version doesn't appear to have this directives (I am running yum-3.2.22-37.0.1.el5). Is there any workaround for this?
I worked around this by turning off plugins by adding the following line to my yum configuration.
plugins=0
I think the workaround worked because the base yum updater was working fine with the authorization information from baseurl, but some of the plugins (such as the fastmirror plugin) didn't remember the authorization properly. So the behaviour I had without plugins enabled is that initially an update would work, then subsequently it would start to fail with the authorization error in the question. Once I disabled plugins, everything started to work fine.

Resources