How to see all undelivered mails in Apache James - james

I am facing an issue with Apache James.
I see mails are showing as Successfully Spooled but its not going out of the system/ not getting delivered. I checked the destination and that is fine.
Is there any cli or way using which I can track mails which are stuck in James queue?
And if they are stuck how do I resend them?

Related

Email sending stops from aws linux server shows "Deferred: Connection timed out" , mails are stuck in queue, how to fix this?

Working on AWS, linux server using core php. Php mail function working earlier but stops suddenly, all the mails are stuck in queue receiving very late after 1 hour, showing an error of "Deferred: Connection timed out". How to fix this?
AWS throttles outbound traffic on port 25 and might be causing this, you can ask them to remove it if haven't done already.
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/

How to build friend list where user status is shown online/offline?

I've 2 ideas.
Idea #1:
Using Redis put people currently online into set. Then from client side user would periodically send a request to send him status for all of his friends. Server would make sql request to get all friends and find them in the redis set and if so then they are online.
Idea #2:
Using Redis PubSub, when you as a user are online you subscribe to all n friend channels. And whenever a user goes online he publishes on a channel that he or she is online. And whoever maybe listening will get notified.
Now I can't tell which one is more scalable and efficient.
I think idea #1 should be the solution. idea #2 CANNOT work.
Redis doesn't keep published messages. So if a client is NOT connecting to Redis, the message will be lost. When he reconnects to Redis, he won't receive any messages published before.
In your case of idea #2, when a user logs in, he has no idea whether his friends are already online. Because his online friends have published online messages before he logs in, and he won't get these messages.

How to read message thread in Java mail?

I am developing an email client. I have being able to retrieve messages from server (Dovecot imap). I am not able to retrieve or to show the related reply messages. This concept is know as message thread. Can anyone help me about how to get this message thread in Java mail?
I tried using gimap (Google imap) lib but got confused.

How to act upon error log additions?

Normally I watch logs using tail -f /the/error.log, but I normally only act upon them when I hear people complain. I know you can send them to an email address, but email simply sucks. So I rather want the error logs of my server to be sent to a dedicated slack channel.
My question is: how can I watch additions to the error log and catch those additions in a variable so I can send them as json to the slack webhook? I also wonder, what if the error logs is more than one line? I don't want a 20-line error to be sent as 20 separate messages.
All tips are welcome!

Mass Email From dedicated IP and Server

We have a dedicated server and we are sending emails from a dedicated IP. We are using PHP mailer Script and Exim to send out emails. The problem I am facing is we are sending very low volume emails eg. only 25 k emails but When we check emails in queue, its says 85k emails. We are running cron to fetch and send emails.
The sending speed is very low. It took whole day to send 24k emails and server timed out many a times in Between( ALso smtp 421 error). I am confused if I am only sending 24k emails how come 85 k emails get in queue and why it is taking so much time. I also Talked to support guys but I did not get any satisfactory answer. This issue is related to the script, cron or settings related to server?
Any help will be appreciated.
Thanks,
Anand
If your mails are 25k, but going to multiple recipients at different domains, they will need to be sent separately to each domain, so if you have at least four recipient mail servers for the message, you can easily have a queue of 85k. 4 * 25k > 85k
An SMTP response beginning with 4 (e.g. 421) means the message could not be sent immediately, so try again later. This could just mean there was a temporary problem with the recipient server, or there may be some other reason. You will need to contact the recipient about that one.
As for the speed, based on the volume of messages you are sending, you probably look very much like a spammer. When you are suspected of sending spam, a recipient mail server (or your ISP) can quite reasonably throttle or refuse your connection, causing mails to take longer to send. This is probably why you are getting a backlog.
If you aren't a spammer, hang in there. Eventually, other mail servers will learn to trust you. A new mail server is always going to look suspicious, especially if it is sending a large number of small emails. You will eventually build up a good reputation if you continuously send legitimate emails.
On the other hand, if you are a spammer, give up now, you're not going to win.
If you need to send out lots of messages and cannot afford to wait to build up your reputation, perhaps consider either sending via your ISP's mail server (fair use limits may apply), or using a bulk-mail service such as Mailchimp, or one of its competitors.

Resources